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

Use the docker.io registry for "latest" antrea images #4235

Merged

Conversation

antoninbas
Copy link
Contributor

It has been observed that pulling
projects.registry.vmware.com/antrea/antrea-ubuntu:latest will often fail. This is because the Harbor registry uses a CDN for caching, which doesn't work well at all when tags are being re-used (in our case, we re-use the latest tag all the time). While most users should be installing a released version of antrea (with an immutable tag) and thus should not suffer from this issue, it can be frustrating for users who want to install the latest antrea built from the main branch.

As a result, we switch to the docker.io registry whenever the latest tag is used, and in particular for checked-in manifest files. The Harbor registry (projects.registry.vmware.com) is still used for all release assets, and more generally for all images with an immutable tag.

We are able to simplify some infrastructure code because of that, as built images no longer need to be tagged with
projects.registry.vmware.com.

@antoninbas antoninbas added area/build-release Issues or PRs related to building and releasing action/release-note Indicates a PR that should be included in release notes. and removed action/release-note Indicates a PR that should be included in release notes. labels Sep 16, 2022
@antoninbas antoninbas added this to the Antrea v1.9 release milestone Sep 16, 2022
@codecov
Copy link

codecov bot commented Sep 16, 2022

Codecov Report

Merging #4235 (be38393) into main (4caa8c1) will decrease coverage by 1.28%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4235      +/-   ##
==========================================
- Coverage   64.29%   63.00%   -1.29%     
==========================================
  Files         361      396      +35     
  Lines       52203    54859    +2656     
==========================================
+ Hits        33563    34564    +1001     
- Misses      16186    17792    +1606     
- Partials     2454     2503      +49     
Flag Coverage Δ
e2e-tests 41.29% <ø> (?)
integration-tests 34.91% <ø> (+0.08%) ⬆️
kind-e2e-tests 47.83% <ø> (-0.73%) ⬇️
unit-tests 43.81% <ø> (-1.20%) ⬇️
Impacted Files Coverage Δ
pkg/agent/cniserver/ipam/ipam_service.go 76.40% <0.00%> (-12.36%) ⬇️
pkg/agent/controller/trafficcontrol/controller.go 77.52% <0.00%> (-5.98%) ⬇️
pkg/ovs/openflow/ofctrl_builder.go 77.06% <0.00%> (-3.61%) ⬇️
pkg/agent/memberlist/cluster.go 72.29% <0.00%> (-3.19%) ⬇️
pkg/util/k8s/node.go 86.36% <0.00%> (-1.82%) ⬇️
...gent/controller/networkpolicy/status_controller.go 79.83% <0.00%> (-1.69%) ⬇️
pkg/agent/flowexporter/exporter/exporter.go 80.44% <0.00%> (-1.24%) ⬇️
pkg/agent/util/net_linux.go 32.25% <0.00%> (-1.21%) ⬇️
pkg/agent/controller/networkpolicy/reconciler.go 70.27% <0.00%> (-1.14%) ⬇️
...g/agent/cniserver/interface_configuration_linux.go 26.45% <0.00%> (-0.98%) ⬇️
... and 79 more

@antoninbas antoninbas force-pushed the use-docker.io-registry-for-latest-images branch from d512969 to 1ee04b0 Compare September 16, 2022 20:19
@XinShuYang
Copy link
Contributor

/test-all
/test-windows-all

