Skip to content

Commit

Permalink
ci: switch to github hosted runners (#398)
Browse files Browse the repository at this point in the history
  • Loading branch information
demo-exe authored Mar 29, 2024
1 parent dfdf640 commit d15df5a
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 20 deletions.
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

0 comments on commit d15df5a

Please sign in to comment.