Revert "CI: use namespace.so" (#31060)

old-commit-hash: 23cbfe9eb3
chrysler-long2
Justin Newberry 1 year ago committed by GitHub
parent d792c3c5bb
commit d6922d3522
  1. 34
      .github/workflows/auto-cache-restore/action.yaml
  2. 8
      .github/workflows/compile-openpilot/action.yaml
  3. 17
      .github/workflows/selfdrive_tests.yaml
  4. 7
      .github/workflows/setup-with-retry/action.yaml
  5. 25
      .github/workflows/setup/action.yaml
  6. 2
      .github/workflows/tools_tests.yaml

@ -1,34 +0,0 @@
name: 'automatically cache based on current runner'
inputs:
path:
description: 'path to cache'
required: true
key:
description: 'key'
required: true
restore-keys:
description: 'restore-keys'
required: true
runs:
using: "composite"
steps:
- name: setup namespace cache
if: ${{ contains(runner.name, 'nsc') }}
uses: namespacelabs/nscloud-cache-action@v1
with:
path: ${{ inputs.path }}
- name: setup github cache
if: ${{ !contains(runner.name, 'nsc') }}
uses: actions/cache/restore@v3
with:
path: ${{ inputs.path }}
key: ${{ inputs.key }}
restore-keys: ${{ inputs.restore-keys }}
# make the directory manually in case we didn't get a hit, so it doesn't fail on future steps
- id: scons-cache-setup
shell: bash
run: mkdir -p ${{ inputs.path }}

@ -1,5 +1,11 @@
name: 'compile openpilot' name: 'compile openpilot'
inputs:
cache_key_prefix:
description: 'Prefix for caching key'
required: false
default: 'scons'
runs: runs:
using: "composite" using: "composite"
steps: steps:
@ -18,4 +24,4 @@ runs:
if: github.ref == 'refs/heads/master' if: github.ref == 'refs/heads/master'
with: with:
path: .ci_cache/scons_cache path: .ci_cache/scons_cache
key: scons-${{ runner.arch }}-${{ env.CACHE_COMMIT_DATE }}-${{ github.sha }} key: ${{ inputs.cache_key_prefix }}-${{ env.CACHE_COMMIT_DATE }}-${{ github.sha }}

@ -75,7 +75,7 @@ jobs:
((github.repository == 'commaai/openpilot') && ((github.repository == 'commaai/openpilot') &&
((github.event_name != 'pull_request') || ((github.event_name != 'pull_request') ||
(github.event.pull_request.head.repo.full_name == 'commaai/openpilot'))) && '["x86_64", "aarch64"]' || '["x86_64"]' ) }} (github.event.pull_request.head.repo.full_name == 'commaai/openpilot'))) && '["x86_64", "aarch64"]' || '["x86_64"]' ) }}
runs-on: ${{ (matrix.arch == 'aarch64') && 'namespace-profile-arm64-2x8' || 'ubuntu-20.04' }} runs-on: ${{ (matrix.arch == 'aarch64') && 'buildjet-2vcpu-ubuntu-2204-arm' || 'ubuntu-20.04' }}
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with: with:
@ -83,15 +83,18 @@ jobs:
- uses: ./.github/workflows/setup-with-retry - uses: ./.github/workflows/setup-with-retry
with: with:
docker_hub_pat: ${{ secrets.DOCKER_HUB_PAT }} docker_hub_pat: ${{ secrets.DOCKER_HUB_PAT }}
cache_key_prefix: scons_${{ matrix.arch }}
- uses: ./.github/workflows/compile-openpilot - uses: ./.github/workflows/compile-openpilot
timeout-minutes: ${{ ((steps.restore-scons-cache.outputs.cache-hit == 'true') && 15 || 30) }} # allow more time when we missed the scons cache timeout-minutes: ${{ ((steps.restore-scons-cache.outputs.cache-hit == 'true') && 15 || 30) }} # allow more time when we missed the scons cache
with:
cache_key_prefix: scons_${{ matrix.arch }}
docker_push: docker_push:
name: docker push name: docker push
strategy: strategy:
matrix: matrix:
arch: ${{ fromJson( (github.repository == 'commaai/openpilot') && '["x86_64", "aarch64"]' || '["x86_64"]' ) }} arch: ${{ fromJson( (github.repository == 'commaai/openpilot') && '["x86_64", "aarch64"]' || '["x86_64"]' ) }}
runs-on: ${{ (matrix.arch == 'aarch64') && 'namespace-profile-arm64-2x8' || 'ubuntu-20.04' }} runs-on: ${{ (matrix.arch == 'aarch64') && 'buildjet-2vcpu-ubuntu-2204-arm' || 'ubuntu-20.04' }}
if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request' && github.repository == 'commaai/openpilot' if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request' && github.repository == 'commaai/openpilot'
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
@ -130,9 +133,7 @@ jobs:
static_analysis: static_analysis:
name: static analysis name: static analysis
runs-on: ${{ ((github.repository == 'commaai/openpilot') && runs-on: ubuntu-20.04
((github.event_name != 'pull_request') ||
(github.event.pull_request.head.repo.full_name == 'commaai/openpilot'))) && 'namespace-profile-amd64-8x16' || 'ubuntu-20.04' }}
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with: with:
@ -164,7 +165,7 @@ jobs:
name: unit tests name: unit tests
runs-on: ${{ ((github.repository == 'commaai/openpilot') && runs-on: ${{ ((github.repository == 'commaai/openpilot') &&
((github.event_name != 'pull_request') || ((github.event_name != 'pull_request') ||
(github.event.pull_request.head.repo.full_name == 'commaai/openpilot'))) && 'namespace-profile-amd64-8x16' || 'ubuntu-20.04' }} (github.event.pull_request.head.repo.full_name == 'commaai/openpilot'))) && 'buildjet-8vcpu-ubuntu-2004' || 'ubuntu-20.04' }}
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with: with:
@ -180,7 +181,7 @@ jobs:
run: | run: |
${{ env.RUN }} "source selfdrive/test/setup_xvfb.sh && \ ${{ env.RUN }} "source selfdrive/test/setup_xvfb.sh && \
export MAPBOX_TOKEN='pk.eyJ1Ijoiam5ld2IiLCJhIjoiY2xxNW8zZXprMGw1ZzJwbzZneHd2NHljbSJ9.gV7VPRfbXFetD-1OVF0XZg' && \ export MAPBOX_TOKEN='pk.eyJ1Ijoiam5ld2IiLCJhIjoiY2xxNW8zZXprMGw1ZzJwbzZneHd2NHljbSJ9.gV7VPRfbXFetD-1OVF0XZg' && \
$PYTEST --timeout 40 -m 'not slow' -n $(nproc) && \ $PYTEST --timeout 40 -m 'not slow' && \
./selfdrive/ui/tests/create_test_translations.sh && \ ./selfdrive/ui/tests/create_test_translations.sh && \
QT_QPA_PLATFORM=offscreen ./selfdrive/ui/tests/test_translations && \ QT_QPA_PLATFORM=offscreen ./selfdrive/ui/tests/test_translations && \
./selfdrive/ui/tests/test_translations.py" ./selfdrive/ui/tests/test_translations.py"
@ -195,7 +196,7 @@ jobs:
name: process replay name: process replay
runs-on: ${{ ((github.repository == 'commaai/openpilot') && runs-on: ${{ ((github.repository == 'commaai/openpilot') &&
((github.event_name != 'pull_request') || ((github.event_name != 'pull_request') ||
(github.event.pull_request.head.repo.full_name == 'commaai/openpilot'))) && 'namespace-profile-amd64-8x16' || 'ubuntu-20.04' }} (github.event.pull_request.head.repo.full_name == 'commaai/openpilot'))) && 'buildjet-8vcpu-ubuntu-2004' || 'ubuntu-20.04' }}
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with: with:

