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

Switch to VMware Harbor registry for Antrea Docker images #1617

Conversation

antoninbas
Copy link
Contributor

All "user-facing" images (antrea/antrea-ubuntu, antrea/antrea-windows,
antrea/octant-antrea-ubuntu) are now pulled from the VMware Harbor
distribution registry (projects.registry.vmware.com) to avoid Docker
pull rate limiting.

The YAML manifests (top-of-tree and releases) now refer to the new
registry.

This is not a complete transition from Dockerhub to Harbor. Images used
for build purposes (e.g. antrea/openvswitch) are still pulled from
Dockerhub by default. Rate limiting is not as much of an issue for these
(not user-facing, Github workflows are not subject to rate limiting, we
have workarounds for the Jenkins CI jobs). One thing to keep is mind is
that we cannot push to the VMware Harbor registry from outside of the
the VMware corporate network. This is why all images are pushed to
the Dockerhub registry, which is then mirrored by the distribution
Harbor registry.

See #1555

@antrea-bot
Copy link
Collaborator

Thanks for your PR.
Unit tests and code linters are run automatically every time the PR is updated.
E2e, conformance and network policy tests can only be triggered by a member of the vmware-tanzu organization. Regular contributors to the project should join the org.

The following commands are available:

  • /test-e2e: to trigger e2e tests.
  • /skip-e2e: to skip e2e tests.
  • /test-conformance: to trigger conformance tests.
  • /skip-conformance: to skip conformance tests.
  • /test-all-features-conformance: to trigger conformance tests with all alpha features enabled.
  • /skip-all-features-conformance: to skip conformance tests with all alpha features enabled.
  • /test-whole-conformance: to trigger all conformance tests on linux.
  • /skip-whole-conformance: to skip all conformance tests on linux.
  • /test-networkpolicy: to trigger networkpolicy tests.
  • /skip-networkpolicy: to skip networkpolicy tests.
  • /test-windows-conformance: to trigger windows conformance tests.
  • /skip-windows-conformance: to skip windows conformance tests.
  • /test-windows-networkpolicy: to trigger windows networkpolicy tests.
  • /skip-windows-networkpolicy: to skip windows networkpolicy tests.
  • /test-hw-offload: to trigger ovs hardware offload test.
  • /skip-hw-offload: to skip ovs hardware offload test.
  • /test-all: to trigger all tests (except whole conformance).
  • /skip-all: to skip all tests (except whole conformance).

@codecov-io
Copy link

codecov-io commented Dec 4, 2020

Codecov Report

Merging #1617 (9a002c1) into master (9d3d10b) will increase coverage by 0.64%.
The diff coverage is 60.22%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1617      +/-   ##
==========================================
+ Coverage   63.31%   63.96%   +0.64%     
==========================================
  Files         170      181      +11     
  Lines       14250    15433    +1183     
