Skip to content

Commit 2f0a863

Browse files
author
Goran Jelic-Cizmek
committed
Merge branch 'master' into jelic/ci_docker_base_image
2 parents 352dd48 + 499cea9 commit 2f0a863

1,258 files changed

Lines changed: 158885 additions & 73326 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.bbp-project.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ tools:
99
ClangFormat:
1010
enable: True
1111
version: == 12.0.1
12+
exclude:
13+
match:
14+
- src/nmodl/language/templates/*
1215
CMakeFormat:
1316
enable: True
1417
version: == 0.6.13
18+
exclude:
19+
match:
20+
- src/nmodl/language/templates/*
21+
- test/nmodl/usecases/*/*

.circleci/config.yml

Lines changed: 0 additions & 98 deletions
This file was deleted.

.github/ISSUE_TEMPLATE/release.md

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,35 +10,22 @@ assignees: ''
1010
Action items
1111
============
1212

13-
Pre-release
14-
---
15-
- [ ] Make sur to look out for ModelDB regressions by launching analyzing [nrn-modeldb-ci last version vs nightly reports](https://github.com/neuronsimulator/nrn-modeldb-ci/actions/workflows/nrn-modeldb-ci.yaml?query=event%3Aschedule++)
16-
1713
Sanity checks
1814
---
19-
- [ ] Create `release/x.y` branch and make sure GitHub, Azure and CircleCI builds pass
20-
- [ ] Run [nrn-build-ci](https://github.com/neuronsimulator/nrn-build-ci/actions/workflows/build-neuron.yml) for the respective Azure build; see [Azure drop guide](https://github.com/neuronsimulator/nrn-build-ci#azure-wheels-testing---manual-workflow)
21-
- [ ] Activate ReadTheDocs build for `release/x.y` & make it hidden. Check docs are fine after build is done.
22-
- [ ] Run a test wheel build WITHOUT upload for `release/x.y` to ensure all the wheels build ([see details](https://nrn.readthedocs.io/en/latest/install/python_wheels.html#publishing-the-wheels-on-pypi-via-azure))
23-
- [ ] Run BBP Simulation Stack & other relevant tests
15+
- [ ] Create `release/x.y` branch and make sure GitHub and Azure builds pass
16+
- [ ] Run any tests not contained in `nrn-build-ci` and `nrn-modeldb-ci`
2417

2518

2619
Releasing
2720
---
2821
- [ ] Update semantic version in `CMakeLists.txt`
2922
- [ ] Update changelog below and agree on it with everyone; then commit it to `docs/changelog` (copy structure as-is)
3023
- [ ] Update `docs/index.rst` accordingly with the new `.pkg` and `.exe` links for `PKG installer` and `Windows Installer`
31-
- [ ] Run the ReadTheDocs build again for `release-x.y`, make sure the build passes and inspect the Changelog page.
32-
- [ ] Create new release+tag on GitHub via [release workflow](https://github.com/neuronsimulator/nrn/actions/workflows/release.yml?query=workflow%3A%22NEURON+Release%22). Note that the GitHub release will be marked as pre-release and will contain the full-src-package and the Windows installer at the end of the release workflow.
33-
- [ ] Build release wheels but WITHOUT upload ([see details](https://nrn.readthedocs.io/en/latest/install/python_wheels.html#publishing-the-wheels-on-pypi-via-azure))
24+
- [ ] Run the ReadTheDocs build again for `release/x.y`, make sure the build passes and inspect the Changelog page.
3425
- [ ] Create, test and upload manual artifacts
3526
- [ ] MacOS package installer (manual task, ask Michael)
36-
- [ ] arm64 wheels (manual task, check with Erik, Goran or Pramod)
37-
- [ ] aarch64 wheels (create a `release/x.y-aarch64` branch for this, see [guide](https://nrn.readthedocs.io/en/latest/install/python_wheels.html#publishing-the-wheels-on-pypi-via-circleci))
38-
- [ ] Publish the `x.y.z` wheels on Pypi; see [wheel publishing instructions](https://nrn.readthedocs.io/en/latest/install/python_wheels.html#publishing-the-wheels-on-pypi-via-azure)
27+
- [ ] Create new release+tag on GitHub via [release workflow](https://github.com/neuronsimulator/nrn/actions/workflows/release.yml?query=workflow%3A%22NEURON+Release%22). Note that the GitHub release will be marked as pre-release and will contain the full-src-package and the Windows installer at the end of the release workflow.
3928
- [ ] Once wheels are published, activate the `x.y.z` tag on ReadTheDocs
40-
- [ ] Rename the Windows installer in the GitHub release to match the new version and the supported python versions (i.e. `nrn-8.2.2.w64-mingw-py-39-310-311-312-setup.exe`
41-
)
4229
- [ ] Publish release on GitHub (edit https://github.com/neuronsimulator/nrn/releases/tag/x.y.z and un-tick the pre-release checkbox)
4330

4431

.github/workflows/coverage.yml

Lines changed: 132 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ env:
2525
PY_MIN_VERSION: '3.9'
2626
PY_MID_VERSION: '3.10'
2727
PY_MAX_VERSION: '3.13'
28+
# The Linux runners have 4 cores:
29+
# https://docs.github.com/en/actions/using-github-hosted-runners/using-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories
30+
CMAKE_BUILD_PARALLEL_LEVEL: '4'
31+
CTEST_PARALLEL_LEVEL: '4'
32+
CCACHE_DIR: ${{ github.workspace }}/ccache
2833

2934
jobs:
3035
coverage:
@@ -47,27 +52,25 @@ jobs:
4752
sudo apt-get install xfonts-100dpi build-essential doxygen lcov libboost-all-dev libopenmpi-dev libmpich-dev libx11-dev libxcomposite-dev mpich openmpi-bin gpg ninja-build flex bison libfl-dev
4853
shell: bash
4954

50-
- name: Setup Caliper profiler
55+
- name: Install a new ccache
5156
run: |
52-
git clone https://github.com/LLNL/Caliper.git
53-
cd Caliper
54-
mkdir build && cd build
55-
cmake ..
56-
make && sudo make install
57+
# versions older than 4.10 do not support -fprofile-update=atomic
58+
wget 'https://github.com/ccache/ccache/releases/download/v4.11.3/ccache-4.11.3-linux-x86_64.tar.xz'
59+
tar xf ccache-4.11.3-linux-x86_64.tar.xz
60+
sudo cp -a ccache-4.11.3-linux-x86_64/ccache /usr/bin/ccache
61+
working-directory: ${{runner.temp}}
5762

58-
- name: Setup MUSIC@${{ env.MUSIC_VERSION }}
63+
- name: Setup cmake
64+
uses: jwlawson/actions-setup-cmake@v2
65+
with:
66+
cmake-version : '3.18'
67+
68+
- name: Setup Caliper profiler
5969
run: |
60-
python3 -m venv music-venv
61-
source music-venv/bin/activate
62-
python3 -m pip install mpi4py cython numpy setuptools
63-
sudo mkdir -p $MUSIC_INSTALL_DIR
64-
sudo chown -R $USER $MUSIC_INSTALL_DIR
65-
curl -L -o MUSIC.zip https://github.com/INCF/MUSIC/archive/${MUSIC_VERSION}.zip
66-
unzip MUSIC.zip && mv MUSIC-* MUSIC && cd MUSIC
67-
./autogen.sh
68-
./configure --with-python-sys-prefix --prefix=$MUSIC_INSTALL_DIR --disable-anysource
69-
make -j install
70-
deactivate
70+
git clone --branch v2.12.1 --depth 1 --recurse-submodules --shallow-submodules https://github.com/LLNL/Caliper.git
71+
cd Caliper
72+
cmake -B build -G Ninja .
73+
sudo cmake --build build --target install
7174
working-directory: ${{runner.temp}}
7275

7376
- name: Setup Xvfb
@@ -79,10 +82,13 @@ jobs:
7982
with:
8083
fetch-depth: 2
8184

82-
- name: Clone nmodl
83-
working-directory: ${{runner.workspace}}/nrn
84-
run: |
85-
git submodule update --init --recursive --force --depth 1 -- external/nmodl
85+
# Restore (and later save) dependencies for min version of Python
86+
- name: Restore Python@${{ env.PY_MIN_VERSION }} dependencies
87+
id: cache-python-min-packages-restore
88+
uses: actions/cache/restore@v4
89+
with:
90+
path: ${{ github.workspace }}/pip_cache${{ env.PY_MIN_VERSION }}
91+
key: cache-${{ env.PY_MIN_VERSION }}-${{ hashFiles('ci/requirements.txt') }}
8692

8793
- name: Set up Python@${{ env.PY_MIN_VERSION }}
8894
uses: actions/setup-python@v5
@@ -92,15 +98,52 @@ jobs:
9298
- name: Install Python@${{ env.PY_MIN_VERSION }} dependencies
9399
working-directory: ${{runner.workspace}}/nrn
94100
run: |
95-
python -m pip install --upgrade -r external/nmodl/requirements.txt
96-
python -m pip install --upgrade -r ci_requirements.txt
97-
python -m pip install --upgrade pip -r nrn_requirements.txt
101+
python -m pip install -r ci/uv_requirements.txt
102+
python -m uv pip install -r ci/requirements.txt --cache-dir ${{ github.workspace }}/pip_cache${{ env.PY_MIN_VERSION }}
103+
104+
- name: Save Python@${{ env.PY_MIN_VERSION }} dependencies
105+
id: cache-python-min-packages-save
106+
if: always() && steps.cache-python-min-packages-restore.outputs.cache-hit != 'true'
107+
uses: actions/cache/save@v4
108+
with:
109+
key: ${{ steps.cache-python-min-packages-restore.outputs.cache-primary-key }}
110+
path: ${{ github.workspace }}/pip_cache${{ env.PY_MIN_VERSION }}
111+
112+
# Restore (and later save) dependencies for mid version of Python
113+
- name: Restore Python@${{ env.PY_MID_VERSION }} dependencies
114+
id: cache-python-mid-packages-restore
115+
uses: actions/cache/restore@v4
116+
with:
117+
path: ${{ github.workspace }}/pip_cache${{ env.PY_MID_VERSION }}
118+
key: cache-${{ env.PY_MID_VERSION }}-${{ hashFiles('ci/requirements.txt') }}
98119

99120
- name: Set up Python@${{ env.PY_MID_VERSION }}
100121
uses: actions/setup-python@v5
101122
with:
102123
python-version: ${{ env.PY_MID_VERSION }}
103124

125+
- name: Install Python@${{ env.PY_MID_VERSION }} dependencies
126+
working-directory: ${{runner.workspace}}/nrn
127+
run: |
128+
python -m pip install -r ci/uv_requirements.txt
129+
python -m uv pip install -r ci/requirements.txt --cache-dir ${{ github.workspace }}/pip_cache${{ env.PY_MID_VERSION }}
130+
131+
- name: Save Python@${{ env.PY_MID_VERSION }} dependencies
132+
id: cache-python-mid-packages-save
133+
if: always() && steps.cache-python-mid-packages-restore.outputs.cache-hit != 'true'
134+
uses: actions/cache/save@v4
135+
with:
136+
key: ${{ steps.cache-python-mid-packages-restore.outputs.cache-primary-key }}
137+
path: ${{ github.workspace }}/pip_cache${{ env.PY_MID_VERSION }}
138+
139+
# Restore (and later save) dependencies for max version of Python
140+
- name: Restore Python@${{ env.PY_MAX_VERSION }} dependencies
141+
id: cache-python-max-packages-restore
142+
uses: actions/cache/restore@v4
143+
with:
144+
path: ${{ github.workspace }}/pip_cache${{ env.PY_MAX_VERSION }}
145+
key: cache-${{ env.PY_MAX_VERSION }}-${{ hashFiles('ci/requirements.txt') }}
146+
104147
- name: Set up Python@${{ env.PY_MAX_VERSION }}
105148
uses: actions/setup-python@v5
106149
with:
@@ -109,10 +152,42 @@ jobs:
109152
- name: Install Python@${{ env.PY_MAX_VERSION }} dependencies
110153
working-directory: ${{runner.workspace}}/nrn
111154
run: |
112-
python -m pip install --upgrade -r external/nmodl/requirements.txt
113-
python -m pip install --upgrade -r ci_requirements.txt
114-
python -m pip install --upgrade pip -r nrn_requirements.txt
155+
python -m pip install -r ci/uv_requirements.txt
156+
python -m uv pip install -r ci/requirements.txt --cache-dir ${{ github.workspace }}/pip_cache${{ env.PY_MAX_VERSION }}
157+
158+
- name: Save Python@${{ env.PY_MAX_VERSION }} dependencies
159+
id: cache-python-max-packages-save
160+
if: always() && steps.cache-python-max-packages-restore.outputs.cache-hit != 'true'
161+
uses: actions/cache/save@v4
162+
with:
163+
key: ${{ steps.cache-python-max-packages-restore.outputs.cache-primary-key }}
164+
path: ${{ github.workspace }}/pip_cache${{ env.PY_MAX_VERSION }}
165+
166+
- name: Setup MUSIC@${{ env.MUSIC_VERSION }}
167+
run: |
168+
python -m venv music-venv
169+
source music-venv/bin/activate
170+
python -m pip install -r ${{ github.workspace }}/ci/uv_requirements.txt
171+
python -m uv pip install -r ${{ github.workspace }}/ci/requirements.txt --cache-dir ${{ github.workspace }}/pip_cache${{ env.PY_MAX_VERSION }}
172+
sudo mkdir -p $MUSIC_INSTALL_DIR
173+
sudo chown -R $USER $MUSIC_INSTALL_DIR
174+
curl -L -o MUSIC.zip https://github.com/INCF/MUSIC/archive/${MUSIC_VERSION}.zip
175+
unzip MUSIC.zip && mv MUSIC-* MUSIC && cd MUSIC
176+
./autogen.sh
177+
./configure --with-python-sys-prefix --prefix=$MUSIC_INSTALL_DIR --disable-anysource
178+
make -j install
179+
deactivate
180+
working-directory: ${{runner.temp}}
115181

182+
# Restore (and later save) ccache
183+
- name: Restore compiler cache
184+
id: restore-compiler-cache
185+
uses: actions/cache/restore@v4
186+
with:
187+
path: ${{ github.workspace }}/ccache
188+
key: ccache-coverage-${{runner.os}}-${{github.ref_name}}
189+
restore-keys: |
190+
ccache-coverage-${{runner.os}}-master
116191
117192
- name: Build & Test
118193
id: build-test
@@ -130,13 +205,18 @@ jobs:
130205
export PYTHON_MID=$(which $PYTHON_MID_NAME);
131206
export PYTHON_MAX=$(which $PYTHON_MAX_NAME);
132207
208+
# Update all submodules with depth 1
209+
git submodule update --init --recursive --depth 1
210+
133211
mkdir build && cd build;
134212
135213
# CMake options & flags
136214
cmake_args=(-G Ninja \
137215
-DCMAKE_BUILD_TYPE=Debug \
138216
-DCMAKE_C_COMPILER="$CC" \
139217
-DCMAKE_CXX_COMPILER="$CXX" \
218+
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
219+
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
140220
-DNRN_ENABLE_BACKTRACE=ON \
141221
-DNRN_ENABLE_CORENEURON=ON \
142222
-DNRN_ENABLE_COVERAGE=ON \
@@ -154,12 +234,12 @@ jobs:
154234
-DMUSIC_ROOT="${MUSIC_INSTALL_DIR}")
155235
cmake .. "${cmake_args[@]}"
156236
# Coverage
157-
# The Linux runners apparently have 2 cores, but jobs were being killed when we did not specify this explicitly.
158-
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
159-
# By default we get a modern version of CMake that understands --parallel.
160-
cmake --build . --parallel 2
237+
ccache -z
238+
ccache -s -v || ccache -s
239+
cmake --build .
240+
ccache -s -v || ccache -s
161241
cmake --build . --target cover_baseline
162-
xvfb-run ctest --rerun-failed --output-on-failure;
242+
xvfb-run ctest --rerun-failed --output-on-failure
163243
for python in "${PYTHON_MIN}" "${PYTHON_MAX}"
164244
do
165245
echo "Using ${python}"
@@ -168,7 +248,7 @@ jobs:
168248
PATH="${PWD}/bin:${PATH}" \
169249
LD_LIBRARY_PATH="${PWD}/lib:${LD_LIBRARY_PATH}" \
170250
DYLD_LIBRARY_PATH="${PWD}/lib:${DYLD_LIBRARY_PATH}" \
171-
"${python}" -c "from neuron import h; import neuron; neuron.test();neuron.test_rxd();"
251+
"${python}" -c "from neuron import h; import neuron; neuron.test();neuron.test_rxd(); from neuron.tests import test_nmodl; test_nmodl.test_nmodl()"
172252
done
173253
cmake --build . --target cover_collect
174254
cmake --build . --target cover_combine
@@ -178,6 +258,24 @@ jobs:
178258
PYTHON_MID_NAME: "python${{ env.PY_MID_VERSION }}"
179259
PYTHON_MAX_NAME: "python${{ env.PY_MAX_VERSION }}"
180260

261+
- name: Upload build artifacts
262+
if: always()
263+
uses: actions/upload-artifact@v4
264+
with:
265+
name: coverage-${{runner.os}}
266+
path: |
267+
${{runner.workspace}}/nrn/build/CMakeCache.txt
268+
${{runner.workspace}}/nrn/build/build.ninja
269+
${{runner.workspace}}/nrn/build/cmake_install.cmake
270+
271+
- name: Save compiler cache
272+
id: save-compiler-cache
273+
if: always() && steps.restore-compiler-cache.outputs.cache-hit != 'true'
274+
uses: actions/cache/save@v4
275+
with:
276+
key: ${{ steps.restore-compiler-cache.outputs.cache-primary-key }}
277+
path: ${{ github.workspace }}/ccache
278+
181279
# This step will set up an SSH connection on tmate.io for live debugging.
182280
# To enable it, you have to:
183281
# * add 'live-debug-coverage' to your PR title

0 commit comments

Comments
 (0)