From 98b0139aa99e135d37ca4f5fc2dde0ea8fb395a2 Mon Sep 17 00:00:00 2001 From: Yutaka Kondo Date: Thu, 21 Nov 2024 14:10:29 +0900 Subject: [PATCH] Revert "feat: use Docker Hub instead (#134)" This reverts commit 962f34fa7a130f2bbf3eae0d03ff61baea47a7ba. --- .../docker-build-and-push-cuda/action.yaml | 20 +++++------ .../actions/docker-build-and-push/action.yaml | 34 +++++++++---------- .github/actions/docker-build/action.yaml | 10 +++--- .../docker-build-and-push-arm64.yaml | 16 ++++----- .github/workflows/docker-build-and-push.yaml | 14 ++++---- .github/workflows/health-check-arm64.yaml | 3 +- .github/workflows/health-check-nightly.yaml | 1 - .github/workflows/health-check.yaml | 1 - 8 files changed, 43 insertions(+), 56 deletions(-) diff --git a/.github/actions/docker-build-and-push-cuda/action.yaml b/.github/actions/docker-build-and-push-cuda/action.yaml index 77334ddcbd5..fc28683d892 100644 --- a/.github/actions/docker-build-and-push-cuda/action.yaml +++ b/.github/actions/docker-build-and-push-cuda/action.yaml @@ -11,9 +11,6 @@ inputs: build-args: description: Additional build args. required: false - dockerhub-token: - description: Docker Hub token. - required: true runs: using: composite @@ -71,7 +68,7 @@ runs: id: meta-base-cuda uses: docker/metadata-action@v5 with: - images: ${{ github.repository_owner }}/${{ inputs.target-image }} + images: ghcr.io/${{ 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 }} @@ -83,7 +80,7 @@ runs: id: meta-universe-sensing-perception-devel-cuda uses: docker/metadata-action@v5 with: - images: ${{ github.repository_owner }}/${{ inputs.target-image }} + images: ghcr.io/${{ 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 }} @@ -95,7 +92,7 @@ runs: id: meta-universe-sensing-perception-cuda uses: docker/metadata-action@v5 with: - images: ${{ github.repository_owner }}/${{ inputs.target-image }} + images: ghcr.io/${{ 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 }} @@ -107,7 +104,7 @@ runs: id: meta-universe-devel-cuda uses: docker/metadata-action@v5 with: - images: ${{ github.repository_owner }}/${{ inputs.target-image }} + images: ghcr.io/${{ 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 }} @@ -119,7 +116,7 @@ runs: id: meta-universe-cuda uses: docker/metadata-action@v5 with: - images: ${{ github.repository_owner }}/${{ inputs.target-image }} + images: ghcr.io/${{ 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 }} @@ -127,13 +124,14 @@ runs: flavor: | latest=auto - - name: Login to Docker Hub + - name: Login to GitHub Container Registry uses: docker/login-action@v3 with: + registry: ghcr.io username: ${{ github.repository_owner }} - password: ${{ inputs.dockerhub-token }} + password: ${{ github.token }} - - name: Build and Push to Docker Hub + - name: Build and Push to GitHub Container Registry uses: docker/bake-action@v5 with: push: true diff --git a/.github/actions/docker-build-and-push/action.yaml b/.github/actions/docker-build-and-push/action.yaml index c33d23a98fa..3e3bc857fea 100644 --- a/.github/actions/docker-build-and-push/action.yaml +++ b/.github/actions/docker-build-and-push/action.yaml @@ -11,9 +11,6 @@ inputs: build-args: description: Additional build args. required: false - dockerhub-token: - description: Docker Hub token. - required: true runs: using: composite @@ -71,7 +68,7 @@ runs: id: meta-base uses: docker/metadata-action@v5 with: - images: ${{ github.repository_owner }}/${{ inputs.target-image }} + images: ghcr.io/${{ github.repository_owner }}/${{ inputs.target-image }} tags: | type=raw,value=base-${{ inputs.platform }} type=raw,value=base-${{ steps.date.outputs.date }}-${{ inputs.platform }} @@ -83,7 +80,7 @@ runs: id: meta-core-devel uses: docker/metadata-action@v5 with: - images: ${{ github.repository_owner }}/${{ inputs.target-image }} + images: ghcr.io/${{ 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 }} @@ -95,7 +92,7 @@ runs: id: meta-universe-sensing-perception-devel uses: docker/metadata-action@v5 with: - images: ${{ github.repository_owner }}/${{ inputs.target-image }} + images: ghcr.io/${{ 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 }} @@ -107,7 +104,7 @@ runs: id: meta-universe-sensing-perception uses: docker/metadata-action@v5 with: - images: ${{ github.repository_owner }}/${{ inputs.target-image }} + images: ghcr.io/${{ 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 }} @@ -119,7 +116,7 @@ runs: id: meta-universe-localization-mapping-devel uses: docker/metadata-action@v5 with: - images: ${{ github.repository_owner }}/${{ inputs.target-image }} + images: ghcr.io/${{ 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 }} @@ -131,7 +128,7 @@ runs: id: meta-universe-localization-mapping uses: docker/metadata-action@v5 with: - images: ${{ github.repository_owner }}/${{ inputs.target-image }} + images: ghcr.io/${{ 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 }} @@ -143,7 +140,7 @@ runs: id: meta-universe-planning-control-devel uses: docker/metadata-action@v5 with: - images: ${{ github.repository_owner }}/${{ inputs.target-image }} + images: ghcr.io/${{ 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 }} @@ -155,7 +152,7 @@ runs: id: meta-universe-planning-control uses: docker/metadata-action@v5 with: - images: ${{ github.repository_owner }}/${{ inputs.target-image }} + images: ghcr.io/${{ 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 }} @@ -167,7 +164,7 @@ runs: id: meta-universe-vehicle-system-devel uses: docker/metadata-action@v5 with: - images: ${{ github.repository_owner }}/${{ inputs.target-image }} + images: ghcr.io/${{ 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 }} @@ -179,7 +176,7 @@ runs: id: meta-universe-vehicle-system uses: docker/metadata-action@v5 with: - images: ${{ github.repository_owner }}/${{ inputs.target-image }} + images: ghcr.io/${{ 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 }} @@ -191,7 +188,7 @@ runs: id: meta-universe-devel uses: docker/metadata-action@v5 with: - images: ${{ github.repository_owner }}/${{ inputs.target-image }} + images: ghcr.io/${{ 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 }} @@ -203,7 +200,7 @@ runs: id: meta-universe uses: docker/metadata-action@v5 with: - images: ${{ github.repository_owner }}/${{ inputs.target-image }} + images: ghcr.io/${{ github.repository_owner }}/${{ inputs.target-image }} tags: | type=raw,value=universe-${{ inputs.platform }} type=raw,value=universe-${{ steps.date.outputs.date }}-${{ inputs.platform }} @@ -211,13 +208,14 @@ runs: flavor: | latest=auto - - name: Login to Docker Hub + - name: Login to GitHub Container Registry uses: docker/login-action@v3 with: + registry: ghcr.io username: ${{ github.repository_owner }} - password: ${{ inputs.dockerhub-token }} + password: ${{ github.token }} - - name: Build and Push to Docker Hub + - name: Build and Push to GitHub Container Registry uses: docker/bake-action@v5 with: push: true diff --git a/.github/actions/docker-build/action.yaml b/.github/actions/docker-build/action.yaml index 8036db9626c..df338a836d0 100644 --- a/.github/actions/docker-build/action.yaml +++ b/.github/actions/docker-build/action.yaml @@ -15,9 +15,6 @@ inputs: build-args: description: Additional build args. required: false - dockerhub-token: - description: Docker Hub token. - required: true runs: using: composite @@ -96,11 +93,12 @@ runs: } skip-extraction: ${{ steps.cache-ccache.outputs.cache-hit && steps.cache-apt-get.outputs.cache-hit }} - - name: Login to Docker Hub + - name: Login to GitHub Container Registry uses: docker/login-action@v3 with: + registry: ghcr.io username: ${{ github.repository_owner }} - password: ${{ inputs.dockerhub-token }} + password: ${{ github.token }} - name: Run docker build uses: docker/build-push-action@v6 @@ -109,4 +107,4 @@ runs: context: . push: false build-args: ${{ inputs.build-args }} - cache-from: type=registry,ref=${{ github.repository }}-buildcache:${{ inputs.platform }}-${{ inputs.cache-tag-suffix }} + cache-from: type=registry,ref=ghcr.io/${{ github.repository }}-buildcache:${{ inputs.platform }}-${{ inputs.cache-tag-suffix }} diff --git a/.github/workflows/docker-build-and-push-arm64.yaml b/.github/workflows/docker-build-and-push-arm64.yaml index 7ec7c92e5a7..e6da14db8b6 100644 --- a/.github/workflows/docker-build-and-push-arm64.yaml +++ b/.github/workflows/docker-build-and-push-arm64.yaml @@ -13,7 +13,7 @@ jobs: docker-build-and-push: needs: load-env - runs-on: buildjet-8vcpu-ubuntu-2204-arm + runs-on: buildjet-16vcpu-ubuntu-2204-arm steps: - name: Check if PR author is the specific user id: author-check @@ -63,10 +63,9 @@ jobs: *.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=${{ 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 }} + *.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 - name: Show disk space if: always() @@ -111,10 +110,9 @@ jobs: *.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=${{ 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 }} + *.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 - name: Show disk space if: always() diff --git a/.github/workflows/docker-build-and-push.yaml b/.github/workflows/docker-build-and-push.yaml index 6278f954cdc..b4fcf4787e0 100644 --- a/.github/workflows/docker-build-and-push.yaml +++ b/.github/workflows/docker-build-and-push.yaml @@ -63,10 +63,9 @@ jobs: *.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=${{ 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 }} + *.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 - name: Show disk space if: always() @@ -111,10 +110,9 @@ jobs: *.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=${{ 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 }} + *.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 - name: Show disk space if: always() diff --git a/.github/workflows/health-check-arm64.yaml b/.github/workflows/health-check-arm64.yaml index cabcd249d01..ec142373121 100644 --- a/.github/workflows/health-check-arm64.yaml +++ b/.github/workflows/health-check-arm64.yaml @@ -11,7 +11,7 @@ jobs: docker-build: needs: load-env - runs-on: buildjet-8vcpu-ubuntu-2204-arm + runs-on: buildjet-16vcpu-ubuntu-2204-arm steps: # https://github.com/actions/checkout/issues/211 - name: Change permission of workspace @@ -35,7 +35,6 @@ jobs: 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() diff --git a/.github/workflows/health-check-nightly.yaml b/.github/workflows/health-check-nightly.yaml index 04832788ce1..ae79cabdeb4 100644 --- a/.github/workflows/health-check-nightly.yaml +++ b/.github/workflows/health-check-nightly.yaml @@ -51,7 +51,6 @@ jobs: ROS_DISTRO=${{ needs.load-env.outputs.rosdistro }} BASE_IMAGE=${{ needs.load-env.outputs.base_image }} LIB_DIR=x86_64 - dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }} - name: Show disk space if: always() diff --git a/.github/workflows/health-check.yaml b/.github/workflows/health-check.yaml index df9f0cce651..d65a3239cff 100644 --- a/.github/workflows/health-check.yaml +++ b/.github/workflows/health-check.yaml @@ -45,7 +45,6 @@ jobs: ROS_DISTRO=${{ needs.load-env.outputs.rosdistro }} BASE_IMAGE=${{ needs.load-env.outputs.base_image }} LIB_DIR=x86_64 - dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }} - name: Show disk space if: always()