@ -5,6 +5,10 @@ inputs:
description: 'Auth token for Docker Hub, required for BuildJet jobs' description: 'Auth token for Docker Hub, required for BuildJet jobs'
required: false required: false
default: '' default: ''
cache_key_prefix:
description: 'Prefix for caching key'
required: false
default: 'scons_x86_64'
sleep_time: sleep_time:
description: 'Time to sleep between retries' description: 'Time to sleep between retries'
required: false required: false
@ -18,6 +22,7 @@ runs:
continue-on-error: true continue-on-error: true
with: with:
docker_hub_pat: ${{ inputs.docker_hub_pat }} docker_hub_pat: ${{ inputs.docker_hub_pat }}
cache_key_prefix: ${{ inputs.cache_key_prefix }}
is_retried: true is_retried: true
- if: steps.setup1.outcome == 'failure' - if: steps.setup1.outcome == 'failure'
shell: bash shell: bash
@ -28,6 +33,7 @@ runs:
continue-on-error: true continue-on-error: true
with: with:
docker_hub_pat: ${{ inputs.docker_hub_pat }} docker_hub_pat: ${{ inputs.docker_hub_pat }}
cache_key_prefix: ${{ inputs.cache_key_prefix }}
is_retried: true is_retried: true
- if: steps.setup2.outcome == 'failure' - if: steps.setup2.outcome == 'failure'
shell: bash shell: bash
@ -37,4 +43,5 @@ runs:
uses: ./.github/workflows/setup uses: ./.github/workflows/setup
with: with:
docker_hub_pat: ${{ inputs.docker_hub_pat }} docker_hub_pat: ${{ inputs.docker_hub_pat }}
cache_key_prefix: ${{ inputs.cache_key_prefix }}
is_retried: true is_retried: true

