Skip to content

Commit e03e6c5

Browse files
committed
Merge branch 'main' into auto-update-10.5281/zenodo.7614645
2 parents 56dbbec + b9492a5 commit e03e6c5

File tree

8 files changed

+48
-45
lines changed

8 files changed

+48
-45
lines changed

.github/workflows/auto_update_main.yaml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ jobs:
4545
found_new_resources: ${{ steps.update_external.outputs.found_new_resources || 'no' }}
4646

4747
steps:
48-
- uses: actions/checkout@v2
48+
- uses: actions/checkout@v3
4949
with:
5050
fetch-depth: 0 # get all branches to check for pending resources by checking if auto-update-... branch exists
5151
- name: checkout gh-pages for update_partner_resources.py
52-
uses: actions/checkout@v2
52+
uses: actions/checkout@v3
5353
with:
5454
ref: gh-pages
5555
path: gh-pages
@@ -59,7 +59,7 @@ jobs:
5959
id: update_external
6060
run: python scripts/update_external_resources.py --max-resource-count 15 ${{ github.event_name == 'pull_request' && '--no-ignore-status-5xx' || '--ignore-status-5xx' }}
6161
- name: "Upload collection update"
62-
uses: actions/upload-artifact@v2
62+
uses: actions/upload-artifact@v3
6363
with:
6464
name: collection-update
6565
path: dist
@@ -74,7 +74,7 @@ jobs:
7474
run: python scripts/update_partner_resources.py
7575
- name: Upload preview of updated partner resources
7676
if: github.event_name == 'pull_request'
77-
uses: actions/upload-artifact@v2
77+
uses: actions/upload-artifact@v3
7878
with:
7979
name: preview-partner-resources
8080
path: dist
@@ -108,8 +108,8 @@ jobs:
108108
runs-on: ubuntu-latest
109109

110110
steps:
111-
- uses: actions/checkout@v2
112-
- uses: actions/checkout@v2
111+
- uses: actions/checkout@v3
112+
- uses: actions/checkout@v3
113113
with:
114114
ref: gh-pages
115115
path: gh-pages
@@ -119,7 +119,7 @@ jobs:
119119
run: python scripts/generate_collection_rdf.py
120120
- name: Upload preview of collection.json
121121
if: github.event_name == 'pull_request'
122-
uses: actions/upload-artifact@v2
122+
uses: actions/upload-artifact@v3
123123
with:
124124
name: preview-collection-json
125125
path: dist/collection.json
@@ -151,16 +151,16 @@ jobs:
151151
matrix: ${{ fromJson(needs.update-resources.outputs.updated_resources_matrix) }}
152152

153153
steps:
154-
- uses: actions/checkout@v2
155-
- uses: actions/checkout@v2
154+
- uses: actions/checkout@v3
155+
- uses: actions/checkout@v3
156156
with:
157157
ref: gh-pages
158158
path: gh-pages
159159
- run: mkdir dist
160160
- run: cp gh-pages/pr_urls.json dist
161161
continue-on-error: true
162162
- name: download new collection
163-
uses: actions/download-artifact@v2
163+
uses: actions/download-artifact@v3
164164
with:
165165
name: collection-update
166166
path: collection-update
@@ -177,7 +177,7 @@ jobs:
177177
- name: Create Pull Request
178178
if: github.event_name != 'pull_request'
179179
id: cpr
180-
uses: peter-evans/create-pull-request@v3
180+
uses: peter-evans/create-pull-request@v4
181181
with:
182182
token: ${{ secrets.PAT }} # using a PAT will make sure we can trigger the CI in PR
183183
commit-message: 'Update ${{ matrix.update.resource_id }}'

.github/workflows/post_pr.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
if: github.event.pull_request.merged == false # if pr was merged the branch is deleted via gh settings
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v2
13+
- uses: actions/checkout@v3
1414
- name: check if remote still exists
1515
id: ls-remote
1616
run: |

.github/workflows/reset_pending_auto_update.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
run:
77
runs-on: ubuntu-latest
88
steps:
9-
- uses: actions/checkout@v2
9+
- uses: actions/checkout@v3
1010
- name: install script deps
1111
run: pip install typer
1212
- id: detect_auto_updates

.github/workflows/trigger_partner_wf.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
# - ...
2626

