linkerd / linkerd2

Ultralight, security-first service mesh for Kubernetes. Main repo for Linkerd 2.x.
https://linkerd.io
Apache License 2.0
10.59k stars 1.27k forks source link

Test release build in CI #10348

Open mateiidavid opened 1 year ago

mateiidavid commented 1 year ago

The release workflow only runs when an edge-* or a stable-* are pushed to the repo. This makes it really hard to test the overall workflow, especially when changes to the build process are made. We have had a few releases where the lack of testing either pushed back the release itself, or required additional plumbing and patching before the release could be pushed out.

We have started following a pattern of testing in some of the other repositories. For example, in proxy-init, we have a workflow that sets a "test" variable, which allows us to run through the build process & tests without actually pushing the images in the registry. We could follow a similar pattern here where the release workflow runs when the workflow file is changed, but doesn't push out any images, or do any website updates.

As a prerequisite, we probably want to have https://github.com/linkerd/linkerd2/pull/10334 merged first.

mateiidavid commented 1 year ago

After some experimenting, it might not yet be possible to do this in an easy way.

Exporting images as tarballs doesn't seem to work very well (at least not yet). The proposed way of adding some arm specific tests was to export the images using the oci format. Something similar to:

 docker buildx build . --output type=oci,dest=policy-controller.tar --provenance=false -t test.l5d.io/linkerd/policy-controller:ver-test-0 -f policy-c
ontroller/Dockerfile --platform=linux/arm64,linux/amd64 --quiet

and then load it up using docker load. In CI, the tarballs would be uploaded in the actions cache and be pulled on the arm host to be used in integration tests. At the moment, loading those oci format tarballs seems to error out:

:; docker load -i policy-controller.tar
open /var/lib/docker/tmp/docker-import-2799614952/blobs/json: no such file or directory

For now, it might be better to park this. A few useful links:

https://github.com/docker/buildx/issues/1522 https://github.com/docker/buildx/issues/59 https://github.com/docker/roadmap/issues/371

And the PR that I have closed:

https://github.com/linkerd/linkerd2/pull/10374

Moving this back in the backlog.