Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: revert "revert "use Docker Hub instead (#134)"" #146

Merged
merged 5 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions .github/actions/docker-build-and-push-base/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,19 @@ inputs:
build-args:
description: Additional build args.
required: false
dockerhub-token:
description: Docker Hub token.
required: true

runs:
using: composite
steps:
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ github.repository_owner }}
password: ${{ inputs.dockerhub-token }}

- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3

Expand All @@ -24,7 +33,7 @@ runs:
id: meta-base
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository_owner }}/${{ inputs.target-image }}
images: ${{ github.repository_owner }}/${{ inputs.target-image }}
tags: |
type=raw,value=${{ steps.date.outputs.date }}
bake-target: docker-metadata-action-base
Expand All @@ -35,21 +44,14 @@ runs:
id: meta-base-cuda
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository_owner }}/${{ inputs.target-image }}
images: ${{ github.repository_owner }}/${{ inputs.target-image }}
tags: |
type=raw,value=cuda-latest
type=raw,value=cuda-${{ steps.date.outputs.date }}
bake-target: docker-metadata-action-base-cuda
flavor: |
latest=false

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ github.token }}

- name: Build and Push to GitHub Container Registry
uses: docker/bake-action@v5
with:
Expand Down
28 changes: 15 additions & 13 deletions .github/actions/docker-build-and-push-cuda/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,19 @@ inputs:
build-args:
description: Additional build args.
required: false
dockerhub-token:
description: Docker Hub token.
required: true

runs:
using: composite
steps:
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ github.repository_owner }}
password: ${{ inputs.dockerhub-token }}

- name: Install jq and vcstool
run: |
sudo apt-get -y update
Expand Down Expand Up @@ -68,7 +77,7 @@ runs:
id: meta-base-cuda
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository_owner }}/${{ inputs.target-image }}
images: ${{ github.repository_owner }}/${{ inputs.target-image }}
tags: |
type=raw,value=base-cuda-${{ inputs.platform }}
type=raw,value=base-cuda-${{ steps.date.outputs.date }}-${{ inputs.platform }}
Expand All @@ -80,7 +89,7 @@ runs:
id: meta-universe-sensing-perception-devel-cuda
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository_owner }}/${{ inputs.target-image }}
images: ${{ github.repository_owner }}/${{ inputs.target-image }}
tags: |
type=raw,value=universe-sensing-perception-devel-cuda-${{ inputs.platform }}
type=raw,value=universe-sensing-perception-devel-cuda-${{ steps.date.outputs.date }}-${{ inputs.platform }}
Expand All @@ -92,7 +101,7 @@ runs:
id: meta-universe-sensing-perception-cuda
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository_owner }}/${{ inputs.target-image }}
images: ${{ github.repository_owner }}/${{ inputs.target-image }}
tags: |
type=raw,value=universe-sensing-perception-cuda-${{ inputs.platform }}
type=raw,value=universe-sensing-perception-cuda-${{ steps.date.outputs.date }}-${{ inputs.platform }}
Expand All @@ -104,7 +113,7 @@ runs:
id: meta-universe-devel-cuda
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository_owner }}/${{ inputs.target-image }}
images: ${{ github.repository_owner }}/${{ inputs.target-image }}
tags: |
type=raw,value=universe-devel-cuda-${{ inputs.platform }}
type=raw,value=universe-devel-cuda-${{ steps.date.outputs.date }}-${{ inputs.platform }}
Expand All @@ -116,22 +125,15 @@ runs:
id: meta-universe-cuda
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository_owner }}/${{ inputs.target-image }}
images: ${{ github.repository_owner }}/${{ inputs.target-image }}
tags: |
type=raw,value=universe-cuda-${{ inputs.platform }}
type=raw,value=universe-cuda-${{ steps.date.outputs.date }}-${{ inputs.platform }}
bake-target: docker-metadata-action-universe-cuda
flavor: |
latest=auto

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ github.token }}

- name: Build and Push to GitHub Container Registry
- name: Build and Push to Docker Hub
uses: docker/bake-action@v5
with:
push: true
Expand Down
42 changes: 22 additions & 20 deletions .github/actions/docker-build-and-push/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,19 @@ inputs:
build-args:
description: Additional build args.
required: false
dockerhub-token:
description: Docker Hub token.
required: true

runs:
using: composite
steps:
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ github.repository_owner }}
password: ${{ inputs.dockerhub-token }}

