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

add ephemeralStorage option to lambda config #4680

Merged

Conversation

nnnkkk7
Copy link
Contributor

@nnnkkk7 nnnkkk7 commented Nov 19, 2023

What this PR does / why we need it:
I added an ephemeralStorage optional value to the lambda configuration.

Which issue(s) this PR fixes:

Fixes #4679

Does this PR introduce a user-facing change?:
No

  • How are users affected by this change:
  • Is this breaking change:
  • How to migrate (if breaking change):

Signed-off-by: nnnkkk7 <kurodanaoki0711pana@gmail.com>

Signed-off-by: nnnkkk7 <kurodanaoki0711pana@gmail.com>
@nnnkkk7 nnnkkk7 force-pushed the add-ephemeralStorage-option-to-lambda branch from 1784872 to 38791cf Compare November 19, 2023 06:42
@@ -278,6 +281,9 @@ func (c *client) updateFunctionConfiguration(ctx context.Context, fm FunctionMan
if fm.Spec.Handler != "" {
configInput.Handler = aws.String(fm.Spec.Handler)
}
if fm.Spec.EphemeralStorage.Size != 0 {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if fm.Spec.EphemeralStorage.Size != 0 {
if fm.Spec.EphemeralStorage != nil && fm.Spec.EphemeralStorage.Size != 0 {

avoid nil pointer error due to the omitempty json tag

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you! I added it.
add nil pointer check

@khanhtc1202
Copy link
Member

@nnnkkk7 Thanks for the contribution. For this configuration, should we also add this to CreateFunctionXXX step as well? I mean the following 2 places
https://github.com/pipe-cd/pipecd/blob/master/pkg/app/piped/platformprovider/lambda/client.go#L111
https://github.com/pipe-cd/pipecd/blob/master/pkg/app/piped/platformprovider/lambda/client.go#L160

Signed-off-by: nnnkkk7 <kurodanaoki0711pana@gmail.com>
Signed-off-by: nnnkkk7 <kurodanaoki0711pana@gmail.com>
@nnnkkk7
Copy link
Contributor Author

nnnkkk7 commented Nov 21, 2023

@khanhtc1202
Thanks! I had forgot to add this configuration to CreateFunctionFromSource!
add EphemeralStorage input to CreateFunctionFromSource

@@ -100,6 +103,11 @@ func (fmp FunctionManifestSpec) validate() error {
return fmt.Errorf("architecture is invalid: %w", err)
}
}
if fmp.EphemeralStorage != nil && fmp.EphemeralStorage.Size != 0 {
Copy link
Member

Choose a reason for hiding this comment

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

This condition is wrong 🤔 If the size value is set to 0 the validate function will be bypass.

Suggested change
if fmp.EphemeralStorage != nil && fmp.EphemeralStorage.Size != 0 {
if fmp.EphemeralStorage != nil {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you!
I fixed these conditions! fix condition

Signed-off-by: nnnkkk7 <kurodanaoki0711pana@gmail.com>
Copy link
Member

@khanhtc1202 khanhtc1202 left a comment

Choose a reason for hiding this comment

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

LGTM, thank you 🎸

Copy link

codecov bot commented Nov 27, 2023

Codecov Report

Attention: 9 lines in your changes are missing coverage. Please review.

Comparison is base (8a4235b) 30.82% compared to head (8af45bb) 30.84%.
Report is 2 commits behind head on master.

Files Patch % Lines
pkg/app/piped/platformprovider/lambda/client.go 0.00% 9 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4680      +/-   ##
==========================================
+ Coverage   30.82%   30.84%   +0.01%     
==========================================
  Files         221      221              
  Lines       25935    25952      +17     
==========================================
+ Hits         7995     8004       +9     
- Misses      17289    17298       +9     
+ Partials      651      650       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@khanhtc1202 khanhtc1202 merged commit f10a8e7 into pipe-cd:master Nov 27, 2023
13 checks passed
@github-actions github-actions bot mentioned this pull request Dec 1, 2023
khanhtc1202 pushed a commit that referenced this pull request Dec 1, 2023
* add ephemeralStorage option to lambda config

Signed-off-by: nnnkkk7 <kurodanaoki0711pana@gmail.com>

Signed-off-by: nnnkkk7 <kurodanaoki0711pana@gmail.com>

* add nil pointer check

Signed-off-by: nnnkkk7 <kurodanaoki0711pana@gmail.com>

* add EphemeralStorage input to CreateFunctionFromSource

Signed-off-by: nnnkkk7 <kurodanaoki0711pana@gmail.com>

* fix condition

Signed-off-by: nnnkkk7 <kurodanaoki0711pana@gmail.com>

---------

Signed-off-by: nnnkkk7 <kurodanaoki0711pana@gmail.com>
khanhtc1202 added a commit that referenced this pull request Dec 1, 2023
* add ephemeralStorage option to lambda config (#4680)

* add ephemeralStorage option to lambda config

Signed-off-by: nnnkkk7 <kurodanaoki0711pana@gmail.com>

Signed-off-by: nnnkkk7 <kurodanaoki0711pana@gmail.com>

* add nil pointer check

Signed-off-by: nnnkkk7 <kurodanaoki0711pana@gmail.com>

* add EphemeralStorage input to CreateFunctionFromSource

Signed-off-by: nnnkkk7 <kurodanaoki0711pana@gmail.com>

* fix condition

Signed-off-by: nnnkkk7 <kurodanaoki0711pana@gmail.com>

---------

Signed-off-by: nnnkkk7 <kurodanaoki0711pana@gmail.com>

* Add v2 to versionWhitelist (#4682)

Signed-off-by: Yoshiki Fujikane <ffjlabo@gmail.com>

* [ECS] Tag to the new taskset in rollback (fixes #4692) (#4695)

* Tag to new taskset in rollback

Signed-off-by: t-kikuc <tkikuchi07f@gmail.com>

* Fix #4692 (ECS excess tasksets)

Signed-off-by: t-kikuc <tkikuchi07f@gmail.com>

---------

Signed-off-by: t-kikuc <tkikuchi07f@gmail.com>

---------

Signed-off-by: nnnkkk7 <kurodanaoki0711pana@gmail.com>
Signed-off-by: Yoshiki Fujikane <ffjlabo@gmail.com>
Signed-off-by: t-kikuc <tkikuchi07f@gmail.com>
Co-authored-by: naoki kuroda <68233204+nnnkkk7@users.noreply.github.com>
Co-authored-by: Yoshiki Fujikane <40124947+ffjlabo@users.noreply.github.com>
Co-authored-by: Tetsuya Kikuchi <97105818+t-kikuc@users.noreply.github.com>
sZma5a pushed a commit to sZma5a/pipecd that referenced this pull request Dec 17, 2023
* add ephemeralStorage option to lambda config

Signed-off-by: nnnkkk7 <kurodanaoki0711pana@gmail.com>

Signed-off-by: nnnkkk7 <kurodanaoki0711pana@gmail.com>

* add nil pointer check

Signed-off-by: nnnkkk7 <kurodanaoki0711pana@gmail.com>

* add EphemeralStorage input to CreateFunctionFromSource

Signed-off-by: nnnkkk7 <kurodanaoki0711pana@gmail.com>

* fix condition

Signed-off-by: nnnkkk7 <kurodanaoki0711pana@gmail.com>

---------

Signed-off-by: nnnkkk7 <kurodanaoki0711pana@gmail.com>
sZma5a pushed a commit to sZma5a/pipecd that referenced this pull request Dec 17, 2023
* add ephemeralStorage option to lambda config

Signed-off-by: nnnkkk7 <kurodanaoki0711pana@gmail.com>

Signed-off-by: nnnkkk7 <kurodanaoki0711pana@gmail.com>

* add nil pointer check

Signed-off-by: nnnkkk7 <kurodanaoki0711pana@gmail.com>

* add EphemeralStorage input to CreateFunctionFromSource

Signed-off-by: nnnkkk7 <kurodanaoki0711pana@gmail.com>

* fix condition

Signed-off-by: nnnkkk7 <kurodanaoki0711pana@gmail.com>

---------

Signed-off-by: nnnkkk7 <kurodanaoki0711pana@gmail.com>
sZma5a pushed a commit to sZma5a/pipecd that referenced this pull request Dec 17, 2023
* add ephemeralStorage option to lambda config

Signed-off-by: nnnkkk7 <kurodanaoki0711pana@gmail.com>

Signed-off-by: nnnkkk7 <kurodanaoki0711pana@gmail.com>

* add nil pointer check

Signed-off-by: nnnkkk7 <kurodanaoki0711pana@gmail.com>

* add EphemeralStorage input to CreateFunctionFromSource

Signed-off-by: nnnkkk7 <kurodanaoki0711pana@gmail.com>

* fix condition

Signed-off-by: nnnkkk7 <kurodanaoki0711pana@gmail.com>

---------

Signed-off-by: nnnkkk7 <kurodanaoki0711pana@gmail.com>
Signed-off-by: sZma5a <masaaki.haribote@gmail.com>
sZma5a pushed a commit to sZma5a/pipecd that referenced this pull request Dec 17, 2023
* add ephemeralStorage option to lambda config

Signed-off-by: nnnkkk7 <kurodanaoki0711pana@gmail.com>

Signed-off-by: nnnkkk7 <kurodanaoki0711pana@gmail.com>

* add nil pointer check

Signed-off-by: nnnkkk7 <kurodanaoki0711pana@gmail.com>

* add EphemeralStorage input to CreateFunctionFromSource

Signed-off-by: nnnkkk7 <kurodanaoki0711pana@gmail.com>

* fix condition

Signed-off-by: nnnkkk7 <kurodanaoki0711pana@gmail.com>

---------

Signed-off-by: nnnkkk7 <kurodanaoki0711pana@gmail.com>
Signed-off-by: sZma5a <masaaki.haribote@gmail.com>
@github-actions github-actions bot mentioned this pull request Feb 6, 2024
sZma5a pushed a commit to sZma5a/pipecd that referenced this pull request Feb 12, 2024
* add ephemeralStorage option to lambda config

Signed-off-by: nnnkkk7 <kurodanaoki0711pana@gmail.com>

Signed-off-by: nnnkkk7 <kurodanaoki0711pana@gmail.com>

* add nil pointer check

Signed-off-by: nnnkkk7 <kurodanaoki0711pana@gmail.com>

* add EphemeralStorage input to CreateFunctionFromSource

Signed-off-by: nnnkkk7 <kurodanaoki0711pana@gmail.com>

* fix condition

Signed-off-by: nnnkkk7 <kurodanaoki0711pana@gmail.com>

---------

Signed-off-by: nnnkkk7 <kurodanaoki0711pana@gmail.com>
Signed-off-by: 鈴木 優耀 <suzuki_masaaki@cyberagent.co.jp>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

support ephemeralStorage optional filed for lambda
2 participants