From 1b5f77cc0f1165906c5dbc66a3e844bf8a1348d0 Mon Sep 17 00:00:00 2001 From: Omar Awile Date: Tue, 26 Sep 2023 23:51:22 +0200 Subject: [PATCH 01/12] use Batch.hoc in 136803 --- modeldb/modeldb-run.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modeldb/modeldb-run.yaml b/modeldb/modeldb-run.yaml index 5b95cd7..7b4d008 100644 --- a/modeldb/modeldb-run.yaml +++ b/modeldb/modeldb-run.yaml @@ -1584,9 +1584,11 @@ curate_patterns: - pattern: '^(setup|run|finish)time\s+=\s+([0-9.]+)$' repl: '\1time = %masked%' + script: + - sed -i '/wopen/d' Batch.hoc + - cp Batch.hoc mosinit.hoc run: - run() - - verify_graph_() model_dir: mod_files 143719: script: From 32afbb2566015c6463747b401b3eb0bd9733acc8 Mon Sep 17 00:00:00 2001 From: Nicolas Cornu Date: Wed, 27 Sep 2023 00:01:18 +0200 Subject: [PATCH 02/12] Set from PR --- .github/workflows/nrn-modeldb-ci.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/nrn-modeldb-ci.yaml b/.github/workflows/nrn-modeldb-ci.yaml index 0619fab..6ea5883 100644 --- a/.github/workflows/nrn-modeldb-ci.yaml +++ b/.github/workflows/nrn-modeldb-ci.yaml @@ -63,6 +63,15 @@ jobs: with: repository: ${{ inputs.repo || github.repository }} + - name: parse versions from PR + parse_neuron_v1=$(gh pr view $PR_URL --json body -q '.body | capture("(NEURON_V1=)(?\\d+( \\d+)*)")') + if [ ! -z "$parse_neuron_v1" ]; then + echo "NEURON_V1=$(echo $parse_neuron_v1)" >> $GITHUB_ENV + fi + parse_neuron_v2=$(gh pr view $PR_URL --json body -q '.body | capture("(NEURON_V2=)(?\\d+( \\d+)*)")') + if [ ! -z "$parse_neuron_v2" ]; then + echo "NEURON_V2=$(echo $parse_neuron_v2)" >> $GITHUB_ENV + fi - name: check for Azure drop NEURON_V1 -> ${{ env.NEURON_V1 }} if: startsWith(env.NEURON_V1, 'https://dev.azure.com/neuronsimulator/') run: | From 007af7d6721d13aad17310572cc82fb348ac20f3 Mon Sep 17 00:00:00 2001 From: Omar Awile Date: Tue, 26 Sep 2023 18:52:17 -0400 Subject: [PATCH 03/12] use legacy unit in version 8 --- modeldb/modeldb-run.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/modeldb/modeldb-run.yaml b/modeldb/modeldb-run.yaml index 7b4d008..b626eff 100644 --- a/modeldb/modeldb-run.yaml +++ b/modeldb/modeldb-run.yaml @@ -1586,6 +1586,7 @@ repl: '\1time = %masked%' script: - sed -i '/wopen/d' Batch.hoc + - if $( nrniv --version | grep "VERSION 8" -q) ;then sed -i '/runit/a h.nrnunit_use_legacy(1)' Batch.hoc; fi - cp Batch.hoc mosinit.hoc run: - run() From 4ad4e25f4a209a65dc025204d93abf2824d8447d Mon Sep 17 00:00:00 2001 From: Omar Awile Date: Tue, 26 Sep 2023 19:00:26 -0400 Subject: [PATCH 04/12] small fix --- modeldb/modeldb-run.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modeldb/modeldb-run.yaml b/modeldb/modeldb-run.yaml index b626eff..f82317b 100644 --- a/modeldb/modeldb-run.yaml +++ b/modeldb/modeldb-run.yaml @@ -1586,7 +1586,7 @@ repl: '\1time = %masked%' script: - sed -i '/wopen/d' Batch.hoc - - if $( nrniv --version | grep "VERSION 8" -q) ;then sed -i '/runit/a h.nrnunit_use_legacy(1)' Batch.hoc; fi + - if $(nrniv --version | grep "VERSION 8" -q) ; then sed -i '/runit/a h.nrnunit_use_legacy(1)' Batch.hoc; fi - cp Batch.hoc mosinit.hoc run: - run() From 04ef236760bd8f0be2eb042519cdefd4582ebf5c Mon Sep 17 00:00:00 2001 From: Omar Awile Date: Tue, 26 Sep 2023 19:04:53 -0400 Subject: [PATCH 05/12] temporily remove Nico's additio --- .github/workflows/nrn-modeldb-ci.yaml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.github/workflows/nrn-modeldb-ci.yaml b/.github/workflows/nrn-modeldb-ci.yaml index 6ea5883..0619fab 100644 --- a/.github/workflows/nrn-modeldb-ci.yaml +++ b/.github/workflows/nrn-modeldb-ci.yaml @@ -63,15 +63,6 @@ jobs: with: repository: ${{ inputs.repo || github.repository }} - - name: parse versions from PR - parse_neuron_v1=$(gh pr view $PR_URL --json body -q '.body | capture("(NEURON_V1=)(?\\d+( \\d+)*)")') - if [ ! -z "$parse_neuron_v1" ]; then - echo "NEURON_V1=$(echo $parse_neuron_v1)" >> $GITHUB_ENV - fi - parse_neuron_v2=$(gh pr view $PR_URL --json body -q '.body | capture("(NEURON_V2=)(?\\d+( \\d+)*)")') - if [ ! -z "$parse_neuron_v2" ]; then - echo "NEURON_V2=$(echo $parse_neuron_v2)" >> $GITHUB_ENV - fi - name: check for Azure drop NEURON_V1 -> ${{ env.NEURON_V1 }} if: startsWith(env.NEURON_V1, 'https://dev.azure.com/neuronsimulator/') run: | From acf023ca61ec93d88b11fc9c8d643f904e803afe Mon Sep 17 00:00:00 2001 From: Omar Awile Date: Tue, 26 Sep 2023 19:11:49 -0400 Subject: [PATCH 06/12] one more fix --- modeldb/modeldb-run.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modeldb/modeldb-run.yaml b/modeldb/modeldb-run.yaml index f82317b..73e30a5 100644 --- a/modeldb/modeldb-run.yaml +++ b/modeldb/modeldb-run.yaml @@ -1586,7 +1586,7 @@ repl: '\1time = %masked%' script: - sed -i '/wopen/d' Batch.hoc - - if $(nrniv --version | grep "VERSION 8" -q) ; then sed -i '/runit/a h.nrnunit_use_legacy(1)' Batch.hoc; fi + - if $(nrniv --version | grep "VERSION 8" -q) ; then sed -i '/runit/a nrnunit_use_legacy(1)' Batch.hoc; fi - cp Batch.hoc mosinit.hoc run: - run() From 8323090a36cf17a4a533e034b297091023f7b311 Mon Sep 17 00:00:00 2001 From: Nicolas Cornu Date: Wed, 27 Sep 2023 00:01:18 +0200 Subject: [PATCH 07/12] Set from PR --- .github/workflows/nrn-modeldb-ci.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/nrn-modeldb-ci.yaml b/.github/workflows/nrn-modeldb-ci.yaml index 0619fab..c5c3b16 100644 --- a/.github/workflows/nrn-modeldb-ci.yaml +++ b/.github/workflows/nrn-modeldb-ci.yaml @@ -63,6 +63,15 @@ jobs: with: repository: ${{ inputs.repo || github.repository }} + - name: parse versions from PR + parse_neuron_v1=$(gh pr view $PR_URL --json body -q '.body | capture("(?NEURON_V1=[\r\n]*)")') + if [ ! -z "$parse_neuron_v1" ]; then + echo "$(echo $parse_neuron_v1 | jq -r .nrnV1)" >> $GITHUB_ENV + fi + parse_neuron_v2=$(gh pr view $PR_URL --json body -q '.body | capture("(?NEURON_V2=[\r\n]*)")') + if [ ! -z "$parse_neuron_v2" ]; then + echo "$(echo $parse_neuron_v2 | jq -r .nrnV2)" >> $GITHUB_ENV + fi - name: check for Azure drop NEURON_V1 -> ${{ env.NEURON_V1 }} if: startsWith(env.NEURON_V1, 'https://dev.azure.com/neuronsimulator/') run: | From ae53a9c4729a4f3c24b4ff117fb46fe57d0de4e6 Mon Sep 17 00:00:00 2001 From: Nicolas Cornu Date: Wed, 27 Sep 2023 12:30:07 +0200 Subject: [PATCH 08/12] Fix ci --- .github/workflows/nrn-modeldb-ci.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/nrn-modeldb-ci.yaml b/.github/workflows/nrn-modeldb-ci.yaml index c5c3b16..d2a1c00 100644 --- a/.github/workflows/nrn-modeldb-ci.yaml +++ b/.github/workflows/nrn-modeldb-ci.yaml @@ -64,6 +64,7 @@ jobs: repository: ${{ inputs.repo || github.repository }} - name: parse versions from PR + run: | parse_neuron_v1=$(gh pr view $PR_URL --json body -q '.body | capture("(?NEURON_V1=[\r\n]*)")') if [ ! -z "$parse_neuron_v1" ]; then echo "$(echo $parse_neuron_v1 | jq -r .nrnV1)" >> $GITHUB_ENV From b07a14a29758f8ede82863ff77f5661c15d1a48d Mon Sep 17 00:00:00 2001 From: Nicolas Cornu Date: Wed, 27 Sep 2023 12:33:41 +0200 Subject: [PATCH 09/12] Use TOKEN to identify the gh --- .github/workflows/nrn-modeldb-ci.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/nrn-modeldb-ci.yaml b/.github/workflows/nrn-modeldb-ci.yaml index d2a1c00..70aa524 100644 --- a/.github/workflows/nrn-modeldb-ci.yaml +++ b/.github/workflows/nrn-modeldb-ci.yaml @@ -73,6 +73,11 @@ jobs: if [ ! -z "$parse_neuron_v2" ]; then echo "$(echo $parse_neuron_v2 | jq -r .nrnV2)" >> $GITHUB_ENV fi + if: github.event_name == 'pull_request' && inputs.repo == '' + env: + PR_URL: ${{ github.event.pull_request.html_url }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: check for Azure drop NEURON_V1 -> ${{ env.NEURON_V1 }} if: startsWith(env.NEURON_V1, 'https://dev.azure.com/neuronsimulator/') run: | From f6b164790687f314a452bdc23bdf0c1ae83f4782 Mon Sep 17 00:00:00 2001 From: Nicolas Cornu Date: Wed, 27 Sep 2023 12:41:43 +0200 Subject: [PATCH 10/12] Fix ci --- .github/workflows/nrn-modeldb-ci.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/nrn-modeldb-ci.yaml b/.github/workflows/nrn-modeldb-ci.yaml index 70aa524..88952db 100644 --- a/.github/workflows/nrn-modeldb-ci.yaml +++ b/.github/workflows/nrn-modeldb-ci.yaml @@ -65,11 +65,11 @@ jobs: - name: parse versions from PR run: | - parse_neuron_v1=$(gh pr view $PR_URL --json body -q '.body | capture("(?NEURON_V1=[\r\n]*)")') + parse_neuron_v1=$(gh pr view $PR_URL --json body -q '.body | capture("(?NEURON_V1=[^\r\n]*)")') if [ ! -z "$parse_neuron_v1" ]; then echo "$(echo $parse_neuron_v1 | jq -r .nrnV1)" >> $GITHUB_ENV fi - parse_neuron_v2=$(gh pr view $PR_URL --json body -q '.body | capture("(?NEURON_V2=[\r\n]*)")') + parse_neuron_v2=$(gh pr view $PR_URL --json body -q '.body | capture("(?NEURON_V2=[^\r\n]*)")') if [ ! -z "$parse_neuron_v2" ]; then echo "$(echo $parse_neuron_v2 | jq -r .nrnV2)" >> $GITHUB_ENV fi From bae5dac3fa870b6f67c308bf22a2383beecde4b3 Mon Sep 17 00:00:00 2001 From: Nicolas Cornu Date: Wed, 27 Sep 2023 12:55:44 +0200 Subject: [PATCH 11/12] Fix ci --- .github/workflows/nrn-modeldb-ci.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/nrn-modeldb-ci.yaml b/.github/workflows/nrn-modeldb-ci.yaml index 88952db..5a39152 100644 --- a/.github/workflows/nrn-modeldb-ci.yaml +++ b/.github/workflows/nrn-modeldb-ci.yaml @@ -65,6 +65,7 @@ jobs: - name: parse versions from PR run: | + set -x parse_neuron_v1=$(gh pr view $PR_URL --json body -q '.body | capture("(?NEURON_V1=[^\r\n]*)")') if [ ! -z "$parse_neuron_v1" ]; then echo "$(echo $parse_neuron_v1 | jq -r .nrnV1)" >> $GITHUB_ENV @@ -167,6 +168,7 @@ jobs: - name: Run Models with NEURON V1 -> ${{ env.NEURON_V1 }} run: | + set -x # Install NEURON V1 if [[ -d "${DROP_DIR_V1}" ]]; then python -m pip install --user --find-links ${DROP_DIR_V1} neuron-nightly From fca2f8d444e812f76d34a9c959eac7ff51236e40 Mon Sep 17 00:00:00 2001 From: Nicolas Cornu Date: Wed, 27 Sep 2023 14:47:47 +0200 Subject: [PATCH 12/12] Try printing more infos --- modeldb/modelrun.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modeldb/modelrun.py b/modeldb/modelrun.py index 5ae7b55..8911839 100644 --- a/modeldb/modelrun.py +++ b/modeldb/modelrun.py @@ -455,7 +455,8 @@ def _run_models(self, model_runs): pool = multiprocessing.Pool() processed_models = pool.imap_unordered(run_model, model_runs) - for model in ProgressBar.iter(processed_models, self.nof_models): + for i, model in enumerate(ProgressBar.iter(processed_models, self.nof_models)): + self.logger.info(f"[{i} / {self.nof_models}] Running model '{model.id}'") self.run_logs[model.id] = {} self.run_logs[model.id]["logs"] = model.logs if self._gout: