Skip to content

Commit

Permalink
build-lxd: Fix runner labels
Browse files Browse the repository at this point in the history
Signed-off-by: Tobias K <[email protected]>
  • Loading branch information
theCalcaholic committed Jan 26, 2024
1 parent c2179e8 commit 550724f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 40 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ jobs:
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
# - name: Set up QEMU
# uses: docker/setup-qemu-action@v3

- name: Checkout code
uses: actions/checkout@v3
Expand Down Expand Up @@ -119,8 +119,8 @@ jobs:
echo "Previous version is '$version'"
echo "PREVIOUS_VERSION=$version" >> "$GITHUB_ENV"
echo "previous_version=${version}" >> $GITHUB_OUTPUT
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
# - name: Set up QEMU
# uses: docker/setup-qemu-action@v3

- name: Enable qemu SUID
run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes --credential yes
Expand Down Expand Up @@ -399,8 +399,8 @@ jobs:
LOG_TEST: "\\033[1;33mTEST::\\033[0m"
LOG_DIAG: "\\033[1;31mDIAG::\\033[0m"
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
# - name: Set up QEMU
# uses: docker/setup-qemu-action@v3

- name: Login to docker
run: |
Expand Down
38 changes: 8 additions & 30 deletions .github/workflows/build-lxd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
determine-runner:
env:
LXD_ARCH: "${{ inputs.arch || 'x86' }}"
runs-on: [ubuntu-latest, x64]
runs-on: ubuntu-latest
outputs:
runner_label: ${{ steps.script.outputs.runner_label }}
steps:
Expand All @@ -40,17 +40,16 @@ jobs:
run: |
if [[ "${LXD_ARCH}" == "arm64" ]]
then
RUNNER_LABEL=ubuntu-22.04,ARM64
RUNNER_LABEL='["ubuntu-20.04", "ARM64"]'
else
RUNNER_LABEL=ubuntu-22.04
RUNNER_LABEL='["ubuntu-20.04", "x64"]'
fi
echo "runner_label=$RUNNER_LABEL" | tee -a $GITHUB_OUTPUT
build-current:
needs:
- determine-runner
runs-on:
- ${{ needs.determine-runner.outputs.runner_label }}
runs-on: ${{ fromJSON(needs.determine-runner.outputs.runner_label) }}
outputs:
artifact_name: "${{ env.ARTIFACT_NAME }}"
artifact_file: "${{ steps.pack-lxd.outputs.artifact_file }}"
Expand All @@ -72,10 +71,6 @@ jobs:
run: |
sudo iptables -I DOCKER-USER -i lxdbr0 -j ACCEPT
sudo iptables -I DOCKER-USER -o lxdbr0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Enable qemu SUID
run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes --credential yes
- name: Build LXD image
run: |
./build/build-LXD.sh
Expand All @@ -94,7 +89,7 @@ jobs:
if-no-files-found: error

build-previous:
runs-on: [ubuntu-latest, x64]
runs-on: [ ubuntu-20.04, x64 ]
if: ${{ inputs.arch == 'x86' || inputs.arch == '' }}
outputs:
artifact_name: "${{ env.ARTIFACT_NAME }}"
Expand Down Expand Up @@ -144,15 +139,6 @@ jobs:
run: |
sudo iptables -I DOCKER-USER -i lxdbr0 -j ACCEPT
sudo iptables -I DOCKER-USER -o lxdbr0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Enable qemu SUID
run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes --credential yes
- name: Download qemu binaries
run: |
wget -nv https://github.com/multiarch/qemu-user-static/releases/latest/download/qemu-aarch64-static -O qemu-aarch64-static
wget -nv https://github.com/multiarch/qemu-user-static/releases/latest/download/qemu-arm-static -O qemu-arm-static
chmod +x qemu-{arm,aarch64}-static
- name: Build LXD image
run: |
Expand All @@ -174,7 +160,7 @@ jobs:
test-update:
needs:
- build-previous
runs-on: [ubuntu-latest, x64]
runs-on: [ubuntu-20.04, x64]
outputs:
artifact_name: "${{ env.ARTIFACT_NAME }}"
artifact_file: "${{ steps.pack-lxd.outputs.artifact_file }}"
Expand All @@ -189,10 +175,6 @@ jobs:
run: |
sudo iptables -I DOCKER-USER -i lxdbr0 -j ACCEPT
sudo iptables -I DOCKER-USER -o lxdbr0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Enable qemu SUID
run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes --credential yes
- name: Checkout code
uses: actions/checkout@v3
with:
Expand Down Expand Up @@ -292,7 +274,7 @@ jobs:
needs:
- determine-runner
- build-current
runs-on: ${{ needs.determine-runner.outputs.runner_label }}
runs-on: ${{ fromJSON(needs.determine-runner.outputs.runner_label) }}
env:
VERSION: "${{ inputs.git_ref || github.head_ref || github.ref_name }}"
ARTIFACT_NAME: ${{ needs.build-current.outputs.artifact_name }}
Expand All @@ -312,10 +294,6 @@ jobs:
run: |
sudo iptables -I DOCKER-USER -i lxdbr0 -j ACCEPT
sudo iptables -I DOCKER-USER -o lxdbr0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Enable qemu SUID
run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes --credential yes
- name: Setup Firefox
uses: browser-actions/setup-firefox@latest
continue-on-error: true
Expand Down Expand Up @@ -381,7 +359,7 @@ jobs:
convert-to-lxc-image:
needs:
- build-current
runs-on: [ubuntu-latest, x64]
runs-on: ubuntu-latest
outputs:
artifact_name: "${{ steps.lxd-to-lxc.outputs.artifact_name }}"
artifact_file: "${{ steps.lxd-to-lxc.outputs.artifact_file }}"
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/build-sd-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ jobs:
artifact_file: ${{ env.ARTIFACT_FILE }}
artifact_name: ${{ github.run_id }}-${{ inputs.board_id }}-image
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
# - name: Set up QEMU
# uses: docker/setup-qemu-action@v3
- name: Setup qemu-user-static
run: |
sudo apt-get update
Expand Down Expand Up @@ -144,8 +144,8 @@ jobs:
run:
shell: bash
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
# - name: Set up QEMU
# uses: docker/setup-qemu-action@v3
- name: Apt update
run: |
sudo apt-get update
Expand Down

0 comments on commit 550724f

Please sign in to comment.