2727
steps:
28-
- uses: actions/checkout@v2
28+
- uses: actions/checkout@v3
2929
with:
3030
ref: gh-pages
3131
- name: trigger ${{ matrix.partner_id }}

.github/workflows/validate_resources.yaml

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ jobs:
2929
has_dynamic_test_cases: ${{ steps.static_validation.outputs.has_dynamic_test_cases }}
3030

3131
steps:
32-
- uses: actions/checkout@v2
33-
- uses: actions/checkout@v2
32+
- uses: actions/checkout@v3
33+
- uses: actions/checkout@v3
3434
with:
3535
ref: last_ci_run
3636
path: last_ci_run
37-
- uses: actions/checkout@v2
37+
- uses: actions/checkout@v3
3838
with:
3939
ref: gh-pages
4040
path: gh-pages
@@ -53,7 +53,7 @@ jobs:
5353
run: python scripts/static_validation.py '${{ steps.update_rdfs.outputs.pending_matrix_bioimageio }}'
5454
- name: Upload static validation summaries and conda envs
5555
if: steps.update_rdfs.outputs.has_pending_matrix_bioimageio == 'yes'
56-
uses: actions/upload-artifact@v2
56+
uses: actions/upload-artifact@v3
5757
with:
5858
name: static_validation_artifact
5959
path: dist/static_validation_artifact
@@ -71,35 +71,39 @@ jobs:
7171
matrix: ${{ fromJson(needs.static-validation.outputs.dynamic_test_cases) }} # [{env_name: ..., resource_id: ..., version_id: ..., weight_format: ...}, ...]
7272

7373
steps:
74-
- uses: actions/checkout@v2
74+
- uses: actions/checkout@v3
7575
- name: download environment.yaml
76-
uses: actions/download-artifact@v2
76+
uses: actions/download-artifact@v3
7777
with:
7878
name: static_validation_artifact
7979
path: artifacts/static_validation_artifact
8080
- name: install validation dependencies
8181
id: create_env
82-
continue-on-error: true # we inspect this step's outcome in dynamic_validation.py
83-
timeout-minutes: 30
84-
uses: conda-incubator/setup-miniconda@v2
82+
uses: mamba-org/provision-with-micromamba@main
8583
with:
86-
auto-update-conda: true
87-
mamba-version: "*"
88-
channel-priority: strict
89-
activate-environment: ${{ matrix.env_name }}
84+
cache-downloads: true
85+
environment-name: ${{ matrix.env_name }}
9086
environment-file: artifacts/static_validation_artifact/${{ matrix.resource_id }}/${{ matrix.version_id }}/conda_env_${{ matrix.weight_format }}.yaml
91-
- name: install minimal script deps
92-
if: steps.create_env.outcome != 'success'
93-
run: pip install typer bioimageio.spec
87+
extra-specs: | # script dependencies
88+
typer
89+
bioimageio.spec
90+
continue-on-error: true # we inspect this step's outcome in dynamic_validation.py
91+
timeout-minutes: 60
92+
# atm bioimageio.core imports directly from tqdm, PR to import from spec is on the way...
93+
# todo: remove tqdm to avoid spamming logs
94+
# - name: remove tqdm to avoid spamming logs
95+
# shell: bash -l {0}
96+
# run: conda remove --yes --force tqdm
97+
# continue-on-error: true
9498
- name: get artifact name wo forward slashes
9599
id: artifact_name
96100
run: echo ::set-output name=name::dynamic_validation_artifact_$(echo ${{ matrix.resource_id }}_${{ matrix.version_id }}_${{ matrix.weight_format }} | sed 's#/##g')
97101
- name: dynamic validation
98102
shell: bash -l {0}
99-
timeout-minutes: 30
103+
timeout-minutes: 60
100104
run: python scripts/dynamic_validation.py dist/dynamic_validation_artifact ${{ matrix.resource_id }} ${{ matrix.version_id }} ${{ matrix.weight_format }} --create-env-outcome ${{ steps.create_env.outcome }} --${{ contains(inputs.deploy_to, 'gh-pages') && 'no-ignore' || 'ignore' }}-rdf-source-field-in-validation
101105
- name: Upload validation summary
102-
uses: actions/upload-artifact@v2
106+
uses: actions/upload-artifact@v3
103107
with:
104108
name: ${{ steps.artifact_name.outputs.name }}
105109
path: dist/dynamic_validation_artifact/${{ matrix.resource_id }}/${{ matrix.version_id }}/${{ matrix.weight_format }}
@@ -117,13 +121,13 @@ jobs:
117121
runs-on: ubuntu-latest
118122

