diff --git a/.github/workflows/base_image_build.yml b/.github/workflows/base_image_build.yml index d2f7c47..749a8a9 100644 --- a/.github/workflows/base_image_build.yml +++ b/.github/workflows/base_image_build.yml @@ -26,7 +26,7 @@ jobs: steps: - name: Checkout repository # Check out the repository containing the Dockerfile and other necessary files - uses: actions/checkout@v6 + uses: actions/checkout@v7 - name: Log in to GitHub Container Registry # Log in to GitHub Container Registry using the actor and a GitHub token diff --git a/.github/workflows/licensed_image_build.yml b/.github/workflows/licensed_image_build.yml index 760a993..cbc744a 100644 --- a/.github/workflows/licensed_image_build.yml +++ b/.github/workflows/licensed_image_build.yml @@ -18,6 +18,11 @@ on: jobs: build_and_push: + + permissions: + contents: read + packages: write + strategy: fail-fast: false matrix: @@ -26,11 +31,13 @@ jobs: runner: ubuntu-latest - arch: arm64 runner: ubuntu-24.04-arm + runs-on: ${{ matrix.runner }} + steps: - name: Checkout repository # Check out the repository containing the Dockerfile and other necessary files - uses: actions/checkout@v6 + uses: actions/checkout@v7 - name: Log in to GitHub Container Registry # Log in to GitHub Container Registry using the actor and a GitHub token @@ -40,11 +47,26 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Set up Docker Buildx + # Set up Docker Buildx for building and pushing Docker images + uses: docker/setup-buildx-action@v4 + - name: Format repo slug # Format the repository slug to lowercase for use in the Docker image tags id: repo_slug run: echo "REPO_SLUG=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV + - name: Build and push Base Docker image + # Build the base Docker image using the Dockerfile in the `docker_base` directory and push it to GitHub Container Registry + uses: docker/build-push-action@v7 + with: + context: ./docker_base + push: true + tags: ghcr.io/${{ env.REPO_SLUG }}/arm-mlops-docker-base:latest-${{ matrix.arch }} + # Use GitHub Actions cache to speed up the build process + cache-from: type=gha,scope=${{ matrix.arch }} + cache-to: type=gha,mode=max,scope=${{ matrix.arch }} + - name: Pull Base Docker image # Pull the arch-specific base Docker image from GitHub Container Registry run: docker pull ghcr.io/${{ env.REPO_SLUG }}/arm-mlops-docker-base:latest-${{ matrix.arch }} diff --git a/.github/workflows/licensed_image_build_community.yml b/.github/workflows/licensed_image_build_community.yml index 5c93cb6..0e3ceb3 100644 --- a/.github/workflows/licensed_image_build_community.yml +++ b/.github/workflows/licensed_image_build_community.yml @@ -30,7 +30,7 @@ jobs: steps: - name: Checkout repository # Check out the repository containing the Dockerfile and other necessary files - uses: actions/checkout@v6 + uses: actions/checkout@v7 - name: Log in to GitHub Container Registry # Log in to GitHub Container Registry using the actor and a GitHub token diff --git a/.github/workflows/test_licensed_docker_image_amd64.yml b/.github/workflows/test_licensed_docker_image_amd64.yml index e464d14..29c76f2 100644 --- a/.github/workflows/test_licensed_docker_image_amd64.yml +++ b/.github/workflows/test_licensed_docker_image_amd64.yml @@ -86,12 +86,9 @@ jobs: if: ${{ github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' }} runs-on: ubuntu-latest - env: - DOCKER_IMAGE: ghcr.io/arm-software/avh-mlops/arm-mlops-docker-licensed:latest-amd64 - steps: - name: Checkout repository - uses: actions/checkout@v6 + uses: actions/checkout@v7 - name: Log in to GitHub Container Registry uses: docker/login-action@v4 @@ -100,8 +97,23 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Format repo slug + # Format the repository slug to lowercase for use in the Docker image tags + id: repo_slug + run: echo "REPO_SLUG=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV + + - name: Define Licensed Docker image (amd64) + run: | + echo "DOCKER_IMAGE=$(echo ghcr.io/${{ env.REPO_SLUG }}/arm-mlops-docker-licensed:latest-amd64)" >> $GITHUB_ENV + + - name: Show variables + run: | + echo "REPO_SLUG=${{ env.REPO_SLUG }}" + echo "DOCKER_IMAGE=${{ env.DOCKER_IMAGE }}" + - name: Pull Licensed Docker image (amd64) - run: docker pull ${{ env.DOCKER_IMAGE }} + run: | + docker pull ${{ env.DOCKER_IMAGE }} - name: Start Docker container run: | diff --git a/.github/workflows/test_licensed_docker_image_arm64.yml b/.github/workflows/test_licensed_docker_image_arm64.yml index 57b554b..7110c3c 100644 --- a/.github/workflows/test_licensed_docker_image_arm64.yml +++ b/.github/workflows/test_licensed_docker_image_arm64.yml @@ -86,12 +86,9 @@ jobs: if: ${{ github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' }} runs-on: ubuntu-24.04-arm - env: - DOCKER_IMAGE: ghcr.io/arm-software/avh-mlops/arm-mlops-docker-licensed:latest-arm64 - steps: - name: Checkout repository - uses: actions/checkout@v6 + uses: actions/checkout@v7 - name: Log in to GitHub Container Registry uses: docker/login-action@v4 @@ -100,8 +97,23 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Pull Licensed Docker image (arm64) - run: docker pull ${{ env.DOCKER_IMAGE }} + - name: Format repo slug + # Format the repository slug to lowercase for use in the Docker image tags + id: repo_slug + run: echo "REPO_SLUG=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV + + - name: Define Licensed Docker image (arm64) + run: | + echo "DOCKER_IMAGE=$(echo ghcr.io/${{ env.REPO_SLUG }}/arm-mlops-docker-licensed:latest-arm64)" >> $GITHUB_ENV + + - name: Show variables + run: | + echo "REPO_SLUG=${{ env.REPO_SLUG }}" + echo "DOCKER_IMAGE=${{ env.DOCKER_IMAGE }}" + + - name: Pull Licensed Docker image (amd64) + run: | + docker pull ${{ env.DOCKER_IMAGE }} - name: Start Docker container run: |