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

Try BuildJet #2526

Merged
merged 5 commits into from
Feb 21, 2023
Merged
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
58 changes: 3 additions & 55 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,43 +50,16 @@ on:
required: true

jobs:
start_runner:
name: Start self-hosted EC2 runner
if: ${{ github.repository == 'FEniCS/dolfinx' }}
runs-on: ubuntu-latest
outputs:
label: ${{ steps.start-ec2-runner.outputs.label }}
ec2-instance-id: ${{ steps.start-ec2-runner.outputs.ec2-instance-id }}
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}

- name: Start EC2 runner
id: start-ec2-runner
uses: machulav/ec2-github-runner@v2
with:
mode: start
github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
ec2-image-id: ami-07529ef40e2c81086
ec2-instance-type: c6g.large
subnet-id: subnet-dc2151b7
security-group-id: sg-03fc69ee7a6ba8bc4

create_build_images:
name: Create build environment images
if: ${{ github.repository == 'FEniCS/dolfinx' }}
strategy:
matrix:
variant: ["test-env", "dev-env"]
mpi: ["openmpi", "mpich"]
os: ["ubuntu-latest", "ARM64"]
os: ["ubuntu-latest", "buildjet-2vcpu-ubuntu-2204-arm"]

runs-on: ${{ matrix.os }}
needs: start_runner
steps:
- name: Set git ref
run: |
Expand Down Expand Up @@ -116,7 +89,7 @@ jobs:
run: echo "ARCH_TAG=amd64" >> $GITHUB_ENV

- name: Set architecture tag (arm64)
if: ${{ matrix.os == 'ARM64' }}
if: ${{ contains(matrix.os, 'arm') }}
run: echo "ARCH_TAG=arm64" >> $GITHUB_ENV

- name: Create image name and tag
Expand Down Expand Up @@ -165,7 +138,6 @@ jobs:
if: ${{ github.repository == 'FEniCS/dolfinx' }}
runs-on: ubuntu-latest
needs:
- start_runner
- create_build_images

steps:
Expand Down Expand Up @@ -231,10 +203,9 @@ jobs:
- arch_tag: amd64
os: ubuntu-latest
- arch_tag: arm64
os: ARM64
os: buildjet-4vcpu-ubuntu-2204-arm
runs-on: ${{ matrix.os }}
needs:
- start_runner
- create_multiarch_build_images
steps:
- name: Create tag without image name
Expand Down Expand Up @@ -411,26 +382,3 @@ jobs:
--tag ${GH_PREFIX}/lab:${{ env.TAG }} \
${DH_PREFIX}/lab:${{ env.TAG }}-amd64 \
${DH_PREFIX}/lab:${{ env.TAG }}-arm64

stop-runner:
name: Stop self-hosted EC2 runner
# Stop the runner even if an error happened in the previous jobs
if: ${{ always() && github.repository == 'FEniCS/dolfinx' }}
needs:
- start_runner # required to get output from the start-runner job
- create_multiarch_end_user_images # required to wait when the main job is done
runs-on: ubuntu-latest
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1-node16
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}
- name: Stop EC2 runner
uses: machulav/ec2-github-runner@v2
with:
mode: stop
github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
label: ${{ needs.start_runner.outputs.label }}
ec2-instance-id: ${{ needs.start_runner.outputs.ec2-instance-id }}