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

Support image tag property in lambda package-ci command #160

Open
2 tasks
NickDarvey opened this issue Mar 4, 2021 · 8 comments
Open
2 tasks

Support image tag property in lambda package-ci command #160

NickDarvey opened this issue Mar 4, 2021 · 8 comments
Labels
feature-request A feature should be added or improved. module/cli-ext p2 This is a standard priority issue queued

Comments

@NickDarvey
Copy link

NickDarvey commented Mar 4, 2021

-it | --image-tag looks like it is supported in package but not package-ci. Is this as designed?

LambdaDefinedCommandOptions.ARGUMENT_IMAGE_TAG,

public static readonly IList<CommandOption> PackageCICommandOptions = BuildLineOptions(new List<CommandOption>
{
CommonDefinedCommandOptions.ARGUMENT_CONFIGURATION,
CommonDefinedCommandOptions.ARGUMENT_FRAMEWORK,
CommonDefinedCommandOptions.ARGUMENT_MSBUILD_PARAMETERS,
LambdaDefinedCommandOptions.ARGUMENT_CLOUDFORMATION_TEMPLATE,
LambdaDefinedCommandOptions.ARGUMENT_CLOUDFORMATION_TEMPLATE_SUBSTITUTIONS,
LambdaDefinedCommandOptions.ARGUMENT_OUTPUT_CLOUDFORMATION_TEMPLATE,
LambdaDefinedCommandOptions.ARGUMENT_S3_BUCKET,
LambdaDefinedCommandOptions.ARGUMENT_S3_PREFIX,
LambdaDefinedCommandOptions.ARGUMENT_DISABLE_VERSION_CHECK
});

Describe the Feature

Allowing users to specify the tag for my Docker image using the --image-tag switch.

Is your Feature Request related to a problem?

The generated image tag (taken from the project name) might not be the one that's desired.

Proposed Solution

Unsure. Is this code base up to date with what is published as a dotnet tool?

Describe alternatives you've considered

Accepting life as-is.
Edit: It appears to work when set in aws-lambda-tools.defaults.json.

Additional Context

Environment

  • 👋 I may be able to implement this feature request
  • ⚠️ This feature might incur a breaking change

This is a 🚀 Feature Request

@NickDarvey NickDarvey added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Mar 4, 2021
@ashishdhingra
Copy link
Contributor

Not sure if this is feasible and how the image tag could be specified in the serverless.template. Needs more investigation.

@ashishdhingra ashishdhingra removed the needs-triage This issue or PR still needs to be triaged. label Mar 4, 2021
@NickDarvey
Copy link
Author

I'm not sure I understand. Right now, by default, here's a name:tag combo being generated from the project name and used for the Docker image build and push. You can already manually set it using aws-lambda-tools-defaults.json, this feature is a request to an option to specify it via a command line parameter.

@github-actions
Copy link

We have noticed this issue has not received attention in 1 year. We will close this issue for now. If you think this is in error, please feel free to comment and reopen the issue.

@github-actions github-actions bot added closing-soon This issue will automatically close in 4 days unless further comments are made. closed-for-staleness and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels Aug 13, 2022
@ik130 ik130 reopened this Nov 17, 2022
@ashishdhingra ashishdhingra added the p3 This is a minor priority issue label Dec 12, 2022
@normj
Copy link
Member

normj commented Apr 21, 2023

Because the package-ci command is potentially packaging multiple .NET projects that referenced in the CloudFormation template you need to set the image tag in there as well. If we had an --image-tag switch for for the package-ci command it would use the same tag for all of the containers being built from the CloudFormation template overwriting each other. Here is an example of how to set the image tag in the template.

image

@ashishdhingra ashishdhingra added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. and removed p3 This is a minor priority issue labels Apr 21, 2023
@github-actions
Copy link

This issue has not received a response in 5 days. If you want to keep this issue open, please just leave a comment below and auto-close will be canceled.

@github-actions github-actions bot added the closing-soon This issue will automatically close in 4 days unless further comments are made. label Apr 27, 2023
@NickDarvey
Copy link
Author

@normj

If we had an --image-tag switch for for the package-ci command it would use the same tag for all of the containers being built from the CloudFormation template overwriting each other.

Is that what happens when you set it via aws-lambda-tools.defaults.json? Maybe the tool should error if it’s used with multiple projects when an image tag is set. Then an image tag switch could be added which would, similarly, error if used with multiple projects.

@github-actions github-actions bot removed closing-soon This issue will automatically close in 4 days unless further comments are made. response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. labels Apr 28, 2023
@normj
Copy link
Member

normj commented May 6, 2023

@NickDarvey Interesting the image-tag being used from aws-lambda-tools.defaults.json is actually an accidental side effect since the package-ci command eventually forwards into the package command's code for each project it is bundling into an image. Although that image-tag isn't being used solely, the package-ci command does inject the CloudFormation resource name into the image tag to make it unique. Are you okay with the tag not being exactly as you entered. I guess what I'm asking is would you be okay if we exposed an image tag prefix/suffix switch but we still used our code to make sure the full tag name is unique?

@NickDarvey
Copy link
Author

Interesting the image-tag being used from aws-lambda-tools.defaults.json is actually an accidental side effect since the package-ci command eventually forwards into the package command's code for each project it is bundling into an image.

Ahh I see.

I guess what I'm asking is would you be okay if we exposed an image tag prefix/suffix switch but we still used our code to make sure the full tag name is unique?

That would work for me :)

@ashishdhingra ashishdhingra added queued p2 This is a standard priority issue and removed needs-review labels May 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A feature should be added or improved. module/cli-ext p2 This is a standard priority issue queued
Projects
None yet
Development

No branches or pull requests

4 participants