-
Notifications
You must be signed in to change notification settings - Fork 9
[pipeline] add multiarch mco #156
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
base: master
Are you sure you want to change the base?
Changes from all commits
fa837b9
139ebaa
2e73c65
4fc60c1
b2d573b
d97128d
613ac07
614ddbb
1d8a9dc
f92069a
0bb1c76
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -483,30 +483,54 @@ def build_mco_tests_image(build_configuration: BuildConfiguration): | |
sonar_build_image(image_name, build_configuration, buildargs, "inventories/mco_test.yaml") | ||
|
||
|
||
TRACER.start_as_current_span("build_operator_image") | ||
|
||
|
||
def build_operator_image(build_configuration: BuildConfiguration): | ||
"""Calculates arguments required to build the operator image, and starts the build process.""" | ||
# In evergreen, we can pass test_suffix env to publish the operator to a quay | ||
# repository with a given suffix. | ||
test_suffix = os.environ.get("test_suffix", "") | ||
log_automation_config_diff = os.environ.get("LOG_AUTOMATION_CONFIG_DIFF", "false") | ||
version, _ = get_git_release_tag() | ||
version, is_release = get_git_release_tag() | ||
|
||
args = { | ||
"version": version, | ||
"log_automation_config_diff": log_automation_config_diff, | ||
"test_suffix": test_suffix, | ||
"debug": build_configuration.debug, | ||
} | ||
# Use only amd64 if we should skip arm64 builds | ||
if should_skip_arm64(): | ||
architectures = ["amd64"] | ||
logger.info("Skipping ARM64 builds for operator image as this is running in EVG pipeline as a patch") | ||
else: | ||
architectures = build_configuration.architecture or ["amd64", "arm64"] | ||
|
||
logger.info(f"Building Operator args: {args}") | ||
multi_arch_args_list = [] | ||
|
||
for arch in architectures: | ||
arch_args = { | ||
"version": version, | ||
"log_automation_config_diff": log_automation_config_diff, | ||
"test_suffix": test_suffix, | ||
"debug": build_configuration.debug, | ||
"architecture": arch, | ||
} | ||
multi_arch_args_list.append(arch_args) | ||
|
||
logger.info(f"Building Operator args: {multi_arch_args_list}") | ||
|
||
image_name = "mongodb-kubernetes" | ||
|
||
current_span = trace.get_current_span() | ||
current_span.set_attribute("mck.image_name", image_name) | ||
current_span.set_attribute("mck.architecture", architectures) | ||
|
||
ecr_registry = os.environ.get("BASE_REPO_URL", "268558157000.dkr.ecr.us-east-1.amazonaws.com/dev") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: we should fail if not set. We should require running it with some context at least. |
||
base_repo = QUAY_REGISTRY_URL if is_release else ecr_registry | ||
Comment on lines
+524
to
+525
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure if this is needed. Looking into the definition of |
||
|
||
build_image_generic( | ||
config=build_configuration, | ||
image_name=image_name, | ||
inventory_file="inventory.yaml", | ||
extra_args=args, | ||
registry_address=f"{QUAY_REGISTRY_URL}/{image_name}", | ||
registry_address=f"{base_repo}/{image_name}", | ||
multi_arch_args_list=multi_arch_args_list, | ||
is_multi_arch=True, | ||
) | ||
|
||
|
||
|
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.
all of those repo changes should be fine as they are targeting $(inputs.params.registry) which points to ecr
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.
how that worked before? So we didn't publish -context images to quay at all? There is no operator-context repo in quay.
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.
There is a stage in this file called
operator-context-release
(now calledmongodb-kubernetes-release
) which retags the image from ecr to quay. Thequay_registry
already contains image name and this didn't change.