@ -5,6 +5,10 @@ inputs:
description: 'Auth token for Docker Hub, required for BuildJet jobs' description: 'Auth token for Docker Hub, required for BuildJet jobs'
required: true required: true
default: '' default: ''
cache_key_prefix:
description: 'Prefix for caching key'
required: true
default: 'scons_x86_64'
is_retried: is_retried:
description: 'A mock param that asserts that we use the setup-with-retry instead of this action directly' description: 'A mock param that asserts that we use the setup-with-retry instead of this action directly'
required: false required: false
@ -43,14 +47,19 @@ runs:
run: echo "CACHE_COMMIT_DATE=$(git log -1 --pretty='format:%cd' --date=format:'%Y-%m-%d-%H:%M')" >> $GITHUB_ENV run: echo "CACHE_COMMIT_DATE=$(git log -1 --pretty='format:%cd' --date=format:'%Y-%m-%d-%H:%M')" >> $GITHUB_ENV
- shell: bash - shell: bash
run: echo "$CACHE_COMMIT_DATE" run: echo "$CACHE_COMMIT_DATE"
- id: scons-cache - id: restore-scons-cache
uses: ./.github/workflows/auto-cache-restore uses: actions/cache/restore@v3
with: with:
path: .ci_cache/scons_cache path: .ci_cache/scons_cache
key: scons-${{ runner.arch }}-${{ env.CACHE_COMMIT_DATE }}-${{ github.sha }} key: ${{ inputs.cache_key_prefix }}-${{ env.CACHE_COMMIT_DATE }}-${{ github.sha }}
restore-keys: | restore-keys: |
scons-${{ runner.arch }}-${{ env.CACHE_COMMIT_DATE }} ${{ inputs.cache_key_prefix }}-${{ env.CACHE_COMMIT_DATE }}-
scons-${{ runner.arch }} ${{ inputs.cache_key_prefix }}-
# if we didn't get a cache hit, make the directory manually so it doesn't fail on future steps
- id: scons-cache-setup
shell: bash
if: steps.restore-scons-cache.outputs.cache-hit != 'true'
run: mkdir -p $GITHUB_WORKSPACE/.ci_cache/scons_cache
# as suggested here: https://github.com/moby/moby/issues/32816#issuecomment-910030001 # as suggested here: https://github.com/moby/moby/issues/32816#issuecomment-910030001
- id: normalize-file-permissions - id: normalize-file-permissions
shell: bash shell: bash
@ -58,6 +67,12 @@ runs:
run: | run: |
find . -type f -executable -not -perm 755 -exec chmod 755 {} \; find . -type f -executable -not -perm 755 -exec chmod 755 {} \;
find . -type f -not -executable -not -perm 644 -exec chmod 644 {} \; find . -type f -not -executable -not -perm 644 -exec chmod 644 {} \;
- id: setup-buildx-action
if: contains(runner.name, 'buildjet')
name: Set up Docker Buildx on buildjet to ensure a consistent cache
uses: docker/setup-buildx-action@v2
with:
driver: docker-container
# build our docker image # build our docker image
- shell: bash - shell: bash
run: eval ${{ env.BUILD }} run: eval ${{ env.BUILD }}

@ -81,7 +81,7 @@ jobs:
- name: Run dev container - name: Run dev container
run: | run: |
mkdir -p /tmp/devcontainer_scons_cache/ mkdir -p /tmp/devcontainer_scons_cache/
cp -r $GITHUB_WORKSPACE/.ci_cache/scons_cache/. /tmp/devcontainer_scons_cache/ cp -r $GITHUB_WORKSPACE/.ci_cache/scons_cache/* /tmp/devcontainer_scons_cache/
devcontainer up --workspace-folder . devcontainer up --workspace-folder .
- name: Test environment - name: Test environment
run: | run: |

Loading…
Cancel
Save