- name: Install jq and vcstool
run: |
sudo apt-get -y update
Expand Down Expand Up @@ -68,7 +77,7 @@ runs:
id: meta-base
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository_owner }}/${{ inputs.target-image }}
images: ${{ github.repository_owner }}/${{ inputs.target-image }}
tags: |
type=raw,value=base-${{ inputs.platform }}
type=raw,value=base-${{ steps.date.outputs.date }}-${{ inputs.platform }}
Expand All @@ -80,7 +89,7 @@ runs:
id: meta-core-devel
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository_owner }}/${{ inputs.target-image }}
images: ${{ github.repository_owner }}/${{ inputs.target-image }}
tags: |
type=raw,value=core-devel-${{ inputs.platform }}
type=raw,value=core-devel-${{ steps.date.outputs.date }}-${{ inputs.platform }}
Expand All @@ -92,7 +101,7 @@ runs:
id: meta-universe-sensing-perception-devel
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository_owner }}/${{ inputs.target-image }}
images: ${{ github.repository_owner }}/${{ inputs.target-image }}
tags: |
type=raw,value=universe-sensing-perception-devel-${{ inputs.platform }}
type=raw,value=universe-sensing-perception-devel-${{ steps.date.outputs.date }}-${{ inputs.platform }}
Expand All @@ -104,7 +113,7 @@ runs:
id: meta-universe-sensing-perception
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository_owner }}/${{ inputs.target-image }}
images: ${{ github.repository_owner }}/${{ inputs.target-image }}
tags: |
type=raw,value=universe-sensing-perception-${{ inputs.platform }}
type=raw,value=universe-sensing-perception-${{ steps.date.outputs.date }}-${{ inputs.platform }}
Expand All @@ -116,7 +125,7 @@ runs:
id: meta-universe-localization-mapping-devel
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository_owner }}/${{ inputs.target-image }}
images: ${{ github.repository_owner }}/${{ inputs.target-image }}
tags: |
type=raw,value=universe-localization-mapping-devel-${{ inputs.platform }}
type=raw,value=universe-localization-mapping-devel-${{ steps.date.outputs.date }}-${{ inputs.platform }}
Expand All @@ -128,7 +137,7 @@ runs:
id: meta-universe-localization-mapping
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository_owner }}/${{ inputs.target-image }}
images: ${{ github.repository_owner }}/${{ inputs.target-image }}
tags: |
type=raw,value=universe-localization-mapping-${{ inputs.platform }}
type=raw,value=universe-localization-mapping-${{ steps.date.outputs.date }}-${{ inputs.platform }}
Expand All @@ -140,7 +149,7 @@ runs:
id: meta-universe-planning-control-devel
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository_owner }}/${{ inputs.target-image }}
images: ${{ github.repository_owner }}/${{ inputs.target-image }}
tags: |
type=raw,value=universe-planning-control-devel-${{ inputs.platform }}
type=raw,value=universe-planning-control-devel-${{ steps.date.outputs.date }}-${{ inputs.platform }}
Expand All @@ -152,7 +161,7 @@ runs:
id: meta-universe-planning-control
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository_owner }}/${{ inputs.target-image }}
images: ${{ github.repository_owner }}/${{ inputs.target-image }}
tags: |
type=raw,value=universe-planning-control-${{ inputs.platform }}
type=raw,value=universe-planning-control-${{ steps.date.outputs.date }}-${{ inputs.platform }}
Expand All @@ -164,7 +173,7 @@ runs:
id: meta-universe-vehicle-system-devel
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository_owner }}/${{ inputs.target-image }}
images: ${{ github.repository_owner }}/${{ inputs.target-image }}
tags: |
type=raw,value=universe-vehicle-system-devel-${{ inputs.platform }}
type=raw,value=universe-vehicle-system-devel-${{ steps.date.outputs.date }}-${{ inputs.platform }}
Expand All @@ -176,7 +185,7 @@ runs:
id: meta-universe-vehicle-system
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository_owner }}/${{ inputs.target-image }}
images: ${{ github.repository_owner }}/${{ inputs.target-image }}
tags: |
type=raw,value=universe-vehicle-system-${{ inputs.platform }}
type=raw,value=universe-vehicle-system-${{ steps.date.outputs.date }}-${{ inputs.platform }}
Expand All @@ -188,7 +197,7 @@ runs:
id: meta-universe-devel
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository_owner }}/${{ inputs.target-image }}
images: ${{ github.repository_owner }}/${{ inputs.target-image }}
tags: |
type=raw,value=universe-devel-${{ inputs.platform }}
type=raw,value=universe-devel-${{ steps.date.outputs.date }}-${{ inputs.platform }}
Expand All @@ -200,22 +209,15 @@ runs:
id: meta-universe
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository_owner }}/${{ inputs.target-image }}
images: ${{ github.repository_owner }}/${{ inputs.target-image }}
tags: |
type=raw,value=universe-${{ inputs.platform }}
type=raw,value=universe-${{ steps.date.outputs.date }}-${{ inputs.platform }}
bake-target: docker-metadata-action-universe
flavor: |
latest=auto

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ github.token }}

