Docker Image CI #72
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
name: Docker Image CI | |
on: | |
release: | |
types: [released] | |
pull_request: | |
branches: | |
- master | |
push: | |
branches: | |
- dev | |
workflow_dispatch: | |
inputs: | |
release_tag: | |
description: '' | |
required: true | |
type: string | |
pyevents_branch: | |
default: 'main' | |
description: '' | |
required: false | |
type: string | |
run_tests: | |
description: 'trigger test suite' | |
type: boolean | |
default: false | |
jobs: | |
engine: | |
runs-on: ubuntu-latest | |
environment: main | |
steps: | |
- name: Set TRAPS_REL | |
run: | | |
if [[ ${{ github.event_name == 'workflow_dispatch' }} == true ]]; then | |
TRAPS_REL=${{ inputs.release_tag }} | |
elif [[ ${{ github.event_name == 'push' }} == true ]]; then | |
TRAPS_REL=latest | |
elif [[ ${{ github.event_name == 'pull_request' }} == true ]]; then | |
TRAPS_REL=latest | |
else | |
TRAPS_REL=${{ github.event.release.tag_name }} | |
fi | |
echo "TRAPS_REL=$TRAPS_REL" >> "$GITHUB_ENV" | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build and push engine | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
tags: tapis/camera_traps_engine:${{ env.TRAPS_REL }} | |
build-args: TRAPS_REL=${{ env.TRAPS_REL }} | |
pyevents: | |
runs-on: ubuntu-latest | |
environment: main | |
steps: | |
- name: Set TRAPS_REL | |
run: | | |
if [[ ${{ github.event_name == 'workflow_dispatch' }} == true ]]; then | |
TRAPS_REL=${{ inputs.release_tag }} | |
PYEVENTS_BRANCH=${{ inputs.pyevents_branch }} | |
elif [[ ${{ github.event_name == 'push' }} == true ]]; then | |
TRAPS_REL=latest | |
PYEVENTS_BRANCH=main | |
elif [[ ${{ github.event_name == 'pull_request' }} == true ]]; then | |
TRAPS_REL=latest | |
PYEVENTS_BRANCH=main | |
else | |
TRAPS_REL=${{ github.event.release.tag_name }} | |
PYEVENTS_BRANCH=main | |
fi | |
echo "TRAPS_REL=$TRAPS_REL" >> "$GITHUB_ENV" | |
echo "PYEVENTS_BRANCH=$PYEVENTS_BRANCH" >> "$GITHUB_ENV" | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
repository: tapis-project/event-engine | |
ref: ${{ env.PYEVENTS_BRANCH }} | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build and push pyevents | |
uses: docker/build-push-action@v5 | |
with: | |
context: pyevents | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
tags: tapis/pyevents | |
pyevents_38: | |
runs-on: ubuntu-latest | |
environment: main | |
steps: | |
- name: Set TRAPS_REL | |
run: | | |
if [[ ${{ github.event_name == 'workflow_dispatch' }} == true ]]; then | |
TRAPS_REL=${{ inputs.release_tag }} | |
PYEVENTS_BRANCH=${{ inputs.pyevents_branch }} | |
elif [[ ${{ github.event_name == 'push' }} == true ]]; then | |
TRAPS_REL=latest | |
PYEVENTS_BRANCH=main | |
elif [[ ${{ github.event_name == 'pull_request' }} == true ]]; then | |
TRAPS_REL=latest | |
PYEVENTS_BRANCH=main | |
else | |
TRAPS_REL=${{ github.event.release.tag_name }} | |
PYEVENTS_BRANCH=main | |
fi | |
echo "TRAPS_REL=$TRAPS_REL" >> "$GITHUB_ENV" | |
echo "PYEVENTS_BRANCH=$PYEVENTS_BRANCH" >> "$GITHUB_ENV" | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
repository: tapis-project/event-engine | |
ref: ${{ env.PYEVENTS_BRANCH }} | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build and push pyevents:3.8 | |
uses: docker/build-push-action@v5 | |
with: | |
context: pyevents | |
file: pyevents/Dockerfile-3.8 | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
tags: tapis/pyevents:3.8 | |
camera_traps_py: | |
runs-on: ubuntu-latest | |
environment: main | |
needs: [pyevents, pyevents_38] | |
steps: | |
- name: Set TRAPS_REL | |
run: | | |
if [[ ${{ github.event_name == 'workflow_dispatch' }} == true ]]; then | |
TRAPS_REL=${{ inputs.release_tag }} | |
elif [[ ${{ github.event_name == 'push' }} == true ]]; then | |
TRAPS_REL=latest | |
elif [[ ${{ github.event_name == 'pull_request' }} == true ]]; then | |
TRAPS_REL=latest | |
else | |
TRAPS_REL=${{ github.event.release.tag_name }} | |
fi | |
echo "TRAPS_REL=$TRAPS_REL" >> "$GITHUB_ENV" | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build and push camera_traps_py | |
uses: docker/build-push-action@v5 | |
with: | |
context: src/python | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
tags: tapis/camera_traps_py:${{ env.TRAPS_REL }} | |
camera_traps_py_38: | |
runs-on: ubuntu-latest | |
environment: main | |
needs: [pyevents, pyevents_38] | |
steps: | |
- name: Set TRAPS_REL | |
run: | | |
if [[ ${{ github.event_name == 'workflow_dispatch' }} == true ]]; then | |
TRAPS_REL=${{ inputs.release_tag }} | |
elif [[ ${{ github.event_name == 'push' }} == true ]]; then | |
TRAPS_REL=latest | |
elif [[ ${{ github.event_name == 'pull_request' }} == true ]]; then | |
TRAPS_REL=latest | |
else | |
TRAPS_REL=${{ github.event.release.tag_name }} | |
fi | |
echo "TRAPS_REL=$TRAPS_REL" >> "$GITHUB_ENV" | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build and push camera_traps_py_3.8 | |
uses: docker/build-push-action@v5 | |
with: | |
context: src/python | |
file: src/python/Dockerfile-3.8 | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
tags: tapis/camera_traps_py_3.8:${{ env.TRAPS_REL }} | |
image_scoring_plugin_py_38: | |
runs-on: ubuntu-latest | |
environment: main | |
needs: camera_traps_py_38 | |
steps: | |
- name: Set TRAPS_REL | |
run: | | |
if [[ ${{ github.event_name == 'workflow_dispatch' }} == true ]]; then | |
TRAPS_REL=${{ inputs.release_tag }} | |
elif [[ ${{ github.event_name == 'push' }} == true ]]; then | |
TRAPS_REL=latest | |
elif [[ ${{ github.event_name == 'pull_request' }} == true ]]; then | |
TRAPS_REL=latest | |
else | |
TRAPS_REL=${{ github.event.release.tag_name }} | |
fi | |
echo "TRAPS_REL=$TRAPS_REL" >> "$GITHUB_ENV" | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Delete extra files | |
run: | | |
sudo rm -rf /usr/share/dotnet | |
sudo rm -rf /opt/ghc | |
sudo rm -rf "/usr/local/share/boost" | |
sudo rm -rf "$AGENT_TOOLSDIRECTORY" | |
- name: Build and push general image_scoring_plugin | |
uses: docker/build-push-action@v5 | |
with: | |
context: external_plugins/image_scoring_plugin | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
tags: tapis/image_scoring_plugin_py_3.8:${{ env.TRAPS_REL }} | |
build-args: REL=${{ env.TRAPS_REL }} | |
file: external_plugins/image_scoring_plugin/Dockerfile-3.8 | |
image_scoring_plugin_py_nano_38: | |
runs-on: ubuntu-latest | |
environment: main | |
needs: camera_traps_py_38 | |
steps: | |
- name: Set TRAPS_REL | |
run: | | |
if [[ ${{ github.event_name == 'workflow_dispatch' }} == true ]]; then | |
TRAPS_REL=${{ inputs.release_tag }} | |
elif [[ ${{ github.event_name == 'push' }} == true ]]; then | |
TRAPS_REL=latest | |
elif [[ ${{ github.event_name == 'pull_request' }} == true ]]; then | |
TRAPS_REL=latest | |
else | |
TRAPS_REL=${{ github.event.release.tag_name }} | |
fi | |
echo "TRAPS_REL=$TRAPS_REL" >> "$GITHUB_ENV" | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Delete extra files | |
run: | | |
sudo rm -rf /usr/share/dotnet | |
sudo rm -rf /opt/ghc | |
sudo rm -rf "/usr/local/share/boost" | |
sudo rm -rf "$AGENT_TOOLSDIRECTORY" | |
- name: Build and push image_scoring_plugin for nano | |
uses: docker/build-push-action@v5 | |
with: | |
context: external_plugins/image_scoring_plugin | |
platforms: linux/arm64 | |
push: true | |
tags: tapis/image_scoring_plugin_py_nano_3.8:${{ env.TRAPS_REL }} | |
build-args: REL=${{ env.TRAPS_REL }} | |
file: external_plugins/image_scoring_plugin/Dockerfile-3.8-nano | |
image_generating_plugin: | |
runs-on: ubuntu-latest | |
environment: main | |
needs: camera_traps_py | |
steps: | |
- name: Set TRAPS_REL | |
run: | | |
if [[ ${{ github.event_name == 'workflow_dispatch' }} == true ]]; then | |
TRAPS_REL=${{ inputs.release_tag }} | |
elif [[ ${{ github.event_name == 'push' }} == true ]]; then | |
TRAPS_REL=latest | |
elif [[ ${{ github.event_name == 'pull_request' }} == true ]]; then | |
TRAPS_REL=latest | |
else | |
TRAPS_REL=${{ github.event.release.tag_name }} | |
fi | |
echo "TRAPS_REL=$TRAPS_REL" >> "$GITHUB_ENV" | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build and push image_generating_plugin | |
uses: docker/build-push-action@v5 | |
with: | |
context: external_plugins/image_generating_plugin | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
tags: tapis/image_generating_plugin_py:${{ env.TRAPS_REL }} | |
build-args: REL=${{ env.TRAPS_REL }} | |
power_measuring_plugin: | |
runs-on: ubuntu-latest | |
environment: main | |
needs: camera_traps_py | |
steps: | |
- name: Set TRAPS_REL | |
run: | | |
if [[ ${{ github.event_name == 'workflow_dispatch' }} == true ]]; then | |
TRAPS_REL=${{ inputs.release_tag }} | |
elif [[ ${{ github.event_name == 'push' }} == true ]]; then | |
TRAPS_REL=latest | |
elif [[ ${{ github.event_name == 'pull_request' }} == true ]]; then | |
TRAPS_REL=latest | |
else | |
TRAPS_REL=${{ github.event.release.tag_name }} | |
fi | |
echo "TRAPS_REL=$TRAPS_REL" >> "$GITHUB_ENV" | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build and push power_measuring_plugin | |
uses: docker/build-push-action@v5 | |
with: | |
context: external_plugins/power_measuring_plugin | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
tags: tapis/power_measuring_plugin_py:${{ env.TRAPS_REL }} | |
build-args: REL=${{ env.TRAPS_REL }} | |
oracle_plugin: | |
runs-on: ubuntu-latest | |
environment: main | |
needs: camera_traps_py | |
steps: | |
- name: Set TRAPS_REL | |
run: | | |
if [[ ${{ github.event_name == 'workflow_dispatch' }} == true ]]; then | |
TRAPS_REL=${{ inputs.release_tag }} | |
elif [[ ${{ github.event_name == 'push' }} == true ]]; then | |
TRAPS_REL=latest | |
elif [[ ${{ github.event_name == 'pull_request' }} == true ]]; then | |
TRAPS_REL=latest | |
else | |
TRAPS_REL=${{ github.event.release.tag_name }} | |
fi | |
echo "TRAPS_REL=$TRAPS_REL" >> "$GITHUB_ENV" | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build and push oracle_plugin | |
uses: docker/build-push-action@v5 | |
with: | |
context: external_plugins/oracle_plugin | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
tags: tapis/oracle_plugin:${{ env.TRAPS_REL }} | |
build-args: REL=${{ env.TRAPS_REL }} | |
custom_install: | |
runs-on: ubuntu-latest | |
environment: main | |
steps: | |
- name: Set TRAPS_REL | |
run: | | |
if [[ ${{ github.event_name == 'workflow_dispatch' }} == true ]]; then | |
TRAPS_REL=${{ inputs.release_tag }} | |
elif [[ ${{ github.event_name == 'push' }} == true ]]; then | |
TRAPS_REL=latest | |
elif [[ ${{ github.event_name == 'pull_request' }} == true ]]; then | |
TRAPS_REL=latest | |
else | |
TRAPS_REL=${{ github.event.release.tag_name }} | |
fi | |
echo "TRAPS_REL=$TRAPS_REL" >> "$GITHUB_ENV" | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build and push camera-traps-installer | |
uses: docker/build-push-action@v5 | |
with: | |
context: installer | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
tags: tapis/camera-traps-installer:${{ env.TRAPS_REL }} | |
build-args: REL=${{ env.TRAPS_REL }} | |
upload_testinfo: | |
runs-on: ubuntu-latest | |
environment: main | |
steps: | |
- name: Write to testinfo.txt | |
run: | | |
if [[ ${{ github.event_name == 'workflow_dispatch' }} == true ]]; then | |
TRAPS_REL=${{ inputs.release_tag }} | |
elif [[ ${{ github.event_name == 'push' }} == true ]]; then | |
TRAPS_REL=latest | |
elif [[ ${{ github.event_name == 'pull_request' }} == true ]]; then | |
TRAPS_REL=latest | |
else | |
TRAPS_REL=${{ github.event.release.tag_name }} | |
fi | |
echo "CTVER=$TRAPS_REL" >> testinfo.txt | |
- name: Upload test info | |
uses: actions/upload-artifact@v4 | |
with: | |
name: testinfo | |
path: testinfo.txt | |
trigger_tests: | |
runs-on: ubuntu-latest | |
environment: main | |
needs: [engine, image_scoring_plugin_py_38, image_scoring_plugin_py_nano_38, image_generating_plugin, power_measuring_plugin, oracle_plugin, custom_install] | |
steps: | |
- name: Check if tests are disabled | |
run: | | |
if [[ ${{ github.event_name == 'workflow_dispatch' }} == false ]] | |
then | |
echo "Tests are disabled" | |
exit 1 | |
fi |