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(buildkit): set timeout to image job #4489

Merged
merged 1 commit into from
Dec 15, 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
10 changes: 9 additions & 1 deletion .github/workflows/buildkit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ env:
IMAGE_NAME: "moby/buildkit"
PLATFORMS: "linux/amd64,linux/arm/v7,linux/arm64,linux/s390x,linux/ppc64le,linux/riscv64"
DESTDIR: "./bin"
BUILD_TIMEOUT: "900" # 15 minutes

jobs:
prepare:
Expand Down Expand Up @@ -160,6 +161,7 @@ jobs:
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
with:
version: ${{ env.SETUP_BUILDX_VERSION }}
Expand All @@ -175,8 +177,14 @@ jobs:
-
name: Build ${{ needs.prepare.outputs.tag }}
run: |
./hack/images "${{ needs.prepare.outputs.tag }}" "$IMAGE_NAME" "${{ needs.prepare.outputs.push }}"
timeout ${BUILD_TIMEOUT} ./hack/images "${{ needs.prepare.outputs.tag }}" "$IMAGE_NAME" "${{ needs.prepare.outputs.push }}"
if [ $? -eq 124 ]; then
echo "::error::Build timed out after ${BUILD_TIMEOUT} seconds"
docker kill --signal=SIGQUIT buildx_buildkit_${{ steps.buildx.outputs.name }}
exit 1
fi
env:
BUILDX_CMD: docker --debug buildx
RELEASE: ${{ startsWith(github.ref, 'refs/tags/v') }}
TARGET: ${{ matrix.target-stage }}
CACHE_FROM: type=gha,scope=image${{ matrix.target-stage }}
Expand Down