-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Switch to GitHub Actions #1736
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
Switch to GitHub Actions #1736
Conversation
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
Add lint and validator tests Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
3eb2473
to
7018a23
Compare
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
7018a23
to
28982e5
Compare
Sometime this head request fails. Looks random, maybe some network issue:
|
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
86150a8
to
3193ad4
Compare
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
3193ad4
to
8f20da6
Compare
pkg: ./frontend/dockerfile | ||
flags: -v --parallel=6 --timeout=20m |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this is not related to the GH migration, but this test seems like the slowest test, I wonder if we could get better parallelization if we break them out by each buildkit worker and let GH parallelize. Something like:
- pkg: ./frontend/dockerfile
flags: -v --parallel=6 --timeout=20m -run=".*/.*/worker=containerd$"
skip-it: 0
- pkg: ./frontend/dockerfile
flags: -v --parallel=6 --timeout=20m -run=".*/.*/worker=containerd-1.3$"
skip-it: 0
- pkg: ./frontend/dockerfile
flags: -v --parallel=6 --timeout=20m -run=".*/.*/worker=containerd-snapshotter-stargz$"
skip-it: 0
- pkg: ./frontend/dockerfile
flags: -v --parallel=6 --timeout=20m -run=".*/.*/worker=oci$"
skip-it: 0
- pkg: ./frontend/dockerfile
flags: -v --parallel=6 --timeout=20m -run=".*/.*/worker=oci-rootless$"
skip-it: 0
- pkg: ./frontend/dockerfile
flags: -v --parallel=6 --timeout=20m -run=".*/.*/worker=oci-snapshotter-stargz$"
skip-it: 0
Not sure if there is a more graceful way to add the list of workers to the matrix. A similar hack could be applied to all the other packages that run via workers. If GH can spin up parallel containers for each test I suspect it will reduce the test duration by ~6x.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like we can add our own matrix options, so was thinking something like this:
matrix:
pkg:
- ./client
- ./cmd/buildctl
- ./worker/containerd
- ./frontend
- ./frontend/dockerfile
worker:
- containerd
- containerd-1.3
- containerd-snapshotter-stargz
- oci
- oci-rootless
- oci-snapshotter-stargz
include:
- pkg: ./client
flags: --timeout=20m
- pkg: ./frontend/dockerfile
flags: --timeout=20m
steps:
- name: Test ${{matrix.worker}}:${{ matrix.pkg }}
run: |
...
cid=$(docker create --rm -v /tmp --volumes-from=$cacheVolume -e TEST_DOCKERD -e SKIP_INTEGRATION_TESTS=0 -e BUILDKIT_REGISTRY_MIRROR_DIR=$VOL/registry --privileged $IID go test -v -run=".*/.*/worker=${{matrix.worker}}$" ${{ matrix.flags }} ${{ matrix.pkg }})
...
We only need to specify the include for the exceptions where we want to add custom flags. This drops the ./...
non-integration tests, it seems to me those should be run separately outside of the "integration test" matrix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your input I will make some tests around this.
73d5589
to
769ec43
Compare
Add build workflow Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
769ec43
to
307cd47
Compare
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
d2249cf
to
227074b
Compare
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
227074b
to
0c91716
Compare
0449df4
to
86928d2
Compare
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
86928d2
to
85f07f8
Compare
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
5c36163
to
346a91e
Compare
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
cc6e673
to
9010bec
Compare
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
9010bec
to
a70a326
Compare
Now workflows only use our Docker actions instead of buildctl and dockerfile-frontend workflow has been added. |
Leaving summary here, mostly what we discussed in slack already. Again, apologies for not reacting sooner. I think we should start this work with refactoring the scripts in We should replace it with The goal is to have the dev flow covered with containerized actions that can be run without a special host setup, without much performance overhead. That means that we should avoid The above also means that we shouldn't have things using We should build from git. This improves caching precision and makes sure there are no leaked files. Regarding caching, as we discussed, it looks like it is possible to use the keys and scope of For the cache, using We don't need to do this all at once. Can just pick one section, fix the |
Maybe we could take a look at https://github.com/crazy-max/ghaction-docker-buildx-bake and move it to docker org?
I will work on it and let you know about my progress.
Yes that's what I thought when I started to work on it. Feel free to close this PR and thanks for your report! |
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
Closing this one in favor of #1843 |
Closes #1729
Switch to GitHub Actions. ATM it does not use the "hack" scripts. Everything is done through the workflows.
Build time is slightly improved using local GitHub Cache ATM:
Without release tag:
With release tag:
TODO
binaries
build stageintegration-tests-base
build stage./client
pkg./cmd/buildctl
pkg./worker/containerd
pkg./...
pkg (moved tointegration-tests
job for build time improvement through matrix)validate-vendor
validate-generated-files
validate-shfmt
build github.com/moby/buildkit/util/entitlements/security: cannot load github.com/moby/buildkit/util/entitlements/security: no Go source files
./frontend/dockerfile
pkg (moved tointegration-tests
job for build time improvement through matrix)./hack/images master $REPO_SLUG_TARGET push
./hack/release-tar $TRAVIS_TAG release-out
./frontend/dockerfile/cmd/dockerfile-frontend/hack/release master mainline $DF_REPO_SLUG_TARGET push
./frontend/dockerfile/cmd/dockerfile-frontend/hack/release master experimental $DF_REPO_SLUG_TARGET push
./frontend/dockerfile/cmd/dockerfile-frontend/hack/release tag $TRAVIS_TAG $DF_REPO_SLUG_TARGET push
./frontend/dockerfile/cmd/dockerfile-frontend/hack/release daily _ $DF_REPO_SLUG_TARGET push
cc. @tonistiigi @coryb