Skip to content

Feature/build scripts update #20

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

Merged
merged 5 commits into from
Apr 23, 2025
Merged

Conversation

dpdornseifer
Copy link
Collaborator

Description of changes:

  • Updated build scripts
  • Updated Helm default value

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

* Set Helm chart default value for Enclave CPU advertisement to `false` to be in sync with kubernetes manifest
@dpdornseifer dpdornseifer force-pushed the feature/build_scripts_update branch from c783c9f to 12f8444 Compare April 16, 2025 13:09
eugkoira
eugkoira previously approved these changes Apr 16, 2025
Copy link

@foersleo foersleo left a comment

Choose a reason for hiding this comment

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

I am not quite clear on the usage of -e in most of these scripts and think that we are off with the naming of the images, doubling the arch field.

main() {
ecr_login

docker manifest create --amend $ECR_URL/$IMAGE \

Choose a reason for hiding this comment

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

If I read this correctly then this will expand to $ECR_URL/aws-nitro-enclaves-k8s-device-plugin:v0.2-x86_64 when run on an x86 machine. I do not think this is what we actually want. (?)

Probably better to stay with $ECR_URL/$REPOSITORY_NAME as it was before.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

arch got removed from image tag. Image just points at the generic image name + version tag now: https://github.com/aws/aws-nitro-enclaves-k8s-device-plugin/pull/20/files#diff-b23204e92f793e233cf28605758e6f1d4849830577492c85f00593f977527e27R17

#!/bin/bash
# Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
set -e

Choose a reason for hiding this comment

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

is -e actually what we want in this particular script, given that we do have handling through die et.al?

tag_and_push_docker_image() {
local arch=$1

docker tag $IMAGE-$arch $ECR_URL/$IMAGE-$arch

Choose a reason for hiding this comment

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

If I read common.sh correctly $IMAGE already contains the architecture. So are we creating images of name foo:bar-arch-arch? Do we actually want to do that?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

$(arch)' got removed from image to allow multi architecture build and tagging of images, -arch-arch` type of situations should be avoided under all circumstances

Choose a reason for hiding this comment

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

Sorry, Somehow I was convinced to have looked at all the commits, but did in fact only look at the initial 3...

Choose a reason for hiding this comment

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

Either way, that change to the variables in common should probably be put together with the changes to the user of these variables.

nit: The title of commit 4 is masking that quite a few things are happening apart from formatting. Ideally I'd split the formatting part from any functional changes to make reasoning about changes easier.

#!/bin/bash
# Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
set -e

Choose a reason for hiding this comment

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

Similar to above, I am not quite sure why we need -e here given the handling through die et al.

David Dornseifer added 4 commits April 23, 2025 11:41
* Added _docker suffix to docker build scripts
* Added multi architecture build to build_docker.sh script
* Added multi architecture build handling to push_docker.sh
* Added Helm package and push scripts
* Added utility functions to common.sh
* Fixed public ecr functions
* Introduced HELM registry related variables
* Added docker token reuse with 10s timeout
* Made generic user confirmation function confirm() zsh compatible
* Formatted common.sh
* Added `pipeline.sh` script for docker and Helm buid, packaging and release orchestration
* Added `validate_artifacts_versions.sh` script to ensure that k8s, docker and Helm version tags are in sync when releasing
@dpdornseifer dpdornseifer merged commit adc13a0 into main Apr 23, 2025
1 check passed
@dpdornseifer dpdornseifer deleted the feature/build_scripts_update branch April 23, 2025 15:08
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.

3 participants