==========================================
+ Hits         9023     9871     +848     
- Misses       4292     4527     +235     
- Partials      935     1035     +100     
Flag Coverage Δ
e2e-tests 46.02% <39.23%> (?)
kind-e2e-tests 53.26% <53.25%> (-2.13%) ⬇️
unit-tests 40.53% <24.61%> (-0.75%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
cmd/antrea-agent/agent.go 0.00% <0.00%> (ø)
.../agent/apiserver/handlers/networkpolicy/handler.go 58.33% <ø> (ø)
...gent/controller/noderoute/node_route_controller.go 61.04% <ø> (+14.58%) ⬆️
pkg/agent/stats/collector.go 97.72% <ø> (ø)
pkg/antctl/antctl.go 100.00% <ø> (ø)
pkg/antctl/transform/controllerinfo/transform.go 0.00% <ø> (ø)
pkg/antctl/transform/version/transform.go 0.00% <ø> (ø)
pkg/controller/networkpolicy/tier.go 90.00% <ø> (ø)
pkg/features/antrea_features.go 16.66% <ø> (ø)
pkg/ovs/openflow/ofctrl_builder.go 59.85% <0.00%> (-2.32%) ⬇️
... and 91 more

jianjuns
jianjuns previously approved these changes Dec 7, 2020
@@ -99,7 +99,7 @@ if $coverage; then
manifest_args="$manifest_args --coverage"
COMMON_IMAGES_LIST+=("antrea/antrea-ubuntu-coverage:latest")
else
COMMON_IMAGES_LIST+=("antrea/antrea-ubuntu:latest")
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you have any good way to define the registry URL once in a file and other code just read the URL?

Copy link
Contributor

Choose a reason for hiding this comment

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

Or maybe have an update-image-name-with-registry.sh script to update all images' names in the repo? Then we don't need to add logic in the code.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I guess specifically for test / CI, we can have something like this:

images.yml

antrea/antrea-ubuntu: projects.registry.vmware.com/antrea/antrea-ubuntu

get_img.sh

function get_img {
    while read -r line; do
        IFS=':' read -ra ADDR <<< "$line"
        name=$(echo ${ADDR[0]} | xargs)
        img=$(echo ${ADDR[1]} | xargs)
        if [[ $name == $1 ]]; then echo $img; fi
    done < "images.yml"
}

[[ $_ != $0 ]] || get_img $1

for example, CI scripts can source get_img.sh and use "$(get_img antrea/antrea-ubuntu)"

I am not sure it's much better though. Maybe we can wait a bit and see how things evolve in the short term? Right now we have to push and pull from different registries which is making things a bit tricky.

Copy link
Contributor

Choose a reason for hiding this comment

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

Good idea. Yes we can wait and see.

lzhecheng
lzhecheng previously approved these changes Dec 8, 2020
Copy link
Contributor

@lzhecheng lzhecheng 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-all

@antoninbas antoninbas dismissed stale reviews from lzhecheng and jianjuns via 9744fd4 December 8, 2020 22:19
@antoninbas antoninbas force-pushed the switch-to-vmware-harbor-distribution-registry-for-antrea-images branch from d537fcb to 9744fd4 Compare December 8, 2020 22:19
lzhecheng
lzhecheng previously approved these changes Dec 9, 2020
Copy link
Contributor

@lzhecheng lzhecheng 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 antoninbas force-pushed the switch-to-vmware-harbor-distribution-registry-for-antrea-images branch from 9744fd4 to 89f8554 Compare December 9, 2020 03:59
@antoninbas
Copy link
Contributor Author

/test-all

@antoninbas
Copy link
Contributor Author

/test-e2e
/test-networkpolicy

@antoninbas antoninbas force-pushed the switch-to-vmware-harbor-distribution-registry-for-antrea-images branch from 89f8554 to 63c2778 Compare December 9, 2020 23:43
@antoninbas
Copy link
Contributor Author

/test-all

All "user-facing" images (antrea/antrea-ubuntu, antrea/antrea-windows,
antrea/octant-antrea-ubuntu) are now pulled from the VMware Harbor
distribution registry (projects.registry.vmware.com) to avoid Docker
pull rate limiting.

The YAML manifests (top-of-tree and releases) now refer to the new
registry.

This is not a complete transition from Dockerhub to Harbor. Images used
for build purposes (e.g. antrea/openvswitch) are still pulled from
Dockerhub by default. Rate limiting is not as much of an issue for these
(not user-facing, Github workflows are not subject to rate limiting, we
have workarounds for the Jenkins CI jobs). One thing to keep is mind is
that we cannot push to the VMware Harbor registry from outside of the
the VMware corporate network. This is why all images are pushed to
the Dockerhub registry, which is then mirrored by the distribution
Harbor registry.

See antrea-io#1555
@antoninbas antoninbas force-pushed the switch-to-vmware-harbor-distribution-registry-for-antrea-images branch from 63c2778 to 9a002c1 Compare December 10, 2020 19:59
@antoninbas
Copy link
Contributor Author

/test-all

@antoninbas
Copy link
Contributor Author

@lzhecheng I need a new review & approval for this. I found a couple issues during testing that I had to address (see second and third commits)

Copy link
Contributor

@lzhecheng lzhecheng 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 antoninbas merged commit ff305a4 into antrea-io:master Dec 11, 2020
@antoninbas antoninbas deleted the switch-to-vmware-harbor-distribution-registry-for-antrea-images branch December 11, 2020 02:58
antoninbas added a commit to antoninbas/antrea that referenced this pull request Dec 11, 2020
Changes are the same as in
antrea-io#1617 but for the
antrea/flow-aggregator Docker image.

There was also a typo in the flow-aggregator YAML: the image key didn't
match the one used in generate-manifest-flow-aggregator.sh when invoking
kustomize.
antoninbas added a commit to antoninbas/antrea that referenced this pull request Dec 11, 2020
Changes are the same as in
antrea-io#1617 but for the
antrea/flow-aggregator Docker image.

There was also a typo in the flow-aggregator YAML: the image key didn't
match the one used in generate-manifest-flow-aggregator.sh when invoking
kustomize.
antoninbas added a commit to antoninbas/antrea that referenced this pull request Dec 11, 2020
Changes are the same as in
antrea-io#1617 but for the
antrea/flow-aggregator Docker image.

There was also a typo in the flow-aggregator YAML: the image key didn't
match the one used in generate-manifest-flow-aggregator.sh when invoking
kustomize.
@antoninbas antoninbas mentioned this pull request Dec 11, 2020
antoninbas added a commit to antoninbas/antrea that referenced this pull request Dec 11, 2020
Changes are the same as in
antrea-io#1617 but for the
antrea/flow-aggregator Docker image.

There was also a typo in the flow-aggregator YAML: the image key didn't
match the one used in generate-manifest-flow-aggregator.sh when invoking
kustomize.
antoninbas added a commit that referenced this pull request Dec 11, 2020
Changes are the same as in
#1617 but for the
antrea/flow-aggregator Docker image.

There was also a typo in the flow-aggregator YAML: the image key didn't
match the one used in generate-manifest-flow-aggregator.sh when invoking
kustomize.
srikartati pushed a commit to srikartati/antrea that referenced this pull request Dec 17, 2020
…o#1650)

Changes are the same as in
antrea-io#1617 but for the
antrea/flow-aggregator Docker image.

There was also a typo in the flow-aggregator YAML: the image key didn't
match the one used in generate-manifest-flow-aggregator.sh when invoking
kustomize.
srikartati pushed a commit to srikartati/antrea that referenced this pull request Dec 19, 2020
…o#1650)

Changes are the same as in
antrea-io#1617 but for the
antrea/flow-aggregator Docker image.

There was also a typo in the flow-aggregator YAML: the image key didn't
match the one used in generate-manifest-flow-aggregator.sh when invoking
kustomize.
srikartati pushed a commit to srikartati/antrea that referenced this pull request Dec 21, 2020
…o#1650)

Changes are the same as in
antrea-io#1617 but for the
antrea/flow-aggregator Docker image.

There was also a typo in the flow-aggregator YAML: the image key didn't
match the one used in generate-manifest-flow-aggregator.sh when invoking
kustomize.
srikartati pushed a commit to srikartati/antrea that referenced this pull request Dec 21, 2020
…o#1650)

Changes are the same as in
antrea-io#1617 but for the
antrea/flow-aggregator Docker image.

There was also a typo in the flow-aggregator YAML: the image key didn't
match the one used in generate-manifest-flow-aggregator.sh when invoking
kustomize.
antoninbas added a commit that referenced this pull request Dec 23, 2020
* Switch to VMware Harbor registry for Antrea Docker images

All "user-facing" images (antrea/antrea-ubuntu, antrea/antrea-windows,
antrea/octant-antrea-ubuntu) are now pulled from the VMware Harbor
distribution registry (projects.registry.vmware.com) to avoid Docker
pull rate limiting.

The YAML manifests (top-of-tree and releases) now refer to the new
registry.

This is not a complete transition from Dockerhub to Harbor. Images used
for build purposes (e.g. antrea/openvswitch) are still pulled from
Dockerhub by default. Rate limiting is not as much of an issue for these
(not user-facing, Github workflows are not subject to rate limiting, we
have workarounds for the Jenkins CI jobs). One thing to keep is mind is
that we cannot push to the VMware Harbor registry from outside of the
the VMware corporate network. This is why all images are pushed to
the Dockerhub registry, which is then mirrored by the distribution
Harbor registry.

See #1555

* Changes for Jenkins scripts

* Fix issue in generate-manifest.sh when enabling ipsec and coverage
abdallahyas added a commit to abdallahyas/antrea that referenced this pull request Apr 13, 2021
Following antrea-io#1617, the default image name in the antrea.yml file changed
to use the harbor image. Although the patch includes a change in the
make file to change the image name correctly in case the image was
built, the hw-offload CI uses `docker build` to build the image, and
this made it so that the CI would not use the image it was building,
but the upstream latest image.

This patch fixes that by building the antrea manifests with the image
name being the same as the one that was built.
abdallahyas added a commit to abdallahyas/antrea that referenced this pull request Apr 13, 2021
Following antrea-io#1617, the default image name in the antrea.yml file changed
to use the harbor image. Although the patch includes a change in the
make file to change the image name correctly in case the image was
built, the hw-offload CI uses `docker build` to build the image, and
this made it so that the CI would not use the image it was building,
but the upstream latest image.

This patch fixes that by building the antrea manifests with the image
name being the same as the one that was built.
abdallahyas added a commit to abdallahyas/antrea that referenced this pull request Apr 13, 2021
Following antrea-io#1617, the default image name in the antrea.yml file changed
to use the harbor image. Although the patch includes a change in the
make file to change the image name correctly in case the image was
built, the hw-offload CI uses `docker build` to build the image, and
this made it so that the CI would not use the image it was building,
but the upstream latest image.

This patch fixes that by building the antrea manifests with the image
name being the same as the one that was built.
abdallahyas added a commit to abdallahyas/antrea that referenced this pull request Apr 15, 2021
Following antrea-io#1617, the default image name in the antrea.yml file changed
to use the harbor image. Although the patch includes a change in the
make file to change the image name correctly in case the image was
built, the hw-offload CI uses `docker build` to build the image, and
this made it so that the CI would not use the image it was building,
but the upstream latest image.

Also changed the way to enable the hw-offload to use the generate-manifests.sh
instead of using `sed`.

This patch fixes that by building the antrea manifests with the image
name being the same as the one that was built.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants