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

feat: Add support to specify CPU architecture for the to-be-copied image #961

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

xiongbo-sjtu
Copy link
Collaborator

@xiongbo-sjtu xiongbo-sjtu commented Nov 29, 2024

This PR is meant to add a feature to specify CPU architecture for the to-be-copied image, by triggering the underlying logic here. This will unblock the usage of Graviton instances for Amazon SageMaker and other computing platforms.

@xiongbo-sjtu xiongbo-sjtu changed the title Specify CPU architecture for both image and Lambda feat: Add support to specify CPU architecture for both image and Lambda Nov 29, 2024
auto-merge was automatically disabled November 29, 2024 04:28

Head branch was pushed to by a user without write access

@xiongbo-sjtu xiongbo-sjtu changed the title feat: Add support to specify CPU architecture for both image and Lambda feat: Add support to specify CPU architecture for the to-be-copied image Nov 29, 2024
lambda/main_test.go Outdated Show resolved Hide resolved
lambda/main_test.go Outdated Show resolved Hide resolved
src/index.ts Outdated
/**
* The image architecture to be copied.
*
* @default - ""
Copy link
Contributor

Choose a reason for hiding this comment

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

please explain what this default means in the doc string

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated

*
* @default - ""
*/
readonly imageArch?: string;
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd probably lean towards this. What do you think?

Suggested change
readonly imageArch?: string;
readonly architecture?: string;

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

imageArch is intentionally used to avoid any potential confusion with the architecture field referenced by lambda.SingletonFunction in the ECRDeployment class.

Currently, our Dockerfile uses a hard-coded architecture GOARCH=amd64. If we'd like to allow customers to control what's used for the lambda function, we can uplift such a constraint and then expose lambdaArch as a sibling field of imageArch.

Hope that makes sense.

Copy link
Contributor

@mrgrain mrgrain left a comment

Choose a reason for hiding this comment

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

See inline comments.

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.

2 participants