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

ci: switch to github hosted runners #398

Merged
merged 15 commits into from
Mar 29, 2024
Merged
Show file tree
Hide file tree
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
21 changes: 15 additions & 6 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ env:

jobs:
build:
runs-on: ["self-hosted"]
runs-on:
- ubuntu-22.04
strategy:
matrix:
build_type: [debug, release]
Expand All @@ -57,6 +58,8 @@ jobs:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.QUAY_USER_ID }}
password: ${{ secrets.QUAY_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Checkout
uses: actions/checkout@v2
with:
Expand Down Expand Up @@ -84,7 +87,8 @@ jobs:
path: image-dev-${{ matrix.build_type }}.txt

checkstyle:
runs-on: ["self-hosted"]
runs-on:
- ubuntu-22.04
steps:
- name: Clean the workspace
uses: docker://alpine
Expand All @@ -104,7 +108,8 @@ jobs:
clang-format-version: '11'

integration:
runs-on: ["self-hosted", "hugepages"]
runs-on:
- ubuntu-22.04
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -138,7 +143,9 @@ jobs:
make retest DEV_IMAGE="${dev_image}"

e2e:
runs-on: ["self-hosted", "hugepages"]
runs-on:
- self-hosted
- hugepages
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -194,7 +201,8 @@ jobs:

# dummy job for release.yaml to wait on
conclude:
runs-on: ["self-hosted"]
runs-on:
- ubuntu-latest
needs:
- checkstyle
- integration
Expand All @@ -207,7 +215,8 @@ jobs:
slack:
needs:
- conclude
runs-on: ["self-hosted"]
runs-on:
- ubuntu-22.04
if: always()
steps:
- name: Set status
Expand Down
25 changes: 11 additions & 14 deletions hack/ci-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,14 @@ function do_build {
# --export-cache type=inline \
# --import-cache type=registry,ref="${IMAGE_BASE_NAME}" \
set -x
buildctl build \
--frontend dockerfile.v0 \
--progress=plain \
--local context=. \
--local dockerfile=. \
--opt filename="${DOCKERFILE}" \
--opt build-arg:BUILD_TYPE=${BUILD_TYPE} \
--opt build-arg:BASE=${VPP_IMAGE_BASE}_${BUILD_TYPE} \
--opt build-arg:DEVBASE=${VPP_IMAGE_BASE}_dev_${BUILD_TYPE} \
--opt label:quay.expires-after="${IMAGE_EXPIRES_AFTER}" \
"$@"
docker buildx build \
--progress plain \
--file "${DOCKERFILE}" \
--build-arg BUILD_TYPE=${BUILD_TYPE} \
--build-arg BASE=${VPP_IMAGE_BASE}_${BUILD_TYPE} \
--build-arg DEVBASE=${VPP_IMAGE_BASE}_dev_${BUILD_TYPE} \
--label "quay.expires-after=${IMAGE_EXPIRES_AFTER}" \
. "$@"
set +x
}

Expand All @@ -42,18 +39,18 @@ FINAL_IMAGE_NAME="${IMAGE_BASE_NAME}:${IMAGE_BASE_TAG}_${BUILD_TYPE}"
echo >&2 "Building VPP and extracting the artifacts ..."
rm -rf /tmp/_out
mkdir /tmp/_out
do_build --opt target=artifacts --output type=local,dest=/tmp/_out
do_build --target=artifacts --output type=local,dest=/tmp/_out

echo >&2 "Building the dev image from ${DOCKERFILE} ..."
push=",push=true"
if [[ ${NO_PUSH} ]]; then
push=""
fi
do_build --opt target=dev-stage \
do_build --target=dev-stage \
--output type="image,\"name=${DEV_IMAGE_NAME}\"${push}"

echo >&2 "Building the final image from ${DOCKERFILE} ..."
do_build --opt target=final-stage \
do_build --target=final-stage \
--output type="image,\"name=${FINAL_IMAGE_NAME}\"${push}"

echo "${DEV_IMAGE_NAME}" > "image-dev-${BUILD_TYPE}.txt"
Expand Down
Loading