- name: Build and Push to GitHub Container Registry
- name: Build and Push to Docker Hub
uses: docker/bake-action@v5
with:
push: true
Expand Down
18 changes: 10 additions & 8 deletions .github/actions/docker-build/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,19 @@ inputs:
build-args:
description: Additional build args.
required: false
dockerhub-token:
description: Docker Hub token.
required: true

runs:
using: composite
steps:
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ github.repository_owner }}
password: ${{ inputs.dockerhub-token }}

- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3

Expand Down Expand Up @@ -93,18 +102,11 @@ runs:
}
skip-extraction: ${{ steps.cache-ccache.outputs.cache-hit && steps.cache-apt-get.outputs.cache-hit }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ github.token }}

- name: Run docker build
uses: docker/build-push-action@v6
with:
file: docker/Dockerfile
context: .
push: false
build-args: ${{ inputs.build-args }}
cache-from: type=registry,ref=ghcr.io/${{ github.repository }}-buildcache:${{ inputs.platform }}-${{ inputs.cache-tag-suffix }}
cache-from: type=registry,ref=${{ github.repository }}-buildcache:${{ inputs.platform }}-${{ inputs.cache-tag-suffix }}
2 changes: 2 additions & 0 deletions .github/workflows/autoware-base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
*.platform=linux/amd64
*.args.ROS_DISTRO=${{ needs.load-env.outputs.rosdistro }}
*.args.BASE_IMAGE=${{ needs.load-env.outputs.base_image }}
dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }}

autoware-base-arm64:
needs: [load-env, autoware-base-amd64]
Expand All @@ -49,3 +50,4 @@ jobs:
*.platform=linux/arm64
*.args.ROS_DISTRO=${{ needs.load-env.outputs.rosdistro }}
*.args.BASE_IMAGE=${{ needs.load-env.outputs.base_image }}
dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }}
14 changes: 8 additions & 6 deletions .github/workflows/docker-build-and-push-arm64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

docker-build-and-push:
needs: load-env
runs-on: buildjet-16vcpu-ubuntu-2204-arm

Check warning on line 16 in .github/workflows/docker-build-and-push-arm64.yaml

View workflow job for this annotation

GitHub Actions / spell-check-differential

Unknown word (buildjet)

Check warning on line 16 in .github/workflows/docker-build-and-push-arm64.yaml

View workflow job for this annotation

GitHub Actions / spell-check-differential

Unknown word (vcpu)
steps:
- name: Check if PR author is the specific user
id: author-check
Expand Down Expand Up @@ -63,9 +63,10 @@
*.args.ROS_DISTRO=${{ needs.load-env.outputs.rosdistro }}
*.args.BASE_IMAGE=${{ needs.load-env.outputs.base_image }}
*.args.LIB_DIR=aarch64
*.cache-from=type=registry,ref=ghcr.io/${{ github.repository }}-buildcache:arm64-${{ github.ref_name }}
*.cache-from=type=registry,ref=ghcr.io/${{ github.repository }}-buildcache:arm64-main
*.cache-to=type=registry,ref=ghcr.io/${{ github.repository }}-buildcache:arm64-${{ github.ref_name }},mode=max
*.cache-from=type=registry,ref=${{ github.repository }}-buildcache:arm64-${{ github.ref_name }}
*.cache-from=type=registry,ref=${{ github.repository }}-buildcache:arm64-main
*.cache-to=type=registry,ref=${{ github.repository }}-buildcache:arm64-${{ github.ref_name }},mode=max
dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Show disk space
if: always()
Expand All @@ -74,7 +75,7 @@

docker-build-and-push-cuda:
needs: [load-env, docker-build-and-push]
runs-on: buildjet-16vcpu-ubuntu-2204-arm

Check warning on line 78 in .github/workflows/docker-build-and-push-arm64.yaml

View workflow job for this annotation

GitHub Actions / spell-check-differential

Unknown word (buildjet)

Check warning on line 78 in .github/workflows/docker-build-and-push-arm64.yaml

View workflow job for this annotation

GitHub Actions / spell-check-differential

