From 2d216f7784fb3b87d312be143cdaba51399ca46a Mon Sep 17 00:00:00 2001 From: Stefan Janssen Date: Thu, 11 Sep 2025 16:28:31 +0200 Subject: [PATCH 01/22] test 1 --- .github/workflows/buildContainer.yaml | 158 +++++++++++++++++--------- 1 file changed, 106 insertions(+), 52 deletions(-) diff --git a/.github/workflows/buildContainer.yaml b/.github/workflows/buildContainer.yaml index 6112c90..f047057 100644 --- a/.github/workflows/buildContainer.yaml +++ b/.github/workflows/buildContainer.yaml @@ -3,85 +3,139 @@ name: docker on: push: branches: - - 'smaller_deblur' + - 'restructure_github_actions' jobs: - docker: + build_main: strategy: matrix: - plugin: ["qp-deblur", "qtp-biom", "qtp-sequencing", "qtp-visualization", "qtp-diversity", "qp-target-gene", "qtp-job-output-folder", - "nginx", "qiita", "plugin_collector" - ] + container: ["nginx", "qiita", "plugin_collector"] runs-on: ubuntu-latest steps: - - name: Checkout repository + - name: Checkout tinqiita repo uses: actions/checkout@v4 - - name: Login to DockerHub - uses: docker/login-action@v3 - with: - registry: harbor.computational.bio.uni-giessen.de - username: ${{ vars.HARBOR_CB_USERNAME }} - password: ${{ secrets.HARBOR_CB_SECRET }} - - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - name: Read version from file + - name: Read image version from dockerfile id: vars run: | - VERSION=$(head -n 1 Images/${{ matrix.plugin }}/${{ matrix.plugin }}.dockerfile | cut -d ":" -f 2- | tr -d " ") + VERSION=$(head -n 1 Images/${{ matrix.container }}/${{ matrix.container }}.dockerfile | cut -d ":" -f 2- | tr -d " ") echo "IMAGE_TAG=$VERSION" >> $GITHUB_ENV - cp Images/${{ matrix.plugin }}/start_${{ matrix.plugin }}.sh Images/test_plugin.sh Images/trigger_noconda.py Images/trigger.py Images/nginx/nginx_qiita.conf Images/${{ matrix.plugin }}/requirements.txt . + cp Images/${{ matrix.container }}/start_${{ matrix.container }}.sh Images/test_plugin.sh Images/nginx/nginx_qiita.conf Images/${{ matrix.container }}/requirements.txt . cp Images/qiita/config_portal.cfg Images/qiita/config_qiita_oidc.cfg Images/qiita/drop_workflows.py Images/qiita/start_plugin.py Images/qiita/start_qiita-initDB.sh Images/qiita/start_qiita.sh . cp Images/plugin_collector/collect_configs.py Images/plugin_collector/fix_test_db.py Images/plugin_collector/stefan_cert.conf Images/plugin_collector/stefan_csr.conf . - - name: Make tinqiita targets + - name: Create certificate and fake reference databases # second copy of "qiita_server_certificates" is necessary to match path for docker build, first copy for mounting into container run: | - make ./references/qiita_server_certificates ./references/qp-deblur/reference-gg-raxml-bl.tre ./references/qp-target-gene ./environments/qiita_db.env ./environments/qiita.env config + make ./references/qiita_server_certificates ./environments/qiita_db.env ./environments/qiita.env config + mkdir -p ./references/qp-deblur/ ./references/qp-target-gene + for f in `echo "./references/qp-deblur/reference-gg-raxml-bl.tre references/qp-target-gene/97_otus.fasta references/qp-target-gene/97_otus.tree references/qp-target-gene/97_otu_taxonomy.txt"`; do echo "fake" > $f; done cp -r ./references/qiita_server_certificates ./qiita_server_certificates - - name: Build Image (but do not push yet) + - name: Log in to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build main qiita Images and push to github's own registry uses: docker/build-push-action@v6 with: context: . push: false load: true - file: Images/${{ matrix.plugin }}/${{ matrix.plugin }}.dockerfile - tags: tinqiita/${{ matrix.plugin }}:testcandidate + file: Images/${{ matrix.container }}/${{ matrix.container }}.dockerfile + tags: ghcr.io/${{ github.repository }}/${{ matrix.container }}:testcandidate + +# build_plugins: +# needs: build_main +# strategy: +# matrix: +# container: ["qp-deblur", "qtp-biom", "qtp-sequencing", "qtp-visualization", "qtp-diversity", "qp-target-gene", "qtp-job-output-folder"] +# runs-on: ubuntu-latest +# steps: - - name: debug docker - run: | - docker image ls -a - docker ps -a +# jobs: +# docker: +# strategy: +# matrix: +# plugin: ["qp-deblur", "qtp-biom", "qtp-sequencing", "qtp-visualization", "qtp-diversity", "qp-target-gene", "qtp-job-output-folder", +# "nginx", "qiita", "plugin_collector" +# ] +# runs-on: ubuntu-latest +# steps: +# - name: Checkout repository +# uses: actions/checkout@v4 - - name: adapt compose file to select specific plugin - run: | - sed -i "s/MATRIXPLUGIN/${{ matrix.plugin }}/g" compose_github.yaml - sed -i "s|image: janssenlab/${{ matrix.plugin }}:latest|image: tinqiita/${{ matrix.plugin }}:testcandidate|" compose_github.yaml +# - name: Login to DockerHub +# uses: docker/login-action@v3 +# with: +# registry: harbor.computational.bio.uni-giessen.de +# username: ${{ vars.HARBOR_CB_USERNAME }} +# password: ${{ secrets.HARBOR_CB_SECRET }} - - name: Run docker compose - if: ${{ !contains('nginx,qiita,plugin_collector', matrix.plugin) }} - uses: hoverkraft-tech/compose-action@v2.0.1 - with: - compose-file: "compose_github.yaml" - services: | - nginx - - name: Execute tests in the running services (wait till qiita plugins are registered) - if: ${{ !contains('nginx,qiita,plugin_collector', matrix.plugin) }} - run: | - sleep 5 - docker compose exec qiita /bin/bash -c "cat /logs/*; cat /qiita_plugins/*" - docker compose exec ${{ matrix.plugin }} /bin/bash -c "PLUGIN=${{ matrix.plugin }} bash /test_plugin.sh" +# - name: Set up Docker Buildx +# uses: docker/setup-buildx-action@v3 - - name: Push production image (only if tests passed) - if: success() - uses: docker/build-push-action@v6 - with: - context: . - push: true - file: Images/${{ matrix.plugin }}/${{ matrix.plugin }}.dockerfile - tags: | - harbor.computational.bio.uni-giessen.de/tinqiita/${{ matrix.plugin }}:${{ env.IMAGE_TAG }} - harbor.computational.bio.uni-giessen.de/tinqiita/${{ matrix.plugin }}:latest +# - name: Read version from file +# id: vars +# run: | +# VERSION=$(head -n 1 Images/${{ matrix.plugin }}/${{ matrix.plugin }}.dockerfile | cut -d ":" -f 2- | tr -d " ") +# echo "IMAGE_TAG=$VERSION" >> $GITHUB_ENV +# cp Images/${{ matrix.plugin }}/start_${{ matrix.plugin }}.sh Images/test_plugin.sh Images/trigger_noconda.py Images/trigger.py Images/nginx/nginx_qiita.conf Images/${{ matrix.plugin }}/requirements.txt . +# cp Images/qiita/config_portal.cfg Images/qiita/config_qiita_oidc.cfg Images/qiita/drop_workflows.py Images/qiita/start_plugin.py Images/qiita/start_qiita-initDB.sh Images/qiita/start_qiita.sh . +# cp Images/plugin_collector/collect_configs.py Images/plugin_collector/fix_test_db.py Images/plugin_collector/stefan_cert.conf Images/plugin_collector/stefan_csr.conf . + +# - name: Make tinqiita targets +# # second copy of "qiita_server_certificates" is necessary to match path for docker build, first copy for mounting into container +# run: | +# make ./references/qiita_server_certificates ./references/qp-deblur/reference-gg-raxml-bl.tre ./references/qp-target-gene ./environments/qiita_db.env ./environments/qiita.env config +# cp -r ./references/qiita_server_certificates ./qiita_server_certificates + +# - name: Build Image (but do not push yet) +# uses: docker/build-push-action@v6 +# with: +# context: . +# push: false +# load: true +# file: Images/${{ matrix.plugin }}/${{ matrix.plugin }}.dockerfile +# tags: tinqiita/${{ matrix.plugin }}:testcandidate + +# - name: debug docker +# run: | +# docker image ls -a +# docker ps -a + +# - name: adapt compose file to select specific plugin +# run: | +# sed -i "s/MATRIXPLUGIN/${{ matrix.plugin }}/g" compose_github.yaml +# sed -i "s|image: janssenlab/${{ matrix.plugin }}:latest|image: tinqiita/${{ matrix.plugin }}:testcandidate|" compose_github.yaml + +# - name: Run docker compose +# if: ${{ !contains('nginx,qiita,plugin_collector', matrix.plugin) }} +# uses: hoverkraft-tech/compose-action@v2.0.1 +# with: +# compose-file: "compose_github.yaml" +# services: | +# nginx +# - name: Execute tests in the running services (wait till qiita plugins are registered) +# if: ${{ !contains('nginx,qiita,plugin_collector', matrix.plugin) }} +# run: | +# sleep 5 +# docker compose exec qiita /bin/bash -c "cat /logs/*; cat /qiita_plugins/*" +# docker compose exec ${{ matrix.plugin }} /bin/bash -c "PLUGIN=${{ matrix.plugin }} bash /test_plugin.sh" + +# - name: Push production image (only if tests passed) +# if: success() +# uses: docker/build-push-action@v6 +# with: +# context: . +# push: true +# file: Images/${{ matrix.plugin }}/${{ matrix.plugin }}.dockerfile +# tags: | +# harbor.computational.bio.uni-giessen.de/tinqiita/${{ matrix.plugin }}:${{ env.IMAGE_TAG }} +# harbor.computational.bio.uni-giessen.de/tinqiita/${{ matrix.plugin }}:latest From 6d94ac72b46619634a396584bc0c53800d3979fa Mon Sep 17 00:00:00 2001 From: Stefan Janssen Date: Thu, 11 Sep 2025 16:52:59 +0200 Subject: [PATCH 02/22] two phases --- .github/workflows/buildContainer.yaml | 63 ++++++++++++++++++++++----- compose_github.yaml | 10 ++--- 2 files changed, 57 insertions(+), 16 deletions(-) diff --git a/.github/workflows/buildContainer.yaml b/.github/workflows/buildContainer.yaml index f047057..04b6f44 100644 --- a/.github/workflows/buildContainer.yaml +++ b/.github/workflows/buildContainer.yaml @@ -27,12 +27,10 @@ jobs: cp Images/qiita/config_portal.cfg Images/qiita/config_qiita_oidc.cfg Images/qiita/drop_workflows.py Images/qiita/start_plugin.py Images/qiita/start_qiita-initDB.sh Images/qiita/start_qiita.sh . cp Images/plugin_collector/collect_configs.py Images/plugin_collector/fix_test_db.py Images/plugin_collector/stefan_cert.conf Images/plugin_collector/stefan_csr.conf . - - name: Create certificate and fake reference databases + - name: Create certificate # second copy of "qiita_server_certificates" is necessary to match path for docker build, first copy for mounting into container run: | make ./references/qiita_server_certificates ./environments/qiita_db.env ./environments/qiita.env config - mkdir -p ./references/qp-deblur/ ./references/qp-target-gene - for f in `echo "./references/qp-deblur/reference-gg-raxml-bl.tre references/qp-target-gene/97_otus.fasta references/qp-target-gene/97_otus.tree references/qp-target-gene/97_otu_taxonomy.txt"`; do echo "fake" > $f; done cp -r ./references/qiita_server_certificates ./qiita_server_certificates - name: Log in to GitHub Container Registry @@ -42,7 +40,7 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Build main qiita Images and push to github's own registry + - name: Build main qiita images and push to github's own registry uses: docker/build-push-action@v6 with: context: . @@ -51,13 +49,56 @@ jobs: file: Images/${{ matrix.container }}/${{ matrix.container }}.dockerfile tags: ghcr.io/${{ github.repository }}/${{ matrix.container }}:testcandidate -# build_plugins: -# needs: build_main -# strategy: -# matrix: -# container: ["qp-deblur", "qtp-biom", "qtp-sequencing", "qtp-visualization", "qtp-diversity", "qp-target-gene", "qtp-job-output-folder"] -# runs-on: ubuntu-latest -# steps: + build_plugins: + needs: build_main + strategy: + matrix: + plugin: ["qp-deblur", "qtp-biom", "qtp-sequencing", "qtp-visualization", "qtp-diversity", "qp-target-gene", "qtp-job-output-folder"] + runs-on: ubuntu-latest + steps: + - name: Checkout tinqiita repo + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Read image version from dockerfile + id: vars + run: | + VERSION=$(head -n 1 Images/${{ matrix.plugin }}/${{ matrix.plugin }}.dockerfile | cut -d ":" -f 2- | tr -d " ") + echo "IMAGE_TAG=$VERSION" >> $GITHUB_ENV + cp Images/${{ matrix.plugin }}/start_${{ matrix.plugin }}.sh Images/test_plugin.sh Images/${{ matrix.plugin }}/requirements.txt . + + - name: Create fake reference databases + run: | + mkdir -p ./references/qp-deblur/ ./references/qp-target-gene + for f in `echo "./references/qp-deblur/reference-gg-raxml-bl.tre references/qp-target-gene/97_otus.fasta references/qp-target-gene/97_otus.tree references/qp-target-gene/97_otu_taxonomy.txt"`; do echo "fake" > $f; done + + - name: Build plugin images + uses: docker/build-push-action@v6 + with: + context: . + push: false + load: true + file: Images/${{ matrix.plugin }}/${{ matrix.plugin }}.dockerfile + + - name: adapt compose file to select specific plugin + run: | + sed -i "s/MATRIXPLUGIN/${{ matrix.plugin }}/g" compose_github.yaml + + - name: Run docker compose + uses: hoverkraft-tech/compose-action@v2.0.1 + with: + compose-file: "compose_github.yaml" + services: | + nginx + + - name: Execute tests in the running services + run: | + sleep 5 + docker compose exec ${{ matrix.plugin }} /bin/bash -c "bash /test_plugin.sh" + + # jobs: # docker: diff --git a/compose_github.yaml b/compose_github.yaml index ddb6791..0767e7b 100644 --- a/compose_github.yaml +++ b/compose_github.yaml @@ -27,7 +27,7 @@ services: # start_period: 20s qiita-initialize-db: - image: harbor.computational.bio.uni-giessen.de/tinqiita/qiita:latest + image: ghcr.io/qiita-keycloak/qiita:testcandidate command: ['/start_qiita-initDB.sh'] depends_on: - qiita-db @@ -46,7 +46,7 @@ services: - qiita-net qiita: - image: harbor.computational.bio.uni-giessen.de/tinqiita/qiita:latest + image: ghcr.io/qiita-keycloak/qiita:testcandidate build: # image wird hier direkt gebaut context: ./Images/qiita dockerfile: Dockerfile @@ -82,7 +82,7 @@ services: - "21174:21174" qiita-worker: - image: harbor.computational.bio.uni-giessen.de/tinqiita/qiita:latest + image: ghcr.io/qiita-keycloak/qiita:testcandidate build: # image wird hier direkt gebaut context: ./Images/qiita dockerfile: Dockerfile @@ -142,7 +142,7 @@ services: # start_period: 20s nginx: - image: harbor.computational.bio.uni-giessen.de/tinqiita/nginx:latest + image: ghcr.io/qiita-keycloak/nginx:testcandidate build: context: ./Images/nginx dockerfile: Dockerfile @@ -306,7 +306,7 @@ services: plugin-collector: # prior to qiita (master and worker) start up, iterates through the QIITA_PLUGINS : separated list of plugin containers # to compile all q*.conf files from plugin containers in the server-plugin-configs volume - image: harbor.computational.bio.uni-giessen.de/tinqiita/plugin_collector:latest + image: ghcr.io/qiita-keycloak/plugin_collector:testcandidate restart: no networks: - qiita-net From 6a6d81409ca38fa3515f62f3d08ff344bafe35ff Mon Sep 17 00:00:00 2001 From: Stefan Janssen Date: Thu, 11 Sep 2025 17:03:20 +0200 Subject: [PATCH 03/22] up/download certificates between jobs --- .github/workflows/buildContainer.yaml | 25 ++++++++++++++++++- .../plugin_collector.dockerfile | 2 +- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/.github/workflows/buildContainer.yaml b/.github/workflows/buildContainer.yaml index 04b6f44..9720957 100644 --- a/.github/workflows/buildContainer.yaml +++ b/.github/workflows/buildContainer.yaml @@ -33,6 +33,12 @@ jobs: make ./references/qiita_server_certificates ./environments/qiita_db.env ./environments/qiita.env config cp -r ./references/qiita_server_certificates ./qiita_server_certificates + - name: Store certifactes for follow up jobs + uses: actions/upload-artifact@v4 + with: + name: certificates + path: ./references/qiita_server_certificates ./qiita_server_certificates + - name: Log in to GitHub Container Registry uses: docker/login-action@v3 with: @@ -44,10 +50,11 @@ jobs: uses: docker/build-push-action@v6 with: context: . - push: false load: true file: Images/${{ matrix.container }}/${{ matrix.container }}.dockerfile tags: ghcr.io/${{ github.repository }}/${{ matrix.container }}:testcandidate + cache-from: type=gha,scope=tinqiita-${{ github.ref_name }} + cache-to: type=gha,scope=tinqiita-${{ github.ref_name }},mode=max build_plugins: needs: build_main @@ -69,6 +76,11 @@ jobs: echo "IMAGE_TAG=$VERSION" >> $GITHUB_ENV cp Images/${{ matrix.plugin }}/start_${{ matrix.plugin }}.sh Images/test_plugin.sh Images/${{ matrix.plugin }}/requirements.txt . + - name: Download certificates from job build_main + uses: actions/download-artifact@v4 + with: + name: certificates + - name: Create fake reference databases run: | mkdir -p ./references/qp-deblur/ ./references/qp-target-gene @@ -98,6 +110,17 @@ jobs: sleep 5 docker compose exec ${{ matrix.plugin }} /bin/bash -c "bash /test_plugin.sh" + - name: Push production image (only if tests passed) + if: success() + uses: docker/build-push-action@v6 + with: + context: . + push: true + file: Images/${{ matrix.plugin }}/${{ matrix.plugin }}.dockerfile + tags: | + tags: ghcr.io/${{ github.repository }}/${{ matrix.plugin }}:testcandidate + cache-from: type=gha,scope=tinqiita-${{ github.ref_name }} + cache-to: type=gha,scope=tinqiita-${{ github.ref_name }},mode=max # jobs: diff --git a/Images/plugin_collector/plugin_collector.dockerfile b/Images/plugin_collector/plugin_collector.dockerfile index 799da21..452c5b0 100644 --- a/Images/plugin_collector/plugin_collector.dockerfile +++ b/Images/plugin_collector/plugin_collector.dockerfile @@ -14,4 +14,4 @@ COPY fix_test_db.py /fix_test_db.py COPY start_plugin_collector.sh /start_plugin_collector.sh RUN chmod u+x /start_plugin_collector.sh -CMD /start_plugin_collector.sh \ No newline at end of file +CMD ["/start_plugin_collector.sh"] From 161c30644b1838b603a2f6a80039b98bdba609ea Mon Sep 17 00:00:00 2001 From: Stefan Janssen Date: Thu, 11 Sep 2025 17:04:46 +0200 Subject: [PATCH 04/22] login to ghcr --- .github/workflows/buildContainer.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/buildContainer.yaml b/.github/workflows/buildContainer.yaml index 9720957..e29aa12 100644 --- a/.github/workflows/buildContainer.yaml +++ b/.github/workflows/buildContainer.yaml @@ -86,6 +86,13 @@ jobs: mkdir -p ./references/qp-deblur/ ./references/qp-target-gene for f in `echo "./references/qp-deblur/reference-gg-raxml-bl.tre references/qp-target-gene/97_otus.fasta references/qp-target-gene/97_otus.tree references/qp-target-gene/97_otu_taxonomy.txt"`; do echo "fake" > $f; done + - name: Log in to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build plugin images uses: docker/build-push-action@v6 with: From d87b55e57d2a6e8b6851bab04227bc6fde11e107 Mon Sep 17 00:00:00 2001 From: Stefan Janssen Date: Thu, 11 Sep 2025 17:09:45 +0200 Subject: [PATCH 05/22] adding phase3: publish images --- .github/workflows/buildContainer.yaml | 112 ++++++++------------------ 1 file changed, 32 insertions(+), 80 deletions(-) diff --git a/.github/workflows/buildContainer.yaml b/.github/workflows/buildContainer.yaml index e29aa12..68f202d 100644 --- a/.github/workflows/buildContainer.yaml +++ b/.github/workflows/buildContainer.yaml @@ -129,84 +129,36 @@ jobs: cache-from: type=gha,scope=tinqiita-${{ github.ref_name }} cache-to: type=gha,scope=tinqiita-${{ github.ref_name }},mode=max + publish_images: + needs: build_plugins + strategy: + matrix: + images: ["qp-deblur", "qtp-biom", "qtp-sequencing", "qtp-visualization", "qtp-diversity", "qp-target-gene", "qtp-job-output-folder", + "nginx", "qiita", "plugin_collector"] + runs-on: ubuntu-latest + steps: + - name: Checkout tinqiita repo + uses: actions/checkout@v4 -# jobs: -# docker: -# strategy: -# matrix: -# plugin: ["qp-deblur", "qtp-biom", "qtp-sequencing", "qtp-visualization", "qtp-diversity", "qp-target-gene", "qtp-job-output-folder", -# "nginx", "qiita", "plugin_collector" -# ] -# runs-on: ubuntu-latest -# steps: -# - name: Checkout repository -# uses: actions/checkout@v4 - -# - name: Login to DockerHub -# uses: docker/login-action@v3 -# with: -# registry: harbor.computational.bio.uni-giessen.de -# username: ${{ vars.HARBOR_CB_USERNAME }} -# password: ${{ secrets.HARBOR_CB_SECRET }} - -# - name: Set up Docker Buildx -# uses: docker/setup-buildx-action@v3 - -# - name: Read version from file -# id: vars -# run: | -# VERSION=$(head -n 1 Images/${{ matrix.plugin }}/${{ matrix.plugin }}.dockerfile | cut -d ":" -f 2- | tr -d " ") -# echo "IMAGE_TAG=$VERSION" >> $GITHUB_ENV -# cp Images/${{ matrix.plugin }}/start_${{ matrix.plugin }}.sh Images/test_plugin.sh Images/trigger_noconda.py Images/trigger.py Images/nginx/nginx_qiita.conf Images/${{ matrix.plugin }}/requirements.txt . -# cp Images/qiita/config_portal.cfg Images/qiita/config_qiita_oidc.cfg Images/qiita/drop_workflows.py Images/qiita/start_plugin.py Images/qiita/start_qiita-initDB.sh Images/qiita/start_qiita.sh . -# cp Images/plugin_collector/collect_configs.py Images/plugin_collector/fix_test_db.py Images/plugin_collector/stefan_cert.conf Images/plugin_collector/stefan_csr.conf . - -# - name: Make tinqiita targets -# # second copy of "qiita_server_certificates" is necessary to match path for docker build, first copy for mounting into container -# run: | -# make ./references/qiita_server_certificates ./references/qp-deblur/reference-gg-raxml-bl.tre ./references/qp-target-gene ./environments/qiita_db.env ./environments/qiita.env config -# cp -r ./references/qiita_server_certificates ./qiita_server_certificates - -# - name: Build Image (but do not push yet) -# uses: docker/build-push-action@v6 -# with: -# context: . -# push: false -# load: true -# file: Images/${{ matrix.plugin }}/${{ matrix.plugin }}.dockerfile -# tags: tinqiita/${{ matrix.plugin }}:testcandidate - -# - name: debug docker -# run: | -# docker image ls -a -# docker ps -a - -# - name: adapt compose file to select specific plugin -# run: | -# sed -i "s/MATRIXPLUGIN/${{ matrix.plugin }}/g" compose_github.yaml -# sed -i "s|image: janssenlab/${{ matrix.plugin }}:latest|image: tinqiita/${{ matrix.plugin }}:testcandidate|" compose_github.yaml - -# - name: Run docker compose -# if: ${{ !contains('nginx,qiita,plugin_collector', matrix.plugin) }} -# uses: hoverkraft-tech/compose-action@v2.0.1 -# with: -# compose-file: "compose_github.yaml" -# services: | -# nginx -# - name: Execute tests in the running services (wait till qiita plugins are registered) -# if: ${{ !contains('nginx,qiita,plugin_collector', matrix.plugin) }} -# run: | -# sleep 5 -# docker compose exec qiita /bin/bash -c "cat /logs/*; cat /qiita_plugins/*" -# docker compose exec ${{ matrix.plugin }} /bin/bash -c "PLUGIN=${{ matrix.plugin }} bash /test_plugin.sh" - -# - name: Push production image (only if tests passed) -# if: success() -# uses: docker/build-push-action@v6 -# with: -# context: . -# push: true -# file: Images/${{ matrix.plugin }}/${{ matrix.plugin }}.dockerfile -# tags: | -# harbor.computational.bio.uni-giessen.de/tinqiita/${{ matrix.plugin }}:${{ env.IMAGE_TAG }} -# harbor.computational.bio.uni-giessen.de/tinqiita/${{ matrix.plugin }}:latest + - name: Login to computational.bio registry + uses: docker/login-action@v3 + with: + registry: harbor.computational.bio.uni-giessen.de + username: ${{ vars.HARBOR_CB_USERNAME }} + password: ${{ secrets.HARBOR_CB_SECRET }} + + - name: Read image version from dockerfile + id: vars + run: | + VERSION=$(head -n 1 Images/${{ matrix.images }}/${{ matrix.images }}.dockerfile | cut -d ":" -f 2- | tr -d " ") + echo "IMAGE_TAG=$VERSION" >> $GITHUB_ENV + + - name: Push production image + uses: docker/build-push-action@v6 + with: + context: . + push: true + file: Images/${{ matrix.images }}/${{ matrix.images }}.dockerfile + tags: | + harbor.computational.bio.uni-giessen.de/tinqiita/${{ matrix.images }}:${{ env.IMAGE_TAG }} + harbor.computational.bio.uni-giessen.de/tinqiita/${{ matrix.images }}:latest From 504220c6caa8f89936701bf32e95f97f9fc2b119 Mon Sep 17 00:00:00 2001 From: Stefan Janssen Date: Thu, 11 Sep 2025 17:15:20 +0200 Subject: [PATCH 06/22] transfer single dir --- .github/workflows/buildContainer.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/buildContainer.yaml b/.github/workflows/buildContainer.yaml index 68f202d..d0b4d36 100644 --- a/.github/workflows/buildContainer.yaml +++ b/.github/workflows/buildContainer.yaml @@ -37,7 +37,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: certificates - path: ./references/qiita_server_certificates ./qiita_server_certificates + path: ./qiita_server_certificates - name: Log in to GitHub Container Registry uses: docker/login-action@v3 @@ -80,9 +80,11 @@ jobs: uses: actions/download-artifact@v4 with: name: certificates + path: ./qiita_server_certificates - name: Create fake reference databases run: | + cp -r ./references/qiita_server_certificates ./qiita_server_certificates mkdir -p ./references/qp-deblur/ ./references/qp-target-gene for f in `echo "./references/qp-deblur/reference-gg-raxml-bl.tre references/qp-target-gene/97_otus.fasta references/qp-target-gene/97_otus.tree references/qp-target-gene/97_otu_taxonomy.txt"`; do echo "fake" > $f; done From 8b3992c08f87761888a294751e4cad085f516af3 Mon Sep 17 00:00:00 2001 From: Stefan Janssen Date: Thu, 11 Sep 2025 17:17:55 +0200 Subject: [PATCH 07/22] only store artefact in one of matrix jobs --- .github/workflows/buildContainer.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/buildContainer.yaml b/.github/workflows/buildContainer.yaml index d0b4d36..2353425 100644 --- a/.github/workflows/buildContainer.yaml +++ b/.github/workflows/buildContainer.yaml @@ -34,6 +34,7 @@ jobs: cp -r ./references/qiita_server_certificates ./qiita_server_certificates - name: Store certifactes for follow up jobs + if: ${{ matrix.container == 'nginx' }} uses: actions/upload-artifact@v4 with: name: certificates From 57d73ea7fb0bfc42e83fa6f5f0acb0bb2729cd9b Mon Sep 17 00:00:00 2001 From: Stefan Janssen Date: Thu, 11 Sep 2025 20:34:40 +0200 Subject: [PATCH 08/22] just certificates --- .github/workflows/buildContainer.yaml | 297 +++++++++++++------------- 1 file changed, 154 insertions(+), 143 deletions(-) diff --git a/.github/workflows/buildContainer.yaml b/.github/workflows/buildContainer.yaml index 2353425..bbd3565 100644 --- a/.github/workflows/buildContainer.yaml +++ b/.github/workflows/buildContainer.yaml @@ -1,3 +1,5 @@ +# todo: "make" files once and push around through artifacts! + name: docker on: @@ -6,27 +8,12 @@ on: - 'restructure_github_actions' jobs: - build_main: - strategy: - matrix: - container: ["nginx", "qiita", "plugin_collector"] + make_certificates: runs-on: ubuntu-latest steps: - name: Checkout tinqiita repo uses: actions/checkout@v4 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Read image version from dockerfile - id: vars - run: | - VERSION=$(head -n 1 Images/${{ matrix.container }}/${{ matrix.container }}.dockerfile | cut -d ":" -f 2- | tr -d " ") - echo "IMAGE_TAG=$VERSION" >> $GITHUB_ENV - cp Images/${{ matrix.container }}/start_${{ matrix.container }}.sh Images/test_plugin.sh Images/nginx/nginx_qiita.conf Images/${{ matrix.container }}/requirements.txt . - cp Images/qiita/config_portal.cfg Images/qiita/config_qiita_oidc.cfg Images/qiita/drop_workflows.py Images/qiita/start_plugin.py Images/qiita/start_qiita-initDB.sh Images/qiita/start_qiita.sh . - cp Images/plugin_collector/collect_configs.py Images/plugin_collector/fix_test_db.py Images/plugin_collector/stefan_cert.conf Images/plugin_collector/stefan_csr.conf . - - name: Create certificate # second copy of "qiita_server_certificates" is necessary to match path for docker build, first copy for mounting into container run: | @@ -34,134 +21,158 @@ jobs: cp -r ./references/qiita_server_certificates ./qiita_server_certificates - name: Store certifactes for follow up jobs - if: ${{ matrix.container == 'nginx' }} uses: actions/upload-artifact@v4 with: name: certificates - path: ./qiita_server_certificates - - - name: Log in to GitHub Container Registry - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build main qiita images and push to github's own registry - uses: docker/build-push-action@v6 - with: - context: . - load: true - file: Images/${{ matrix.container }}/${{ matrix.container }}.dockerfile - tags: ghcr.io/${{ github.repository }}/${{ matrix.container }}:testcandidate - cache-from: type=gha,scope=tinqiita-${{ github.ref_name }} - cache-to: type=gha,scope=tinqiita-${{ github.ref_name }},mode=max + path: | + ./qiita_server_certificates + ./references/qiita_server_certificates + + # build_main: + # needs: make_certificates + # strategy: + # matrix: + # container: ["nginx", "qiita", "plugin_collector"] + # runs-on: ubuntu-latest + # steps: + # - name: Checkout tinqiita repo + # uses: actions/checkout@v4 + + # - name: Set up Docker Buildx + # uses: docker/setup-buildx-action@v3 + + # - name: Read image version from dockerfile + # id: vars + # run: | + # VERSION=$(head -n 1 Images/${{ matrix.container }}/${{ matrix.container }}.dockerfile | cut -d ":" -f 2- | tr -d " ") + # echo "IMAGE_TAG=$VERSION" >> $GITHUB_ENV + # cp Images/${{ matrix.container }}/start_${{ matrix.container }}.sh Images/test_plugin.sh Images/nginx/nginx_qiita.conf Images/${{ matrix.container }}/requirements.txt . + # cp Images/qiita/config_portal.cfg Images/qiita/config_qiita_oidc.cfg Images/qiita/drop_workflows.py Images/qiita/start_plugin.py Images/qiita/start_qiita-initDB.sh Images/qiita/start_qiita.sh . + # cp Images/plugin_collector/collect_configs.py Images/plugin_collector/fix_test_db.py Images/plugin_collector/stefan_cert.conf Images/plugin_collector/stefan_csr.conf . + + + # - name: Log in to GitHub Container Registry + # uses: docker/login-action@v3 + # with: + # registry: ghcr.io + # username: ${{ github.actor }} + # password: ${{ secrets.GITHUB_TOKEN }} + + # - name: Build main qiita images and push to github's own registry + # uses: docker/build-push-action@v6 + # with: + # context: . + # load: true + # file: Images/${{ matrix.container }}/${{ matrix.container }}.dockerfile + # tags: ghcr.io/${{ github.repository }}/${{ matrix.container }}:testcandidate + # cache-from: type=gha,scope=tinqiita-${{ github.ref_name }} + # cache-to: type=gha,scope=tinqiita-${{ github.ref_name }},mode=max - build_plugins: - needs: build_main - strategy: - matrix: - plugin: ["qp-deblur", "qtp-biom", "qtp-sequencing", "qtp-visualization", "qtp-diversity", "qp-target-gene", "qtp-job-output-folder"] - runs-on: ubuntu-latest - steps: - - name: Checkout tinqiita repo - uses: actions/checkout@v4 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Read image version from dockerfile - id: vars - run: | - VERSION=$(head -n 1 Images/${{ matrix.plugin }}/${{ matrix.plugin }}.dockerfile | cut -d ":" -f 2- | tr -d " ") - echo "IMAGE_TAG=$VERSION" >> $GITHUB_ENV - cp Images/${{ matrix.plugin }}/start_${{ matrix.plugin }}.sh Images/test_plugin.sh Images/${{ matrix.plugin }}/requirements.txt . - - - name: Download certificates from job build_main - uses: actions/download-artifact@v4 - with: - name: certificates - path: ./qiita_server_certificates - - - name: Create fake reference databases - run: | - cp -r ./references/qiita_server_certificates ./qiita_server_certificates - mkdir -p ./references/qp-deblur/ ./references/qp-target-gene - for f in `echo "./references/qp-deblur/reference-gg-raxml-bl.tre references/qp-target-gene/97_otus.fasta references/qp-target-gene/97_otus.tree references/qp-target-gene/97_otu_taxonomy.txt"`; do echo "fake" > $f; done - - - name: Log in to GitHub Container Registry - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build plugin images - uses: docker/build-push-action@v6 - with: - context: . - push: false - load: true - file: Images/${{ matrix.plugin }}/${{ matrix.plugin }}.dockerfile - - - name: adapt compose file to select specific plugin - run: | - sed -i "s/MATRIXPLUGIN/${{ matrix.plugin }}/g" compose_github.yaml - - - name: Run docker compose - uses: hoverkraft-tech/compose-action@v2.0.1 - with: - compose-file: "compose_github.yaml" - services: | - nginx - - - name: Execute tests in the running services - run: | - sleep 5 - docker compose exec ${{ matrix.plugin }} /bin/bash -c "bash /test_plugin.sh" - - - name: Push production image (only if tests passed) - if: success() - uses: docker/build-push-action@v6 - with: - context: . - push: true - file: Images/${{ matrix.plugin }}/${{ matrix.plugin }}.dockerfile - tags: | - tags: ghcr.io/${{ github.repository }}/${{ matrix.plugin }}:testcandidate - cache-from: type=gha,scope=tinqiita-${{ github.ref_name }} - cache-to: type=gha,scope=tinqiita-${{ github.ref_name }},mode=max - - publish_images: - needs: build_plugins - strategy: - matrix: - images: ["qp-deblur", "qtp-biom", "qtp-sequencing", "qtp-visualization", "qtp-diversity", "qp-target-gene", "qtp-job-output-folder", - "nginx", "qiita", "plugin_collector"] - runs-on: ubuntu-latest - steps: - - name: Checkout tinqiita repo - uses: actions/checkout@v4 - - - name: Login to computational.bio registry - uses: docker/login-action@v3 - with: - registry: harbor.computational.bio.uni-giessen.de - username: ${{ vars.HARBOR_CB_USERNAME }} - password: ${{ secrets.HARBOR_CB_SECRET }} - - - name: Read image version from dockerfile - id: vars - run: | - VERSION=$(head -n 1 Images/${{ matrix.images }}/${{ matrix.images }}.dockerfile | cut -d ":" -f 2- | tr -d " ") - echo "IMAGE_TAG=$VERSION" >> $GITHUB_ENV - - - name: Push production image - uses: docker/build-push-action@v6 - with: - context: . - push: true - file: Images/${{ matrix.images }}/${{ matrix.images }}.dockerfile - tags: | - harbor.computational.bio.uni-giessen.de/tinqiita/${{ matrix.images }}:${{ env.IMAGE_TAG }} - harbor.computational.bio.uni-giessen.de/tinqiita/${{ matrix.images }}:latest + # build_plugins: + # needs: build_main + # strategy: + # matrix: + # plugin: ["qp-deblur", "qtp-biom", "qtp-sequencing", "qtp-visualization", "qtp-diversity", "qp-target-gene", "qtp-job-output-folder"] + # runs-on: ubuntu-latest + # steps: + # - name: Checkout tinqiita repo + # uses: actions/checkout@v4 + + # - name: Set up Docker Buildx + # uses: docker/setup-buildx-action@v3 + + # - name: Read image version from dockerfile + # id: vars + # run: | + # VERSION=$(head -n 1 Images/${{ matrix.plugin }}/${{ matrix.plugin }}.dockerfile | cut -d ":" -f 2- | tr -d " ") + # echo "IMAGE_TAG=$VERSION" >> $GITHUB_ENV + # cp Images/${{ matrix.plugin }}/start_${{ matrix.plugin }}.sh Images/test_plugin.sh Images/${{ matrix.plugin }}/requirements.txt . + + # - name: Download certificates from job build_main + # uses: actions/download-artifact@v4 + # with: + # name: certificates + # path: ./qiita_server_certificates + + # - name: Create fake reference databases + # run: | + # cp -r ./references/qiita_server_certificates ./qiita_server_certificates + # mkdir -p ./references/qp-deblur/ ./references/qp-target-gene + # for f in `echo "./references/qp-deblur/reference-gg-raxml-bl.tre references/qp-target-gene/97_otus.fasta references/qp-target-gene/97_otus.tree references/qp-target-gene/97_otu_taxonomy.txt"`; do echo "fake" > $f; done + + # - name: Log in to GitHub Container Registry + # uses: docker/login-action@v3 + # with: + # registry: ghcr.io + # username: ${{ github.actor }} + # password: ${{ secrets.GITHUB_TOKEN }} + + # - name: Build plugin images + # uses: docker/build-push-action@v6 + # with: + # context: . + # push: false + # load: true + # file: Images/${{ matrix.plugin }}/${{ matrix.plugin }}.dockerfile + + # - name: adapt compose file to select specific plugin + # run: | + # sed -i "s/MATRIXPLUGIN/${{ matrix.plugin }}/g" compose_github.yaml + + # - name: Run docker compose + # uses: hoverkraft-tech/compose-action@v2.0.1 + # with: + # compose-file: "compose_github.yaml" + # services: | + # nginx + + # - name: Execute tests in the running services + # run: | + # sleep 5 + # docker compose exec ${{ matrix.plugin }} /bin/bash -c "bash /test_plugin.sh" + + # - name: Push production image (only if tests passed) + # if: success() + # uses: docker/build-push-action@v6 + # with: + # context: . + # push: true + # file: Images/${{ matrix.plugin }}/${{ matrix.plugin }}.dockerfile + # tags: | + # tags: ghcr.io/${{ github.repository }}/${{ matrix.plugin }}:testcandidate + # cache-from: type=gha,scope=tinqiita-${{ github.ref_name }} + # cache-to: type=gha,scope=tinqiita-${{ github.ref_name }},mode=max + + # publish_images: + # needs: build_plugins + # strategy: + # matrix: + # images: ["qp-deblur", "qtp-biom", "qtp-sequencing", "qtp-visualization", "qtp-diversity", "qp-target-gene", "qtp-job-output-folder", + # "nginx", "qiita", "plugin_collector"] + # runs-on: ubuntu-latest + # steps: + # - name: Checkout tinqiita repo + # uses: actions/checkout@v4 + + # - name: Login to computational.bio registry + # uses: docker/login-action@v3 + # with: + # registry: harbor.computational.bio.uni-giessen.de + # username: ${{ vars.HARBOR_CB_USERNAME }} + # password: ${{ secrets.HARBOR_CB_SECRET }} + + # - name: Read image version from dockerfile + # id: vars + # run: | + # VERSION=$(head -n 1 Images/${{ matrix.images }}/${{ matrix.images }}.dockerfile | cut -d ":" -f 2- | tr -d " ") + # echo "IMAGE_TAG=$VERSION" >> $GITHUB_ENV + + # - name: Push production image + # uses: docker/build-push-action@v6 + # with: + # context: . + # push: true + # file: Images/${{ matrix.images }}/${{ matrix.images }}.dockerfile + # tags: | + # harbor.computational.bio.uni-giessen.de/tinqiita/${{ matrix.images }}:${{ env.IMAGE_TAG }} + # harbor.computational.bio.uni-giessen.de/tinqiita/${{ matrix.images }}:latest From dec95fa2ad84c4801bef1b703a1a53272d0f1109 Mon Sep 17 00:00:00 2001 From: Stefan Janssen Date: Thu, 11 Sep 2025 20:37:51 +0200 Subject: [PATCH 09/22] now add build main image phase --- .github/workflows/buildContainer.yaml | 75 ++++++++++++++------------- 1 file changed, 40 insertions(+), 35 deletions(-) diff --git a/.github/workflows/buildContainer.yaml b/.github/workflows/buildContainer.yaml index bbd3565..c958107 100644 --- a/.github/workflows/buildContainer.yaml +++ b/.github/workflows/buildContainer.yaml @@ -28,45 +28,50 @@ jobs: ./qiita_server_certificates ./references/qiita_server_certificates - # build_main: - # needs: make_certificates - # strategy: - # matrix: - # container: ["nginx", "qiita", "plugin_collector"] - # runs-on: ubuntu-latest - # steps: - # - name: Checkout tinqiita repo - # uses: actions/checkout@v4 - - # - name: Set up Docker Buildx - # uses: docker/setup-buildx-action@v3 + build_main: + needs: make_certificates + strategy: + matrix: + container: ["nginx", "qiita", "plugin_collector"] + runs-on: ubuntu-latest + steps: + - name: Checkout tinqiita repo + uses: actions/checkout@v4 - # - name: Read image version from dockerfile - # id: vars - # run: | - # VERSION=$(head -n 1 Images/${{ matrix.container }}/${{ matrix.container }}.dockerfile | cut -d ":" -f 2- | tr -d " ") - # echo "IMAGE_TAG=$VERSION" >> $GITHUB_ENV - # cp Images/${{ matrix.container }}/start_${{ matrix.container }}.sh Images/test_plugin.sh Images/nginx/nginx_qiita.conf Images/${{ matrix.container }}/requirements.txt . - # cp Images/qiita/config_portal.cfg Images/qiita/config_qiita_oidc.cfg Images/qiita/drop_workflows.py Images/qiita/start_plugin.py Images/qiita/start_qiita-initDB.sh Images/qiita/start_qiita.sh . - # cp Images/plugin_collector/collect_configs.py Images/plugin_collector/fix_test_db.py Images/plugin_collector/stefan_cert.conf Images/plugin_collector/stefan_csr.conf . + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Read image version from dockerfile + id: vars + run: | + VERSION=$(head -n 1 Images/${{ matrix.container }}/${{ matrix.container }}.dockerfile | cut -d ":" -f 2- | tr -d " ") + echo "IMAGE_TAG=$VERSION" >> $GITHUB_ENV + cp Images/${{ matrix.container }}/start_${{ matrix.container }}.sh Images/test_plugin.sh Images/nginx/nginx_qiita.conf Images/${{ matrix.container }}/requirements.txt . + cp Images/qiita/config_portal.cfg Images/qiita/config_qiita_oidc.cfg Images/qiita/drop_workflows.py Images/qiita/start_plugin.py Images/qiita/start_qiita-initDB.sh Images/qiita/start_qiita.sh . + cp Images/plugin_collector/collect_configs.py Images/plugin_collector/fix_test_db.py Images/plugin_collector/stefan_cert.conf Images/plugin_collector/stefan_csr.conf . + + - name: Download certificates from job build_main + uses: actions/download-artifact@v4 + with: + name: certificates + path: ./ - # - name: Log in to GitHub Container Registry - # uses: docker/login-action@v3 - # with: - # registry: ghcr.io - # username: ${{ github.actor }} - # password: ${{ secrets.GITHUB_TOKEN }} + - name: Log in to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} - # - name: Build main qiita images and push to github's own registry - # uses: docker/build-push-action@v6 - # with: - # context: . - # load: true - # file: Images/${{ matrix.container }}/${{ matrix.container }}.dockerfile - # tags: ghcr.io/${{ github.repository }}/${{ matrix.container }}:testcandidate - # cache-from: type=gha,scope=tinqiita-${{ github.ref_name }} - # cache-to: type=gha,scope=tinqiita-${{ github.ref_name }},mode=max + - name: Build main qiita images and push to github's own registry + uses: docker/build-push-action@v6 + with: + context: . + load: true + file: Images/${{ matrix.container }}/${{ matrix.container }}.dockerfile + tags: ghcr.io/${{ github.repository }}/${{ matrix.container }}:testcandidate + cache-from: type=gha,scope=tinqiita-${{ github.ref_name }} + cache-to: type=gha,scope=tinqiita-${{ github.ref_name }},mode=max # build_plugins: # needs: build_main From 85e394b02afb25a63de571aff3b9be6bbca2e732 Mon Sep 17 00:00:00 2001 From: Stefan Janssen Date: Thu, 11 Sep 2025 20:47:21 +0200 Subject: [PATCH 10/22] add plugin build --- .github/workflows/buildContainer.yaml | 151 +++++++++++++++----------- 1 file changed, 86 insertions(+), 65 deletions(-) diff --git a/.github/workflows/buildContainer.yaml b/.github/workflows/buildContainer.yaml index c958107..0c796ee 100644 --- a/.github/workflows/buildContainer.yaml +++ b/.github/workflows/buildContainer.yaml @@ -72,81 +72,102 @@ jobs: tags: ghcr.io/${{ github.repository }}/${{ matrix.container }}:testcandidate cache-from: type=gha,scope=tinqiita-${{ github.ref_name }} cache-to: type=gha,scope=tinqiita-${{ github.ref_name }},mode=max - - # build_plugins: - # needs: build_main - # strategy: - # matrix: - # plugin: ["qp-deblur", "qtp-biom", "qtp-sequencing", "qtp-visualization", "qtp-diversity", "qp-target-gene", "qtp-job-output-folder"] - # runs-on: ubuntu-latest - # steps: - # - name: Checkout tinqiita repo - # uses: actions/checkout@v4 - # - name: Set up Docker Buildx - # uses: docker/setup-buildx-action@v3 + make_references: + needs: build_main + runs-on: ubuntu-latest + steps: + - name: Checkout tinqiita repo + uses: actions/checkout@v4 - # - name: Read image version from dockerfile - # id: vars - # run: | - # VERSION=$(head -n 1 Images/${{ matrix.plugin }}/${{ matrix.plugin }}.dockerfile | cut -d ":" -f 2- | tr -d " ") - # echo "IMAGE_TAG=$VERSION" >> $GITHUB_ENV - # cp Images/${{ matrix.plugin }}/start_${{ matrix.plugin }}.sh Images/test_plugin.sh Images/${{ matrix.plugin }}/requirements.txt . + - name: Create fake reference databases + run: | + mkdir -p ./references/qp-deblur/ ./references/qp-target-gene + for f in `echo "./references/qp-deblur/reference-gg-raxml-bl.tre references/qp-target-gene/97_otus.fasta references/qp-target-gene/97_otus.tree references/qp-target-gene/97_otu_taxonomy.txt"`; do echo "fake" > $f; done - # - name: Download certificates from job build_main - # uses: actions/download-artifact@v4 - # with: - # name: certificates - # path: ./qiita_server_certificates + - name: Store fake references for follow up jobs + uses: actions/upload-artifact@v4 + with: + name: fake_references + path: | + ./references/qp-deblur + ./references/qp-target-gene - # - name: Create fake reference databases - # run: | - # cp -r ./references/qiita_server_certificates ./qiita_server_certificates - # mkdir -p ./references/qp-deblur/ ./references/qp-target-gene - # for f in `echo "./references/qp-deblur/reference-gg-raxml-bl.tre references/qp-target-gene/97_otus.fasta references/qp-target-gene/97_otus.tree references/qp-target-gene/97_otu_taxonomy.txt"`; do echo "fake" > $f; done + build_plugins: + needs: + - build_main + - make_references + strategy: + matrix: + plugin: ["qp-deblur", "qtp-biom", "qtp-sequencing", "qtp-visualization", "qtp-diversity", "qp-target-gene", "qtp-job-output-folder"] + runs-on: ubuntu-latest + steps: + - name: Checkout tinqiita repo + uses: actions/checkout@v4 - # - name: Log in to GitHub Container Registry - # uses: docker/login-action@v3 - # with: - # registry: ghcr.io - # username: ${{ github.actor }} - # password: ${{ secrets.GITHUB_TOKEN }} + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 - # - name: Build plugin images - # uses: docker/build-push-action@v6 - # with: - # context: . - # push: false - # load: true - # file: Images/${{ matrix.plugin }}/${{ matrix.plugin }}.dockerfile + - name: Read image version from dockerfile + id: vars + run: | + VERSION=$(head -n 1 Images/${{ matrix.plugin }}/${{ matrix.plugin }}.dockerfile | cut -d ":" -f 2- | tr -d " ") + echo "IMAGE_TAG=$VERSION" >> $GITHUB_ENV + cp Images/${{ matrix.plugin }}/start_${{ matrix.plugin }}.sh Images/test_plugin.sh Images/${{ matrix.plugin }}/requirements.txt . - # - name: adapt compose file to select specific plugin - # run: | - # sed -i "s/MATRIXPLUGIN/${{ matrix.plugin }}/g" compose_github.yaml + - name: Download certificates from job build_main + uses: actions/download-artifact@v4 + with: + name: certificates + path: ./ + - name: Download fake references + uses: actions/download-artifact@v4 + with: + name: fake_references + path: ./ - # - name: Run docker compose - # uses: hoverkraft-tech/compose-action@v2.0.1 - # with: - # compose-file: "compose_github.yaml" - # services: | - # nginx + - name: Log in to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} - # - name: Execute tests in the running services - # run: | - # sleep 5 - # docker compose exec ${{ matrix.plugin }} /bin/bash -c "bash /test_plugin.sh" + - name: Build plugin images + uses: docker/build-push-action@v6 + with: + context: . + push: false + load: true + file: Images/${{ matrix.plugin }}/${{ matrix.plugin }}.dockerfile - # - name: Push production image (only if tests passed) - # if: success() - # uses: docker/build-push-action@v6 - # with: - # context: . - # push: true - # file: Images/${{ matrix.plugin }}/${{ matrix.plugin }}.dockerfile - # tags: | - # tags: ghcr.io/${{ github.repository }}/${{ matrix.plugin }}:testcandidate - # cache-from: type=gha,scope=tinqiita-${{ github.ref_name }} - # cache-to: type=gha,scope=tinqiita-${{ github.ref_name }},mode=max + - name: adapt compose file to select specific plugin + run: | + sed -i "s/MATRIXPLUGIN/${{ matrix.plugin }}/g" compose_github.yaml + + - name: Run docker compose + uses: hoverkraft-tech/compose-action@v2.0.1 + with: + compose-file: "compose_github.yaml" + services: | + nginx + + - name: Execute tests in the running services + run: | + sleep 5 + docker compose exec ${{ matrix.plugin }} /bin/bash -c "bash /test_plugin.sh" + + - name: Push production image (only if tests passed) + if: success() + uses: docker/build-push-action@v6 + with: + context: . + push: true + file: Images/${{ matrix.plugin }}/${{ matrix.plugin }}.dockerfile + tags: | + tags: ghcr.io/${{ github.repository }}/${{ matrix.plugin }}:testcandidate + cache-from: type=gha,scope=tinqiita-${{ github.ref_name }} + cache-to: type=gha,scope=tinqiita-${{ github.ref_name }},mode=max # publish_images: # needs: build_plugins From d70700690a57e12daf0eae888a01a7cc66dcc4b4 Mon Sep 17 00:00:00 2001 From: Stefan Janssen Date: Thu, 11 Sep 2025 20:59:02 +0200 Subject: [PATCH 11/22] copy missing files --- .github/workflows/buildContainer.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/buildContainer.yaml b/.github/workflows/buildContainer.yaml index 0c796ee..f296909 100644 --- a/.github/workflows/buildContainer.yaml +++ b/.github/workflows/buildContainer.yaml @@ -113,7 +113,7 @@ jobs: run: | VERSION=$(head -n 1 Images/${{ matrix.plugin }}/${{ matrix.plugin }}.dockerfile | cut -d ":" -f 2- | tr -d " ") echo "IMAGE_TAG=$VERSION" >> $GITHUB_ENV - cp Images/${{ matrix.plugin }}/start_${{ matrix.plugin }}.sh Images/test_plugin.sh Images/${{ matrix.plugin }}/requirements.txt . + cp Images/${{ matrix.plugin }}/start_${{ matrix.plugin }}.sh Images/test_plugin.sh Images/${{ matrix.plugin }}/requirements.txt Images/trigger_noconda.py Images/trigger.py . - name: Download certificates from job build_main uses: actions/download-artifact@v4 From 96784464550e0b989a09d2c27b2cb0029adfcf4d Mon Sep 17 00:00:00 2001 From: Stefan Janssen Date: Thu, 11 Sep 2025 21:05:34 +0200 Subject: [PATCH 12/22] add env configuration files --- .github/workflows/buildContainer.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/buildContainer.yaml b/.github/workflows/buildContainer.yaml index f296909..510eca3 100644 --- a/.github/workflows/buildContainer.yaml +++ b/.github/workflows/buildContainer.yaml @@ -82,6 +82,7 @@ jobs: - name: Create fake reference databases run: | + make ./environments/qiita_db.env ./environments/qiita.env config mkdir -p ./references/qp-deblur/ ./references/qp-target-gene for f in `echo "./references/qp-deblur/reference-gg-raxml-bl.tre references/qp-target-gene/97_otus.fasta references/qp-target-gene/97_otus.tree references/qp-target-gene/97_otu_taxonomy.txt"`; do echo "fake" > $f; done @@ -92,6 +93,7 @@ jobs: path: | ./references/qp-deblur ./references/qp-target-gene + ./environments build_plugins: needs: From 33bb56621866a71a4b4781203d25175cb7286875 Mon Sep 17 00:00:00 2001 From: Stefan Janssen Date: Thu, 11 Sep 2025 21:17:38 +0200 Subject: [PATCH 13/22] pull from ghcr --- compose_github.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/compose_github.yaml b/compose_github.yaml index 0767e7b..b2dde1e 100644 --- a/compose_github.yaml +++ b/compose_github.yaml @@ -170,7 +170,7 @@ services: # start_period: 10s qtp-biom: - image: tinqiita/qtp-biom:testcandidate + image: ghcr.io/qiita-keycloak/qtp-biom:testcandidate command: ['./start_qtp-biom.sh'] # network_mode: host # stdin_open: true @@ -186,7 +186,7 @@ services: - qiita-net qtp-sequencing: - image: tinqiita/qtp-sequencing:testcandidate + image: ghcr.io/qiita-keycloak/qtp-sequencing:testcandidate command: ['./start_qtp-sequencing.sh'] # network_mode: host # stdin_open: true @@ -208,7 +208,7 @@ services: # start_period: 3s qp-target-gene: - image: tinqiita/qp-target-gene:testcandidate + image: ghcr.io/qiita-keycloak/qp-target-gene:testcandidate command: ['./start_qp-target-gene.sh'] # network_mode: host # stdin_open: true @@ -225,7 +225,7 @@ services: - qiita-net qtp-visualization: - image: tinqiita/qtp-visualization:testcandidate + image: ghcr.io/qiita-keycloak/qtp-visualization:testcandidate command: ['./start_qtp-visualization.sh'] # network_mode: host # stdin_open: true @@ -241,7 +241,7 @@ services: - qiita-net qtp-diversity: - image: tinqiita/qtp-diversity:testcandidate + image: ghcr.io/qiita-keycloak/qtp-diversity:testcandidate command: ['./start_qtp-diversity.sh'] # network_mode: host # stdin_open: true @@ -257,7 +257,7 @@ services: - qiita-net qp-deblur: - image: tinqiita/qp-deblur:testcandidate + image: ghcr.io/qiita-keycloak/qp-deblur:testcandidate command: ['./start_qp-deblur.sh'] restart: no volumes: @@ -271,7 +271,7 @@ services: - qiita-net qp-qiime2: - image: tinqiita/qp-qiime2:testcandidate + image: ghcr.io/qiita-keycloak/qp-qiime2:testcandidate command: ['./start_qp-qiime2.sh'] # network_mode: host # stdin_open: true @@ -288,7 +288,7 @@ services: - qiita-net qtp-job-output-folder: - image: tinqiita/qtp-job-output-folder:testcandidate + image: ghcr.io/qiita-keycloak/qtp-job-output-folder:testcandidate command: ['./start_qtp-job-output-folder.sh'] # network_mode: host # stdin_open: true From d672d22f159fe39c1072c0c6fec23de0f67504f8 Mon Sep 17 00:00:00 2001 From: Stefan Janssen Date: Thu, 11 Sep 2025 21:33:49 +0200 Subject: [PATCH 14/22] push to ghcr --- .github/workflows/buildContainer.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/buildContainer.yaml b/.github/workflows/buildContainer.yaml index 510eca3..753ccc1 100644 --- a/.github/workflows/buildContainer.yaml +++ b/.github/workflows/buildContainer.yaml @@ -139,9 +139,11 @@ jobs: uses: docker/build-push-action@v6 with: context: . - push: false load: true file: Images/${{ matrix.plugin }}/${{ matrix.plugin }}.dockerfile + tags: tags: ghcr.io/${{ github.repository }}/${{ matrix.plugin }}:testcandidate + cache-from: type=gha,scope=tinqiita-${{ github.ref_name }} + cache-to: type=gha,scope=tinqiita-${{ github.ref_name }},mode=max - name: adapt compose file to select specific plugin run: | From 8233831ffe0d34789e94057b8679b0ceef265dd3 Mon Sep 17 00:00:00 2001 From: Stefan Janssen Date: Thu, 11 Sep 2025 21:34:29 +0200 Subject: [PATCH 15/22] fix yaml --- .github/workflows/buildContainer.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/buildContainer.yaml b/.github/workflows/buildContainer.yaml index 753ccc1..8e9616a 100644 --- a/.github/workflows/buildContainer.yaml +++ b/.github/workflows/buildContainer.yaml @@ -141,7 +141,7 @@ jobs: context: . load: true file: Images/${{ matrix.plugin }}/${{ matrix.plugin }}.dockerfile - tags: tags: ghcr.io/${{ github.repository }}/${{ matrix.plugin }}:testcandidate + tags: ghcr.io/${{ github.repository }}/${{ matrix.plugin }}:testcandidate cache-from: type=gha,scope=tinqiita-${{ github.ref_name }} cache-to: type=gha,scope=tinqiita-${{ github.ref_name }},mode=max From 0bdeb4d93925296e66a6c44c00732eeed1791bb7 Mon Sep 17 00:00:00 2001 From: Stefan Janssen Date: Thu, 11 Sep 2025 21:49:28 +0200 Subject: [PATCH 16/22] adding jlab/ --- compose_github.yaml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/compose_github.yaml b/compose_github.yaml index b2dde1e..443a6f9 100644 --- a/compose_github.yaml +++ b/compose_github.yaml @@ -27,7 +27,7 @@ services: # start_period: 20s qiita-initialize-db: - image: ghcr.io/qiita-keycloak/qiita:testcandidate + image: ghcr.io/jlab/qiita-keycloak/qiita:testcandidate command: ['/start_qiita-initDB.sh'] depends_on: - qiita-db @@ -46,7 +46,7 @@ services: - qiita-net qiita: - image: ghcr.io/qiita-keycloak/qiita:testcandidate + image: ghcr.io/jlab/qiita-keycloak/qiita:testcandidate build: # image wird hier direkt gebaut context: ./Images/qiita dockerfile: Dockerfile @@ -82,7 +82,7 @@ services: - "21174:21174" qiita-worker: - image: ghcr.io/qiita-keycloak/qiita:testcandidate + image: ghcr.io/jlab/qiita-keycloak/qiita:testcandidate build: # image wird hier direkt gebaut context: ./Images/qiita dockerfile: Dockerfile @@ -142,7 +142,7 @@ services: # start_period: 20s nginx: - image: ghcr.io/qiita-keycloak/nginx:testcandidate + image: ghcr.io/jlab/qiita-keycloak/nginx:testcandidate build: context: ./Images/nginx dockerfile: Dockerfile @@ -170,7 +170,7 @@ services: # start_period: 10s qtp-biom: - image: ghcr.io/qiita-keycloak/qtp-biom:testcandidate + image: ghcr.io/jlab/qiita-keycloak/qtp-biom:testcandidate command: ['./start_qtp-biom.sh'] # network_mode: host # stdin_open: true @@ -186,7 +186,7 @@ services: - qiita-net qtp-sequencing: - image: ghcr.io/qiita-keycloak/qtp-sequencing:testcandidate + image: ghcr.io/jlab/qiita-keycloak/qtp-sequencing:testcandidate command: ['./start_qtp-sequencing.sh'] # network_mode: host # stdin_open: true @@ -208,7 +208,7 @@ services: # start_period: 3s qp-target-gene: - image: ghcr.io/qiita-keycloak/qp-target-gene:testcandidate + image: ghcr.io/jlab/qiita-keycloak/qp-target-gene:testcandidate command: ['./start_qp-target-gene.sh'] # network_mode: host # stdin_open: true @@ -225,7 +225,7 @@ services: - qiita-net qtp-visualization: - image: ghcr.io/qiita-keycloak/qtp-visualization:testcandidate + image: ghcr.io/jlab/qiita-keycloak/qtp-visualization:testcandidate command: ['./start_qtp-visualization.sh'] # network_mode: host # stdin_open: true @@ -241,7 +241,7 @@ services: - qiita-net qtp-diversity: - image: ghcr.io/qiita-keycloak/qtp-diversity:testcandidate + image: ghcr.io/jlab/qiita-keycloak/qtp-diversity:testcandidate command: ['./start_qtp-diversity.sh'] # network_mode: host # stdin_open: true @@ -257,7 +257,7 @@ services: - qiita-net qp-deblur: - image: ghcr.io/qiita-keycloak/qp-deblur:testcandidate + image: ghcr.io/jlab/qiita-keycloak/qp-deblur:testcandidate command: ['./start_qp-deblur.sh'] restart: no volumes: @@ -271,7 +271,7 @@ services: - qiita-net qp-qiime2: - image: ghcr.io/qiita-keycloak/qp-qiime2:testcandidate + image: ghcr.io/jlab/qiita-keycloak/qp-qiime2:testcandidate command: ['./start_qp-qiime2.sh'] # network_mode: host # stdin_open: true @@ -288,7 +288,7 @@ services: - qiita-net qtp-job-output-folder: - image: ghcr.io/qiita-keycloak/qtp-job-output-folder:testcandidate + image: ghcr.io/jlab/qiita-keycloak/qtp-job-output-folder:testcandidate command: ['./start_qtp-job-output-folder.sh'] # network_mode: host # stdin_open: true @@ -306,7 +306,7 @@ services: plugin-collector: # prior to qiita (master and worker) start up, iterates through the QIITA_PLUGINS : separated list of plugin containers # to compile all q*.conf files from plugin containers in the server-plugin-configs volume - image: ghcr.io/qiita-keycloak/plugin_collector:testcandidate + image: ghcr.io/jlab/qiita-keycloak/plugin_collector:testcandidate restart: no networks: - qiita-net From 2921b2f462bb84fe91d87b96e78086065f5aac85 Mon Sep 17 00:00:00 2001 From: Stefan Janssen Date: Thu, 11 Sep 2025 22:04:08 +0200 Subject: [PATCH 17/22] push to ghcr --- .github/workflows/buildContainer.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/buildContainer.yaml b/.github/workflows/buildContainer.yaml index 8e9616a..7158435 100644 --- a/.github/workflows/buildContainer.yaml +++ b/.github/workflows/buildContainer.yaml @@ -67,7 +67,7 @@ jobs: uses: docker/build-push-action@v6 with: context: . - load: true + push: true file: Images/${{ matrix.container }}/${{ matrix.container }}.dockerfile tags: ghcr.io/${{ github.repository }}/${{ matrix.container }}:testcandidate cache-from: type=gha,scope=tinqiita-${{ github.ref_name }} From d1a1b038c974ca4bba422818307e5a5ea7cca3fa Mon Sep 17 00:00:00 2001 From: Stefan Janssen Date: Thu, 11 Sep 2025 22:18:20 +0200 Subject: [PATCH 18/22] fix tag syntax --- .github/workflows/buildContainer.yaml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/buildContainer.yaml b/.github/workflows/buildContainer.yaml index 7158435..55e54a9 100644 --- a/.github/workflows/buildContainer.yaml +++ b/.github/workflows/buildContainer.yaml @@ -168,10 +168,7 @@ jobs: context: . push: true file: Images/${{ matrix.plugin }}/${{ matrix.plugin }}.dockerfile - tags: | - tags: ghcr.io/${{ github.repository }}/${{ matrix.plugin }}:testcandidate - cache-from: type=gha,scope=tinqiita-${{ github.ref_name }} - cache-to: type=gha,scope=tinqiita-${{ github.ref_name }},mode=max + tags: ghcr.io/${{ github.repository }}/${{ matrix.plugin }}:testcandidate # publish_images: # needs: build_plugins From d346019991ea321eeeb8da656be83ffa63f86474 Mon Sep 17 00:00:00 2001 From: Stefan Janssen Date: Thu, 11 Sep 2025 23:07:50 +0200 Subject: [PATCH 19/22] create real SEPP references for qp-deblur & push to habor --- .github/workflows/buildContainer.yaml | 83 +++++++++++++++------------ 1 file changed, 46 insertions(+), 37 deletions(-) diff --git a/.github/workflows/buildContainer.yaml b/.github/workflows/buildContainer.yaml index 55e54a9..cdaefc2 100644 --- a/.github/workflows/buildContainer.yaml +++ b/.github/workflows/buildContainer.yaml @@ -80,11 +80,11 @@ jobs: - name: Checkout tinqiita repo uses: actions/checkout@v4 - - name: Create fake reference databases + - name: Create partially fake reference databases run: | - make ./environments/qiita_db.env ./environments/qiita.env config mkdir -p ./references/qp-deblur/ ./references/qp-target-gene - for f in `echo "./references/qp-deblur/reference-gg-raxml-bl.tre references/qp-target-gene/97_otus.fasta references/qp-target-gene/97_otus.tree references/qp-target-gene/97_otu_taxonomy.txt"`; do echo "fake" > $f; done + make ./environments/qiita_db.env ./environments/qiita.env config ./references/qp-deblur/reference-gg-raxml-bl.tre + for f in `echo "references/qp-target-gene/97_otus.fasta references/qp-target-gene/97_otus.tree references/qp-target-gene/97_otu_taxonomy.txt"`; do echo "fake" > $f; done - name: Store fake references for follow up jobs uses: actions/upload-artifact@v4 @@ -161,7 +161,7 @@ jobs: sleep 5 docker compose exec ${{ matrix.plugin }} /bin/bash -c "bash /test_plugin.sh" - - name: Push production image (only if tests passed) + - name: Push image to ghcr (only if tests passed) if: success() uses: docker/build-push-action@v6 with: @@ -170,36 +170,45 @@ jobs: file: Images/${{ matrix.plugin }}/${{ matrix.plugin }}.dockerfile tags: ghcr.io/${{ github.repository }}/${{ matrix.plugin }}:testcandidate - # publish_images: - # needs: build_plugins - # strategy: - # matrix: - # images: ["qp-deblur", "qtp-biom", "qtp-sequencing", "qtp-visualization", "qtp-diversity", "qp-target-gene", "qtp-job-output-folder", - # "nginx", "qiita", "plugin_collector"] - # runs-on: ubuntu-latest - # steps: - # - name: Checkout tinqiita repo - # uses: actions/checkout@v4 - - # - name: Login to computational.bio registry - # uses: docker/login-action@v3 - # with: - # registry: harbor.computational.bio.uni-giessen.de - # username: ${{ vars.HARBOR_CB_USERNAME }} - # password: ${{ secrets.HARBOR_CB_SECRET }} - - # - name: Read image version from dockerfile - # id: vars - # run: | - # VERSION=$(head -n 1 Images/${{ matrix.images }}/${{ matrix.images }}.dockerfile | cut -d ":" -f 2- | tr -d " ") - # echo "IMAGE_TAG=$VERSION" >> $GITHUB_ENV - - # - name: Push production image - # uses: docker/build-push-action@v6 - # with: - # context: . - # push: true - # file: Images/${{ matrix.images }}/${{ matrix.images }}.dockerfile - # tags: | - # harbor.computational.bio.uni-giessen.de/tinqiita/${{ matrix.images }}:${{ env.IMAGE_TAG }} - # harbor.computational.bio.uni-giessen.de/tinqiita/${{ matrix.images }}:latest + publish_images: + needs: + - build_plugins + - build_main + strategy: + matrix: + images: ["qp-deblur", "qtp-biom", "qtp-sequencing", "qtp-visualization", "qtp-diversity", "qp-target-gene", "qtp-job-output-folder", + "nginx", "qiita", "plugin_collector"] + runs-on: ubuntu-latest + steps: + - name: Log in to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Login to computational.bio registry + uses: docker/login-action@v3 + with: + registry: harbor.computational.bio.uni-giessen.de + username: ${{ vars.HARBOR_CB_USERNAME }} + password: ${{ secrets.HARBOR_CB_SECRET }} + + - name: Pull image from GHCR + run: docker pull ghcr.io/${{ github.repository }}/{{ matrix.images }}:testcandidate + + - name: Read image version from dockerfile + id: vars + run: | + VERSION=$(head -n 1 Images/${{ matrix.images }}/${{ matrix.images }}.dockerfile | cut -d ":" -f 2- | tr -d " ") + echo "IMAGE_TAG=$VERSION" >> $GITHUB_ENV + + - name: Retag image for Docker Hub + run: docker tag \ + ghcr.io/${{ github.repository }}/${{ matrix.images }}:testcandidate \ + harbor.computational.bio.uni-giessen.de/tinqiita/${{ matrix.images }}:${{ env.IMAGE_TAG }} + + - name: Push image to Docker Hub + run: | + docker push harbor.computational.bio.uni-giessen.de/tinqiita/${{ matrix.images }}:${{ env.IMAGE_TAG }} + docker push harbor.computational.bio.uni-giessen.de/tinqiita/${{ matrix.images }}:latest From 9ad6f15148edbbc8eadd6ee13dccafd3354c24f0 Mon Sep 17 00:00:00 2001 From: Stefan Janssen Date: Fri, 12 Sep 2025 07:29:30 +0200 Subject: [PATCH 20/22] make it a variable --- .github/workflows/buildContainer.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/buildContainer.yaml b/.github/workflows/buildContainer.yaml index cdaefc2..aec9d62 100644 --- a/.github/workflows/buildContainer.yaml +++ b/.github/workflows/buildContainer.yaml @@ -195,7 +195,7 @@ jobs: password: ${{ secrets.HARBOR_CB_SECRET }} - name: Pull image from GHCR - run: docker pull ghcr.io/${{ github.repository }}/{{ matrix.images }}:testcandidate + run: docker pull ghcr.io/${{ github.repository }}/${{ matrix.images }}:testcandidate - name: Read image version from dockerfile id: vars From 702e85f220114b839a76cc4f426047f7d4fca87a Mon Sep 17 00:00:00 2001 From: Stefan Janssen Date: Fri, 12 Sep 2025 08:39:58 +0200 Subject: [PATCH 21/22] checkout repo to obtain version number from docker file --- .github/workflows/buildContainer.yaml | 93 ++++++++++++++++++++++++--- Images/qp-qiime2/qp-qiime2.dockerfile | 2 + 2 files changed, 87 insertions(+), 8 deletions(-) diff --git a/.github/workflows/buildContainer.yaml b/.github/workflows/buildContainer.yaml index aec9d62..19bcc2c 100644 --- a/.github/workflows/buildContainer.yaml +++ b/.github/workflows/buildContainer.yaml @@ -170,16 +170,94 @@ jobs: file: Images/${{ matrix.plugin }}/${{ matrix.plugin }}.dockerfile tags: ghcr.io/${{ github.repository }}/${{ matrix.plugin }}:testcandidate + # build_mulit_plugins: + # needs: + # - build_plugins + # strategy: + # matrix: + # plugin: ["qp-qiime2"] + # runs-on: ubuntu-latest + # steps: + # - name: Checkout tinqiita repo + # uses: actions/checkout@v4 + + # - name: Set up Docker Buildx + # uses: docker/setup-buildx-action@v3 + + # - name: Read image version from dockerfile + # id: vars + # run: | + # VERSION=$(head -n 1 Images/${{ matrix.plugin }}/${{ matrix.plugin }}.dockerfile | cut -d ":" -f 2- | tr -d " ") + # echo "IMAGE_TAG=$VERSION" >> $GITHUB_ENV + # cp Images/${{ matrix.plugin }}/start_${{ matrix.plugin }}.sh Images/test_plugin.sh Images/${{ matrix.plugin }}/requirements.txt Images/trigger_noconda.py Images/trigger.py . + + # - name: Download certificates from job build_main + # uses: actions/download-artifact@v4 + # with: + # name: certificates + # path: ./ + # - name: Download fake references + # uses: actions/download-artifact@v4 + # with: + # name: fake_references + # path: ./ + + # - name: Log in to GitHub Container Registry + # uses: docker/login-action@v3 + # with: + # registry: ghcr.io + # username: ${{ github.actor }} + # password: ${{ secrets.GITHUB_TOKEN }} + + # - name: Build plugin images + # uses: docker/build-push-action@v6 + # with: + # context: . + # load: true + # file: Images/${{ matrix.plugin }}/${{ matrix.plugin }}.dockerfile + # tags: ghcr.io/${{ github.repository }}/${{ matrix.plugin }}:testcandidate + # cache-from: type=gha,scope=tinqiita-${{ github.ref_name }} + # cache-to: type=gha,scope=tinqiita-${{ github.ref_name }},mode=max + + # - name: adapt compose file to select specific plugin + # run: | + # sed -i "s|||" compose_github.yaml + # sed -i "s/MATRIXPLUGIN/${{ matrix.plugin }}/g" compose_github.yaml + + # - name: Run docker compose + # uses: hoverkraft-tech/compose-action@v2.0.1 + # with: + # compose-file: "compose_github.yaml" + # services: | + # nginx + + # - name: Execute tests in the running services + # run: | + # sleep 5 + # docker compose exec ${{ matrix.plugin }} /bin/bash -c "bash /test_plugin.sh" + + # - name: Push image to ghcr (only if tests passed) + # if: success() + # uses: docker/build-push-action@v6 + # with: + # context: . + # push: true + # file: Images/${{ matrix.plugin }}/${{ matrix.plugin }}.dockerfile + # tags: ghcr.io/${{ github.repository }}/${{ matrix.plugin }}:testcandidate + publish_images: needs: - build_plugins - build_main strategy: matrix: - images: ["qp-deblur", "qtp-biom", "qtp-sequencing", "qtp-visualization", "qtp-diversity", "qp-target-gene", "qtp-job-output-folder", + image: ["qp-deblur", "qtp-biom", "qtp-sequencing", "qtp-visualization", "qtp-diversity", "qp-target-gene", "qtp-job-output-folder", "nginx", "qiita", "plugin_collector"] runs-on: ubuntu-latest steps: + - name: Checkout tinqiita repo + uses: actions/checkout@v4 + - name: Log in to GitHub Container Registry uses: docker/login-action@v3 with: @@ -195,20 +273,19 @@ jobs: password: ${{ secrets.HARBOR_CB_SECRET }} - name: Pull image from GHCR - run: docker pull ghcr.io/${{ github.repository }}/${{ matrix.images }}:testcandidate + run: docker pull ghcr.io/${{ github.repository }}/${{ matrix.image }}:testcandidate - name: Read image version from dockerfile id: vars run: | - VERSION=$(head -n 1 Images/${{ matrix.images }}/${{ matrix.images }}.dockerfile | cut -d ":" -f 2- | tr -d " ") + VERSION=$(head -n 1 Images/${{ matrix.image }}/${{ matrix.image }}.dockerfile | cut -d ":" -f 2- | tr -d " ") echo "IMAGE_TAG=$VERSION" >> $GITHUB_ENV - name: Retag image for Docker Hub - run: docker tag \ - ghcr.io/${{ github.repository }}/${{ matrix.images }}:testcandidate \ - harbor.computational.bio.uni-giessen.de/tinqiita/${{ matrix.images }}:${{ env.IMAGE_TAG }} + run: | + docker tag ghcr.io/${{ github.repository }}/${{ matrix.image }}:testcandidate harbor.computational.bio.uni-giessen.de/tinqiita/${{ matrix.image }}:${{ env.IMAGE_TAG }} - name: Push image to Docker Hub run: | - docker push harbor.computational.bio.uni-giessen.de/tinqiita/${{ matrix.images }}:${{ env.IMAGE_TAG }} - docker push harbor.computational.bio.uni-giessen.de/tinqiita/${{ matrix.images }}:latest + docker push harbor.computational.bio.uni-giessen.de/tinqiita/${{ matrix.image }}:${{ env.IMAGE_TAG }} + docker push harbor.computational.bio.uni-giessen.de/tinqiita/${{ matrix.image }}:latest diff --git a/Images/qp-qiime2/qp-qiime2.dockerfile b/Images/qp-qiime2/qp-qiime2.dockerfile index 6f63281..0cc7639 100644 --- a/Images/qp-qiime2/qp-qiime2.dockerfile +++ b/Images/qp-qiime2/qp-qiime2.dockerfile @@ -1,3 +1,5 @@ +# VERSION: 2025.09.12 + FROM ubuntu:24.04 ARG MINIFORGE_VERSION=24.1.2-0 From 6a7f4c3cb50224035af2a9294c5bc76e3fbcf7c1 Mon Sep 17 00:00:00 2001 From: Stefan Janssen Date: Fri, 12 Sep 2025 10:47:57 +0200 Subject: [PATCH 22/22] also create local "latest" tag before pushing --- .github/workflows/buildContainer.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/buildContainer.yaml b/.github/workflows/buildContainer.yaml index 19bcc2c..7f7c79b 100644 --- a/.github/workflows/buildContainer.yaml +++ b/.github/workflows/buildContainer.yaml @@ -284,6 +284,7 @@ jobs: - name: Retag image for Docker Hub run: | docker tag ghcr.io/${{ github.repository }}/${{ matrix.image }}:testcandidate harbor.computational.bio.uni-giessen.de/tinqiita/${{ matrix.image }}:${{ env.IMAGE_TAG }} + docker tag ghcr.io/${{ github.repository }}/${{ matrix.image }}:testcandidate harbor.computational.bio.uni-giessen.de/tinqiita/${{ matrix.image }}:latest - name: Push image to Docker Hub run: |