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 hook for deploying individual functions #91

Closed
wants to merge 2 commits into from
Closed

Add hook for deploying individual functions #91

wants to merge 2 commits into from

Conversation

johnf
Copy link

@johnf johnf commented Jan 26, 2017

As discussed in #60

@mhodgson
Copy link
Contributor

mhodgson commented Feb 1, 2017

I can verify that this works. Would love to get this merged.

@mhodgson
Copy link
Contributor

mhodgson commented Feb 2, 2017

Actually @johnf, I think you need to add .then(this.packExternalModules) as well for this to work for functions with external modules.

@johnf
Copy link
Author

johnf commented Feb 4, 2017

@mhodgson you're right. Have just fixed that

@deathweaselx86
Copy link

This would be wonderful.

deathweaselx86 pushed a commit to OwnLocal/serverless-webpack that referenced this pull request Feb 13, 2017
@kiawins
Copy link

kiawins commented Feb 20, 2017

Would also love to see some docs go along with this PR to understand how it could be used.

@johnf
Copy link
Author

johnf commented Feb 20, 2017

Hi Kia,

It's nothing specific to serverless-webpack, it is just enabling standard serverless functionality.

i.e. making sure that sls deploy function -f functionName works. This is a lot faster as it just re-publishes the new code to Lambda and doesn't run cloudformation.

Docs at https://serverless.com/framework/docs/providers/aws/cli-reference/deploy-function/

@johnf
Copy link
Author

johnf commented Feb 20, 2017

@thenikso any chance of getting this merged for another rc before 1.0.0 release?

@blakedietz
Copy link

Any chance we could pull this in?

@SkippyZA
Copy link

SkippyZA commented Mar 2, 2017

Also would really like to get this in asap.

@SkippyZA
Copy link

@thenikso is there any word on this PR? Would like to try avoid needing to fork this :/

@ShaunEgan
Copy link

Would also really love this to be merged.

SkippyZA added a commit to SkippyZA/serverless-webpack that referenced this pull request May 23, 2017
@hassankhan
Copy link
Contributor

Big +1, getting Code storage exceeded errors from AWS 😢

@HyperBrain
Copy link
Member

@hassankhan

Big +1, getting Code storage exceeded errors from AWS

I think that's worth an issue in Serverless. The reason most likely is, that SLS does set the DeletionPolicy of the deployed function versions to "Retain", which will never delete any deployed version. Then you'll run out of code storage sooner or later.

@hassankhan
Copy link
Contributor

hassankhan commented Jun 30, 2017

I'm not quite sure where the bug is, @HyperBrain 😕 . Spent most of last night trying to repair things as there was an issue with bundling. I have 19 functions, which together add up to ~40MB.

With package.individually = false, it seems that the deployment ZIP gets uploaded 19 times to Lambda. When setting it to true, it creates 19 ZIPs, but unfortunately inside the ZIP all 19 functions are present. Either way it seems it uploads ~760MB.

I started getting those errors, and incorrectly assumed it was to do with individual Lambda size. After much tinkering with Webpack, I reduced individual function size but continued to receive the same error on various functions upon CloudFormation deploy. Some of our other projects that are built by CI started failing with the same error, which caused a bit of a freakout 😓.

I finally clued onto the fact that I'd hit the 75GB hard limit by going to the Web Console and clicking Lambda. However, the Console was reporting total Lambda size as just over 1GB. It was then when I remembered that all deployed functions are kept unless pruned, so I tried to remove the stack but at this point CloudFormation was stuck in a UPDATE_REQUIRES_ACTION state.

After fixing that, I was finally able to remove the stack and redeploy. I'm still looking into why the packaging is weird - for now the only fix I have is to use serverless-prune-plugin till I figure it out.

@HyperBrain
Copy link
Member

@johnf @mhodgson @blakedietz @SkippyZA @ShaunEgan @deathweaselx86 @hassankhan
According to the comment in (#130 (comment)) this PR is superseded - as it seems that the ZIP file is not copied to the sls temp dir correctly. Can you please check if #130 works for you? I'd like to merge that then in favor of this one.

@johnf
Copy link
Author

johnf commented Jul 1, 2017

I think I commented in one of the others that I also prefer #130. I didn't close this for some reason though!
Will do so now.

@johnf johnf closed this Jul 1, 2017
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.

9 participants