119123
steps:
120-
- uses: actions/checkout@v2
121-
- uses: actions/checkout@v2
124+
- uses: actions/checkout@v3
125+
- uses: actions/checkout@v3
122126
with:
123127
ref: gh-pages
124128
path: gh-pages
125129
- name: download artifacts
126-
uses: actions/download-artifact@v2
130+
uses: actions/download-artifact@v3
127131
with:
128132
path: artifacts
129133
- name: install script deps
@@ -144,7 +148,7 @@ jobs:
144148
run: python scripts/download_documentation.py --folder dist/gh_pages_update
145149
- name: Upload preview
146150
if: contains(inputs.deploy_to, 'preview')
147-
uses: actions/upload-artifact@v2
151+
uses: actions/upload-artifact@v3
148152
with:
149153
name: preview
150154
path: dist/gh_pages_update

collection_rdf_template.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ config:
4343
branch: master
4444
collection_file_name: manifest.bioimage.io.yaml
4545
test_summaries:
46-
repository: deepimagej/models
46+
repository: deepimagej/CI-deepimagej-bioimage-io
4747
deploy_branch: gh-pages
48-
deploy_folder: test_summaries
48+
deploy_folder: .
4949
workflow: test_bioimageio_resources.yaml
5050
workflow_ref: refs/heads/master
5151
- id: fiji

scripts/prepare_to_deploy.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,9 @@ def main(
100100
for sp in dyn_sums:
101101
for sub_summary in get_sub_summaries(sp):
102102
test_summary["tests"]["bioimageio"].append(sub_summary)
103-
core_versions.add(Version(sub_summary["bioimageio_core_version"]))
104103
success &= sub_summary.get("status") == "passed"
104+
if "bioimageio_core_version" in sub_summary:
105+
core_versions.add(Version(sub_summary["bioimageio_core_version"]))
105106

106107
if spec_versions:
107108
test_summary["bioimageio_spec_version"] = str(max(spec_versions))

scripts/static_validation.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from bare_utils import set_gh_actions_outputs
1313
from bioimageio.spec import load_raw_resource_description, validate
1414
from bioimageio.spec.model.raw_nodes import Model, WeightsFormat
15-
from bioimageio.spec.rdf.raw_nodes import RDF
15+
from bioimageio.spec.rdf.raw_nodes import RDF_Base
1616
from bioimageio.spec.shared import yaml
1717
from bioimageio.spec.shared.raw_nodes import Dependencies, URI
1818
from utils import ADJECTIVES, ANIMALS, iterate_over_gh_matrix, split_animal_nickname
@@ -134,9 +134,7 @@ def ensure_valid_conda_env_name(name: str) -> str:
134134
return name or "empty"
135135

136136

137-
def prepare_dynamic_test_cases(
138-
rd: Union[Model, RDF], resource_id: str, version_id: str, dist: Path
139-
) -> List[Dict[str, str]]:
137+
def prepare_dynamic_test_cases(rd: RDF_Base, resource_id: str, version_id: str, dist: Path) -> List[Dict[str, str]]:
140138
validation_cases = []
141139
# construct test cases based on resource type
142140
if isinstance(rd, Model):
@@ -158,7 +156,7 @@ def prepare_dynamic_test_cases(
158156
validation_cases.append(
159157
{"env_name": env_name, "resource_id": resource_id, "version_id": version_id, "weight_format": wf}
160158
)
161-
elif isinstance(rd, RDF):
159+
elif isinstance(rd, RDF_Base):
162160
pass
163161
else:
164162
raise TypeError(rd)
@@ -211,7 +209,7 @@ def main(
211209
latest_static_summary = validate(rdf_path, update_format=True)
212210
if not latest_static_summary["error"]:
213211
rd = load_raw_resource_description(rdf_path, update_to_format="latest")
214-
assert isinstance(rd, RDF)
212+
assert isinstance(rd, RDF_Base)
215213
dynamic_test_cases += prepare_dynamic_test_cases(rd, resource_id, version_id, dist)
216214

217215
if "name" not in latest_static_summary:

0 commit comments

Comments
 (0)