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

Different Images for Antrea Agent and Controller #5794

Closed

Conversation

jainpulkit22
Copy link
Contributor

@jainpulkit22 jainpulkit22 commented Dec 13, 2023

Fixes #5691.

Modified the code to build separate images for antrea-agent and antrea-controller, because there are many resources that are not required by controller and are required by agent only, and unified image for both creates a burden when starting antrea-controller and thus it takes time to start. For this reason I have create separate images for antrea-agent and antrea-controller.

Updated image sizes are as follows: 
antrea-controller: ~300MB
antrea-agent: ~380MB 

@rajnkamr rajnkamr added this to the Antrea v1.15 release milestone Dec 14, 2023
Makefile Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
build/yamls/antrea.yml Show resolved Hide resolved
build/images/base/Dockerfile.controller Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
build/images/Dockerfile.build.ubuntu.agent Outdated Show resolved Hide resolved
build/images/base/Dockerfile.controller Outdated Show resolved Hide resolved
build/images/base/build.sh Outdated Show resolved Hide resolved
@jainpulkit22 jainpulkit22 force-pushed the different-antrea-images branch 4 times, most recently from ff03638 to 0dc0027 Compare January 3, 2024 10:26
build/charts/antrea/values.yaml Outdated Show resolved Hide resolved
build/images/base/build.sh Outdated Show resolved Hide resolved
.github/workflows/kind.yml Show resolved Hide resolved
.github/workflows/kind.yml Outdated Show resolved Hide resolved
.github/workflows/kind.yml Outdated Show resolved Hide resolved
@jainpulkit22 jainpulkit22 force-pushed the different-antrea-images branch 8 times, most recently from 34ec080 to a604e31 Compare January 4, 2024 10:28
@jainpulkit22 jainpulkit22 marked this pull request as ready for review January 4, 2024 11:47
@jainpulkit22 jainpulkit22 force-pushed the different-antrea-images branch from 82b6129 to 19e3eef Compare January 16, 2024 10:02
@XinShuYang
Copy link
Contributor

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

ci/jenkins/test-vmc.sh Outdated Show resolved Hide resolved
@jainpulkit22 jainpulkit22 force-pushed the different-antrea-images branch from 19e3eef to 458428d Compare January 17, 2024 06:09
@jainpulkit22
Copy link
Contributor Author

/test-all

@jainpulkit22 jainpulkit22 force-pushed the different-antrea-images branch from 458428d to 15dcf81 Compare January 17, 2024 09:05
@jainpulkit22
Copy link
Contributor Author

/test-all

@luolanzone luolanzone added the action/release-note Indicates a PR that should be included in release notes. label Jan 17, 2024
@jainpulkit22 jainpulkit22 force-pushed the different-antrea-images branch from 15dcf81 to 1bc53ec Compare January 18, 2024 05:47
@jainpulkit22
Copy link
Contributor Author

/test-all

@jainpulkit22 jainpulkit22 requested review from XinShuYang and antoninbas and removed request for antoninbas January 18, 2024 08:23
@jainpulkit22
Copy link
Contributor Author

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

.github/workflows/conformance.yml Outdated Show resolved Hide resolved
build/images/Dockerfile.build.agent.ubi Outdated Show resolved Hide resolved
build/images/Dockerfile.build.controller.ubi Outdated Show resolved Hide resolved
@@ -6947,7 +6947,7 @@ spec:
serviceAccountName: antrea-agent
initContainers:
- name: install-cni
image: "antrea/antrea-ubuntu:latest"
image: "antrea/antrea-agent-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.

this PR may benefit from being broken into 2 parts. The reason is that after we merge this PR, antrea/antrea-agent-ubuntu:latest and antrea/antrea-controller-ubuntu:latest will not exist in the registry for a while. The workflows in this repository only push the amd64 version of the images: antrea/antrea-agent-ubuntu-amd64:latest and antrea/antrea-controller-ubuntu-amd64:latest. We have a separate workflow in a separate repository which takes care of the arm images AND takes care of pushing the multi-arch manifests (antrea/antrea-agent-ubuntu:latest and antrea/antrea-controller-ubuntu:latest).

So if we merge this PR as is, and someone tries to apply https://raw.githubusercontent.com/antrea-io/antrea/main/build/yamls/antrea.yml, I expect that it will fail.

The steps should probably be as follows:

  1. all the infrastructure changes required to build the split images are merged, but the Helm chart and YAML manifests are not modified yet
  2. I take care of updating the infrastructure which builds and pushes the ARM images and multi-arch manifests
  3. changes to the Helm chart and YAML manifests are merged

cc @luolanzone for visibility

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure, so for this PR I can remove the YAML changes and the helm chart changes?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes. Remove them from this PR but keep them for the follow-up PR.
As soon as the 1st PR is merged, I'll update the build infra.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure

Copy link
Contributor Author

Choose a reason for hiding this comment

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

also the generate-manifest changes have to be reverted?

Copy link
Contributor Author

@jainpulkit22 jainpulkit22 Jan 19, 2024

Choose a reason for hiding this comment

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

but won't that affect the github and other ci jobs because with the unmodified yaml it will test the unified image and not the split images.
@antoninbas @tnqn

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm concerned about users applying https://raw.githubusercontent.com/antrea-io/antrea/main/build/yamls/antrea.yml to deploy the latest Antrea, not about CI jobs which build the image themselves.

also the generate-manifest changes have to be reverted?

yes

Copy link
Contributor

Choose a reason for hiding this comment

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

Really the first PR should only have the build infrastructure to build and push the images. It should not update any manifest or test script.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Created two different PRs for the same, this PR is to build the images, and this one is to update the yamls, ci and github workflows.

Pulkit Jain added 2 commits January 23, 2024 10:24
Modified the code to build separate images for antrea-agent and
antrea-controller, because there are many resources that are not
required by controller and are required by agent only, and unified
image for both creates a burden when starting antrea-controller and
thus it takes time to start. For this reason I have create separate
images for antrea-agent and antrea-controller.

Signed-off-by: Pulkit Jain <[email protected]>
@jainpulkit22 jainpulkit22 force-pushed the different-antrea-images branch from d182a56 to 956a7ae Compare January 23, 2024 04:54
@rajnkamr rajnkamr changed the title Use Different Images for Agent and Controller Build Different Images for Antrea Agent and Controller Jan 23, 2024
@rajnkamr rajnkamr changed the title Build Different Images for Antrea Agent and Controller Different Images for Antrea Agent and Controller Jan 23, 2024
@jainpulkit22 jainpulkit22 requested review from tnqn and removed request for tnqn January 23, 2024 10:40
@jainpulkit22 jainpulkit22 removed the action/release-note Indicates a PR that should be included in release notes. label Jan 24, 2024
@jainpulkit22 jainpulkit22 removed this from the Antrea v1.15 release milestone Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use different images for antrea-controller and antrea-agent
8 participants