Skip to content

Commit

Permalink
CI: login to dockerhub on aarch64 runners (#29915)
Browse files Browse the repository at this point in the history
* DOCKER_HUB_LOGIN command

* Add docker creds

* checkout runner name

* test again

* Use runner.name to distinguish between buildjet and GH runners
  • Loading branch information
fredyshox authored Sep 15, 2023
1 parent 9dfd057 commit c9ec7bc
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/prebuilt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
workflow_dispatch:

env:
DOCKER_LOGIN: docker login ghcr.io -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }}
DOCKER_GHCR_LOGIN: docker login ghcr.io -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }}
BUILD: selfdrive/test/docker_build.sh prebuilt

jobs:
Expand All @@ -29,5 +29,5 @@ jobs:
submodules: true
- name: Build and Push docker image
run: |
$DOCKER_LOGIN
$DOCKER_GHCR_LOGIN
eval "$BUILD"
17 changes: 14 additions & 3 deletions .github/workflows/selfdrive_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ env:
CL_BASE_IMAGE: openpilot-base-cl
AZURE_TOKEN: ${{ secrets.AZURE_COMMADATACI_OPENPILOTCI_TOKEN }}

DOCKER_LOGIN: docker login ghcr.io -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }}
DOCKER_GHCR_LOGIN: docker login ghcr.io -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }}
DOCKER_HUB_LOGIN: docker login -u adeebshihadeh -p ${{ secrets.DOCKER_HUB_PAT }}
BUILD: selfdrive/test/docker_build.sh base

RUN: docker run --shm-size 1G -v $PWD:/tmp/openpilot -w /tmp/openpilot -e PYTHONWARNINGS=error -e FILEREADER_CACHE=1 -e PYTHONPATH=/tmp/openpilot -e NUM_JOBS -e JOB_ID -e GITHUB_ACTION -e GITHUB_REF -e GITHUB_HEAD_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_RUN_ID -v $GITHUB_WORKSPACE/.ci_cache/scons_cache:/tmp/scons_cache -v $GITHUB_WORKSPACE/.ci_cache/comma_download_cache:/tmp/comma_download_cache -v $GITHUB_WORKSPACE/.ci_cache/openpilot_cache:/tmp/openpilot_cache $BASE_IMAGE /bin/sh -c
Expand Down Expand Up @@ -76,6 +77,11 @@ jobs:
- uses: actions/checkout@v3
with:
submodules: true
# login only on arm machines, due to buildjet rate limits
- name: Setup docker
if: contains(runner.name, 'buildjet')
run: |
$DOCKER_HUB_LOGIN
- uses: ./.github/workflows/setup-with-retry
with:
cache_key_prefix: scons_${{ matrix.arch }}
Expand Down Expand Up @@ -190,7 +196,12 @@ jobs:
run: |
echo "PUSH_IMAGE=true" >> "$GITHUB_ENV"
echo "TARGET_ARCHITECTURE=${{ matrix.arch }}" >> "$GITHUB_ENV"
$DOCKER_LOGIN
$DOCKER_GHCR_LOGIN
# login only on arm machines, due to buildjet rate limits
- name: Additional setup for buildjet
if: contains(runner.name, 'buildjet')
run: |
$DOCKER_HUB_LOGIN
- uses: ./.github/workflows/setup-with-retry
with:
git-lfs: false
Expand All @@ -211,7 +222,7 @@ jobs:
submodules: false
- name: Setup docker
run: |
$DOCKER_LOGIN
$DOCKER_GHCR_LOGIN
- name: Merge x64 and arm64 tags
run: |
export PUSH_IMAGE=true
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/tools_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ concurrency:
env:
BASE_IMAGE: openpilot-base
CL_BASE_IMAGE: openpilot-base-cl
DOCKER_LOGIN: docker login ghcr.io -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }}
DOCKER_GHCR_LOGIN: docker login ghcr.io -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }}

BUILD: selfdrive/test/docker_build.sh base

Expand Down Expand Up @@ -58,7 +58,7 @@ jobs:
if: github.ref == 'refs/heads/master' && github.repository == 'commaai/openpilot'
run: |
echo "PUSH_IMAGE=true" >> "$GITHUB_ENV"
$DOCKER_LOGIN
$DOCKER_GHCR_LOGIN
- name: Build and push sim image
run: |
selfdrive/test/docker_build.sh sim
Expand All @@ -78,7 +78,7 @@ jobs:
if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request' && github.repository == 'commaai/openpilot'
run: |
echo "PUSH_IMAGE=true" >> "$GITHUB_ENV"
$DOCKER_LOGIN
$DOCKER_GHCR_LOGIN
- name: Build and push docs image
run: |
selfdrive/test/docker_build.sh docs
Expand Down

0 comments on commit c9ec7bc

Please sign in to comment.