-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #112 from RIVM-bioinformatics/dev
Containerization of workflow
- Loading branch information
Showing
40 changed files
with
1,622 additions
and
255 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
name: build containers and run tests | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- 'main' | ||
workflow_dispatch: | ||
|
||
|
||
jobs: | ||
Setup_and_build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup Mamba | ||
uses: mamba-org/setup-micromamba@v1 | ||
with: | ||
cache-environment: true | ||
post-cleanup: 'all' | ||
environment-file: env.yml | ||
init-shell: bash | ||
|
||
- name: Install local python package | ||
run: | | ||
pip install . --no-deps | ||
shell: micromamba-shell {0} | ||
|
||
- name: build containers | ||
run: | | ||
python containers/build_containers.py | ||
env: | ||
TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
shell: micromamba-shell {0} | ||
|
||
- name: zip built containers | ||
run: | | ||
cd ./containers/ | ||
tar -czvf containers.tar.gz builtcontainers.json $(find . -type f -name "*.tar" -printf '%f ') | ||
- name: Upload container artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: built_containers | ||
path: ./containers/containers.tar.gz | ||
overwrite: true | ||
|
||
Test: | ||
runs-on: ubuntu-latest | ||
needs: Setup_and_build | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: built_containers | ||
|
||
- name: move artifact | ||
run: | | ||
mv ./containers.tar.gz ./containers/containers.tar.gz | ||
- name: unzip built containers | ||
run: | | ||
cd ./containers/ | ||
tar -xzvf containers.tar.gz | ||
cd .. | ||
- name: Setup Apptainer | ||
uses: eWaterCycle/setup-apptainer@v2 | ||
|
||
- name: Setup Mamba | ||
uses: mamba-org/setup-micromamba@v1 | ||
with: | ||
cache-environment: true | ||
post-cleanup: 'all' | ||
environment-file: env.yml | ||
init-shell: bash | ||
|
||
- name: Install local python package | ||
run: | | ||
pip install . --no-deps | ||
shell: micromamba-shell {0} | ||
|
||
- name: convert containers | ||
run: | | ||
python containers/convert_artifact_containers_for_apptainer.py | ||
- name: download existing containers | ||
run: | | ||
python containers/pull_published_containers.py | ||
shell: micromamba-shell {0} | ||
|
||
## rest of the testing suite here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
name: Publish containers | ||
|
||
on: | ||
release: | ||
types: | ||
- published | ||
workflow_dispatch: | ||
|
||
|
||
jobs: | ||
Upload: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Download artifact | ||
id: download-artifact | ||
uses: dawidd6/action-download-artifact@v8 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
workflow: build_and_test.yml | ||
name: built_containers | ||
skip_unpack: false | ||
|
||
- name: move artifact | ||
run: | | ||
mv ./containers.tar.gz ./containers/containers.tar.gz | ||
- name: unzip built containers | ||
run: | | ||
cd ./containers/ | ||
tar -xzvf containers.tar.gz | ||
cd .. | ||
- name: Setup Mamba | ||
uses: mamba-org/setup-micromamba@v1 | ||
with: | ||
cache-environment: true | ||
post-cleanup: 'all' | ||
environment-file: env.yml | ||
init-shell: bash | ||
|
||
- name: Install local python package | ||
run: | | ||
pip install . --no-deps | ||
shell: micromamba-shell {0} | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Add artifacted containers to docker daemon | ||
run: | | ||
python containers/add_OCI_to_docker_engine.py | ||
shell: micromamba-shell {0} | ||
|
||
- name: tag and push containers | ||
run: | | ||
python containers/tag_and_push_containers.py | ||
shell: micromamba-shell {0} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.