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

[v0.10] cherry-picks to fix dockerd tests #2777

Merged
merged 14 commits into from
Apr 6, 2022
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
139 changes: 139 additions & 0 deletions .github/workflows/dockerd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
name: dockerd

on:
# TODO: add event to build on command in PR (e.g., /test-dockerd)
workflow_dispatch:
inputs:
version:
description: 'Docker version'
required: true
default: '20.10.13'

env:
REPO_SLUG_ORIGIN: "moby/buildkit:latest"
CACHE_GHA_SCOPE_IT: "integration-tests"
CACHE_GHA_SCOPE_BINARIES: "binaries"

jobs:
prepare:
runs-on: ubuntu-latest
steps:
-
name: Check version
run: |
version=${{ github.event.inputs.version }}
if [ -z "$version" ]; then
version=20.10.13
fi
echo "DOCKER_VERSION=$version" >> $GITHUB_ENV
-
name: Check build
uses: actions/github-script@v6
id: build
with:
result-encoding: string
script: |
try {
new URL("${{ env.DOCKER_VERSION }}");
} catch (e) {
return false;
}
return true;
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
with:
driver-opts: image=${{ env.REPO_SLUG_ORIGIN }}
buildkitd-flags: --debug
-
name: Build
if: steps.build.outputs.result == 'true'
uses: docker/build-push-action@v2
with:
context: ${{ env.DOCKER_VERSION }}
target: binary
outputs: /tmp/moby
-
# FIXME: remove symlink and rename bin. should be fixed upstream on moby.
name: Rename binary
if: steps.build.outputs.result == 'true'
run: |
rm /tmp/moby/binary-daemon/dockerd
mv /tmp/moby/binary-daemon/dockerd-dev /tmp/moby/binary-daemon/dockerd
-
name: Download
if: steps.build.outputs.result != 'true'
run: |
mkdir -p /tmp/moby/binary-daemon
cd /tmp/moby/binary-daemon
wget -qO- "https://download.docker.com/linux/static/stable/x86_64/docker-${{ env.DOCKER_VERSION }}.tgz" | tar xvz --strip 1
-
name: Upload dockerd
uses: actions/upload-artifact@v2
with:
name: dockerd
path: /tmp/moby/binary-daemon/dockerd
if-no-files-found: error

test:
runs-on: ubuntu-latest
needs:
- prepare
strategy:
fail-fast: false
matrix:
pkg:
- ./client
- ./cmd/buildctl
- ./solver
- ./frontend
- ./frontend/dockerfile
typ:
- integration
include:
- pkg: ./...
skip-integration-tests: 1
steps:
-
name: Checkout
uses: actions/checkout@v2
-
name: Expose GitHub Runtime
uses: crazy-max/ghaction-github-runtime@v1
-
name: Set up QEMU
uses: docker/setup-qemu-action@v1
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
with:
driver-opts: image=${{ env.REPO_SLUG_ORIGIN }}
buildkitd-flags: --debug
-
name: Download dockerd
uses: actions/download-artifact@v2
with:
name: dockerd
path: ./build/
-
name: Fix dockerd perms
run: |
chmod +x ./build/dockerd
-
name: Update daemon.json
run: |
sudo rm /etc/docker/daemon.json
sudo service docker restart
docker version
docker info
-
name: Test
run: |
./hack/test ${{ matrix.typ }}
env:
TEST_DOCKERD: "1"
TEST_DOCKERD_BINARY: "./build/dockerd"
TESTPKGS: "${{ matrix.pkg }}"
TESTFLAGS: "-v --parallel=1 --timeout=30m --run=//worker=dockerd$"
SKIP_INTEGRATION_TESTS: "${{ matrix.skip-integration-tests }}"
CACHE_FROM: "type=gha,scope=${{ env.CACHE_GHA_SCOPE_IT }} type=gha,scope=${{ env.CACHE_GHA_SCOPE_BINARIES }}"
2 changes: 1 addition & 1 deletion client/build_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1650,7 +1650,7 @@ func testClientGatewayContainerSecurityMode(t *testing.T, sb integration.Sandbox
}
allowedEntitlements = []entitlements.Entitlement{}
} else {
skipDockerd(t, sb)
integration.SkipIfDockerd(t, sb)
assertCaps = func(caps uint64) {
/*
$ capsh --decode=0000003fffffffff
Expand Down
Loading