@@ -316,7 +316,7 @@ function deliver_antrea_windows {
fi

cp -f build/yamls/*.yml $WORKDIR
docker save -o antrea-ubuntu.tar projects.registry.vmware.com/antrea/antrea-ubuntu:latest
docker save -o antrea-ubuntu.tar antrea/antrea-ubuntu:latest
Copy link
Contributor

@luolanzone luolanzone Sep 19, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default registry is DOCKER_REGISTRY=$(head -n1 "${WORKSPACE}/ci/docker-registry"), there are quite a few scripts are using this default registry to build images. I feel you may need to double check it.
Another usage I see is DOCKER_REGISTRY="projects.registry.vmware.com".

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you clarify your concern? Tagged images, and in particular images used for testing (e.g., nginx) or tagged base images (e.g. antrea/openvswitch) should still be pulled from projects.registry.vmware.com. The Jenkins test scripts build the antrea image (antrea/antrea-ubuntu:latest) as part of the test (image is not pulled) and there is no reason to tag it with the registry (projects.registry.vmware.com/antrea/antrea-ubuntu:latest) any more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean there are some images' prefix is ${DOCKER_REGISTRY} instead of projects.registry.vmware.com directly. E.g: https://github.com/antrea-io/antrea/blob/main/ci/jenkins/test-mc.sh#L268-L273.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. As far as I can tell, only test-mc.sh needs to be updated.

@antoninbas
Copy link
Contributor Author

/test-multicluster-e2e

It has been observed that pulling
projects.registry.vmware.com/antrea/antrea-ubuntu:latest will often
fail. This is because the Harbor registry uses a CDN for caching, which
doesn't work well at all when tags are being re-used (in our case, we
re-use the latest tag all the time). While most users should be
installing a released version of antrea (with an immutable tag) and thus
should not suffer from this issue, it can be frustrating for users who
want to install the latest antrea built from the main branch.

As a result, we switch to the docker.io registry whenever the latest tag
is used, and in particular for checked-in manifest files. The Harbor
registry (projects.registry.vmware.com) is still used for all release
assets, and more generally for all images with an immutable tag.

We are able to simplify some infrastructure code because of that, as
built images no longer need to be tagged with
projects.registry.vmware.com.

Signed-off-by: Antonin Bas <[email protected]>
Signed-off-by: Antonin Bas <[email protected]>
@antoninbas antoninbas force-pushed the use-docker.io-registry-for-latest-images branch from 1ee04b0 to be38393 Compare September 20, 2022 17:04
@antoninbas
Copy link
Contributor Author

/test-all
/test-multicluster-e2e

@antoninbas
Copy link
Contributor Author

/test-all

@XinShuYang
Copy link
Contributor

/test-all
/test-multicluster-e2e

Copy link
Member

@tnqn tnqn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@antoninbas
Copy link
Contributor Author

@XinShuYang the tests are still not running, I'll try again

@antoninbas
Copy link
Contributor Author

/test-all
/test-multicluster-e2e

@XinShuYang
Copy link
Contributor

/test-windows-all
/test-ipv6-e2e
/test-ipv6-only-e2e

Copy link
Contributor

@XinShuYang XinShuYang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@antoninbas
Copy link
Contributor Author

/test-e2e

@antoninbas
Copy link
Contributor Author

@luolanzone any further comment?

Copy link
Contributor

@luolanzone luolanzone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks.

@antoninbas antoninbas merged commit 7216f2a into antrea-io:main Sep 26, 2022
@antoninbas antoninbas deleted the use-docker.io-registry-for-latest-images branch September 26, 2022 18:05
heanlan pushed a commit to heanlan/antrea that referenced this pull request Mar 29, 2023
It has been observed that pulling
projects.registry.vmware.com/antrea/antrea-ubuntu:latest will often
fail. This is because the Harbor registry uses a CDN for caching, which
doesn't work well at all when tags are being re-used (in our case, we
re-use the latest tag all the time). While most users should be
installing a released version of antrea (with an immutable tag) and thus
should not suffer from this issue, it can be frustrating for users who
want to install the latest antrea built from the main branch.

As a result, we switch to the docker.io registry whenever the latest tag
is used, and in particular for checked-in manifest files. The Harbor
registry (projects.registry.vmware.com) is still used for all release
assets, and more generally for all images with an immutable tag.

We are able to simplify some infrastructure code because of that, as
built images no longer need to be tagged with
projects.registry.vmware.com.

Signed-off-by: Antonin Bas <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/build-release Issues or PRs related to building and releasing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants