From 19c7a180c5886a915f73a0c030bf10cd294b0ce7 Mon Sep 17 00:00:00 2001 From: fynnbe Date: Thu, 23 May 2024 10:47:04 +0200 Subject: [PATCH] update build.yaml --- .github/workflows/build.yaml | 35 +++---------------- .../_backoffice.py | 4 +-- 2 files changed, 7 insertions(+), 32 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index d85c6aa6..0ef7a173 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -7,21 +7,6 @@ concurrency: test env: S3_HOST: ${{vars.S3_HOST}} S3_BUCKET: ${{vars.S3_BUCKET}} -# S3_FOLDER: ${{vars.S3_TEST_FOLDER}} # testing! -# S3_PYTEST_FOLDER: ${{vars.S3_PYTEST_FOLDER}} -# ZENODO_URL: ${{vars.ZENODO_TEST_URL}} # testing! -# ZENODO_TEST_URL: ${{vars.ZENODO_TEST_URL}} -# REVIEWERS: ${{vars.REVIEWERS}} -# RUN_URL: ${{github.server_url}}/${{github.repository}}/actions/runs/${{github.run_id}} - -# S3_ACCESS_KEY_ID: ${{secrets.S3_ACCESS_KEY_ID}} -# S3_SECRET_ACCESS_KEY: ${{secrets.S3_SECRET_ACCESS_KEY}} -# ZENODO_API_ACCESS_TOKEN: ${{secrets.ZENODO_TEST_API_ACCESS_TOKEN}} # testing! -# ZENODO_TEST_API_ACCESS_TOKEN: ${{secrets.ZENODO_TEST_API_ACCESS_TOKEN}} - -# TEST_PACKAGE_ID: ${{vars.TEST_PACKAGE_ID}} -# TEST_PACKAGE_URL: ${{vars.TEST_PACKAGE_URL}} - jobs: initial-cleanup: @@ -34,10 +19,8 @@ jobs: python-version: "3.12" cache: "pip" # caching pip dependencies - run: pip install . - - run: backoffice wipe --bucket "${{vars.S3_BUCKET}}" --prefix "${{vars.S3_FOLDER}}" + - run: backoffice wipe env: - S3_HOST: ${{vars.S3_HOST}} - S3_BUCKET: ${{vars.S3_BUCKET}} S3_FOLDER: ${{vars.S3_FOLDER}} generate-initial-collection-json: @@ -54,7 +37,7 @@ jobs: concept_id: 'frank-water-buffalo' package_url: 'https://uk1s3.embassy.ebi.ac.uk/public-datasets/examples.bioimage.io/frank-water-buffalo_v1.zip' environment_name: testing - secrets: inherit + secrets: inherit test-publish: needs: test-stage @@ -69,30 +52,22 @@ jobs: needs: test-publish uses: bioimage-io/collection/.github/workflows/generate_collection_json_call.yaml@main with: - S3_HOST: ${{vars.S3_HOST}} - S3_BUCKET: ${{vars.S3_TEST_BUCKET}} # testing! - S3_FOLDER: ${{vars.S3_TEST_FOLDER}}/ci # testing! + environment_name: testing secrets: inherit - test-generate-collection-staged-json: needs: test-publish uses: bioimage-io/collection/.github/workflows/generate_collection_json_call.yaml@main with: mode: 'staged' - S3_HOST: ${{vars.S3_HOST}} - S3_BUCKET: ${{vars.S3_TEST_BUCKET}} # testing! - S3_FOLDER: ${{vars.S3_TEST_FOLDER}}/ci # testing! + environment_name: testing secrets: inherit test-backup: needs: test-generate-collection-json uses: bioimage-io/collection/.github/workflows/backup_call.yaml@main with: - S3_HOST: ${{vars.S3_HOST}} - S3_BUCKET: ${{vars.S3_TEST_BUCKET}} # testing! - S3_FOLDER: ${{vars.S3_TEST_FOLDER}}/ci # testing! - ZENODO_URL: ${{vars.ZENODO_TEST_URL}} # testing! + environment_name: testing secrets: inherit build: diff --git a/bioimageio_collection_backoffice/_backoffice.py b/bioimageio_collection_backoffice/_backoffice.py index f9eb2817..aca997f1 100644 --- a/bioimageio_collection_backoffice/_backoffice.py +++ b/bioimageio_collection_backoffice/_backoffice.py @@ -63,8 +63,8 @@ def wipe(self, subfolder: str = ""): """DANGER ZONE: wipes `subfolder` completely, only use for test folders!""" url = self.client.get_file_url(subfolder) key_parts = ("sandbox", "testing") - if not all(p in url for p in key_parts): - raise RuntimeError(f"Refusing to wipe {url} (missing {key_parts})") + if not any(p in url for p in key_parts): + raise RuntimeError(f"Refusing to wipe {url} (missing any of {key_parts})") self.client.rm_dir(subfolder)