Unknown word (vcpu)
steps:
- name: Check out repository
uses: actions/checkout@v4
Expand Down Expand Up @@ -110,9 +111,10 @@
*.args.ROS_DISTRO=${{ needs.load-env.outputs.rosdistro }}
*.args.BASE_IMAGE=${{ needs.load-env.outputs.base_image }}
*.args.LIB_DIR=aarch64
*.cache-from=type=registry,ref=ghcr.io/${{ github.repository }}-buildcache:arm64-${{ github.ref_name }}
*.cache-from=type=registry,ref=ghcr.io/${{ github.repository }}-buildcache:arm64-main
*.cache-to=type=registry,ref=ghcr.io/${{ github.repository }}-buildcache:arm64-${{ github.ref_name }},mode=max
*.cache-from=type=registry,ref=${{ github.repository }}-buildcache:arm64-${{ github.ref_name }}
*.cache-from=type=registry,ref=${{ github.repository }}-buildcache:arm64-main
*.cache-to=type=registry,ref=${{ github.repository }}-buildcache:arm64-${{ github.ref_name }},mode=max
dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Show disk space
if: always()
Expand Down
14 changes: 8 additions & 6 deletions .github/workflows/docker-build-and-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

docker-build-and-push:
needs: load-env
runs-on: buildjet-16vcpu-ubuntu-2204

Check warning on line 16 in .github/workflows/docker-build-and-push.yaml

View workflow job for this annotation

GitHub Actions / spell-check-differential

Unknown word (buildjet)

Check warning on line 16 in .github/workflows/docker-build-and-push.yaml

View workflow job for this annotation

GitHub Actions / spell-check-differential

Unknown word (vcpu)
steps:
- name: Check if PR author is the specific user
id: author-check
Expand Down Expand Up @@ -63,9 +63,10 @@
*.args.ROS_DISTRO=${{ needs.load-env.outputs.rosdistro }}
*.args.BASE_IMAGE=${{ needs.load-env.outputs.base_image }}
*.args.LIB_DIR=x86_64
*.cache-from=type=registry,ref=ghcr.io/${{ github.repository }}-buildcache:amd64-${{ github.ref_name }}
*.cache-from=type=registry,ref=ghcr.io/${{ github.repository }}-buildcache:amd64-main
*.cache-to=type=registry,ref=ghcr.io/${{ github.repository }}-buildcache:amd64-${{ github.ref_name }},mode=max
*.cache-from=type=registry,ref=${{ github.repository }}-buildcache:amd64-${{ github.ref_name }}
*.cache-from=type=registry,ref=${{ github.repository }}-buildcache:amd64-main
*.cache-to=type=registry,ref=${{ github.repository }}-buildcache:amd64-${{ github.ref_name }},mode=max
dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Show disk space
if: always()
Expand All @@ -74,7 +75,7 @@

docker-build-and-push-cuda:
needs: [load-env, docker-build-and-push]
runs-on: buildjet-16vcpu-ubuntu-2204

Check warning on line 78 in .github/workflows/docker-build-and-push.yaml

View workflow job for this annotation

GitHub Actions / spell-check-differential

Unknown word (buildjet)

Check warning on line 78 in .github/workflows/docker-build-and-push.yaml

View workflow job for this annotation

GitHub Actions / spell-check-differential

Unknown word (vcpu)
steps:
- name: Check out repository
uses: actions/checkout@v4
Expand Down Expand Up @@ -110,9 +111,10 @@
*.args.ROS_DISTRO=${{ needs.load-env.outputs.rosdistro }}
*.args.BASE_IMAGE=${{ needs.load-env.outputs.base_image }}
*.args.LIB_DIR=x86_64
*.cache-from=type=registry,ref=ghcr.io/${{ github.repository }}-buildcache:amd64-${{ github.ref_name }}
*.cache-from=type=registry,ref=ghcr.io/${{ github.repository }}-buildcache:amd64-main
*.cache-to=type=registry,ref=ghcr.io/${{ github.repository }}-buildcache:amd64-${{ github.ref_name }},mode=max
*.cache-from=type=registry,ref=${{ github.repository }}-buildcache:amd64-${{ github.ref_name }}
*.cache-from=type=registry,ref=${{ github.repository }}-buildcache:amd64-main
*.cache-to=type=registry,ref=${{ github.repository }}-buildcache:amd64-${{ github.ref_name }},mode=max
dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Show disk space
if: always()
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/health-check-arm64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

docker-build:
needs: load-env
runs-on: buildjet-16vcpu-ubuntu-2204-arm

Check warning on line 14 in .github/workflows/health-check-arm64.yaml

View workflow job for this annotation

GitHub Actions / spell-check-differential

Unknown word (buildjet)

Check warning on line 14 in .github/workflows/health-check-arm64.yaml

View workflow job for this annotation

GitHub Actions / spell-check-differential

Unknown word (vcpu)
steps:
# https://github.com/actions/checkout/issues/211
- name: Change permission of workspace
Expand All @@ -35,6 +35,7 @@
ROS_DISTRO=${{ needs.load-env.outputs.rosdistro }}
BASE_IMAGE=${{ needs.load-env.outputs.base_image }}
LIB_DIR=aarch64
dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Show disk space
if: always()
Expand Down
Loading
Loading