Cannot Read Property 'length' of Undefined Serverless-plugin-browserify

@eahefnawy @ac360 how is the "overview" json file coming along on the 0.ane.0 co-operative that we discussed last week? I've looked through the 0.1.0 branch and practise not see a articulate mode to generate that output. I must be missing something due to the reworking of that lawmaking. Tin you aid?

I have minor s-project.json information flowing in a branch for the Dashboard and was holding off on flushing anything out until I had this main data structure

Generating a projection now off of the (0.1.0) branch to see what information technology provides

Ah ok, I encounter the s-project.json under 0.1.0 has "modules: {}" and the cloudformation template in at that place, so I retrieve this gets me plenty of what I need

My only question at present is: Will there be a "functions" object under "modules" in s-project.json or will information technology be at the same level?

I'yard getting an error on 0.one.0 when trying to create a module, so I presume that's still in the works.

@ryansb @Nopik @joostfarla @doapp-ryanp @marklawlor @michaelwills @shortjared - serverless/serverless#460 - "On Containers In Serverless"

@kevinold Sorry, we're debating a few terminal issues.

I spent a lot of time looking into JSON Schema and Immutable.js subsequently our talk.

I love both of them, but i felt they may exist overkill for what nosotros want to reach.

In v0.1.0 we're introducing a nice Project Variable/Module Template system, but having variables/templates in our data doesn't jive well with how JSON Schema likes to practice things. All JSON Schema validators throw errors because of our Project Variables/Templates. It seemed like pain to work around.

Further, I similar Immutable.js, but I wasn't super excited about the API and making anybody use information technology or possibly providing more convenient wrappers around it. Later some thinking, I realized we already take immutability in that the data is persisted on the file system, until its overwritten.

Ultimately, we decided that all we really needed to non over-engineer things is to make some Classes for the data that Serverless works with, that feature convenience methods.

Instantiating a Projection grade will give you a full javascript object of an entire project.

Including all modules and functions.

I'yard going to follow up with you @kevinold on the Dashboard in merely a few more days. Just desire to become a scrap more feedback on the new release.

@ac360 Awesome and no worries I encounter your points about JSON scheme and Immutable. Take your time getting back to me I think I tin can run with what I accept on the 0.1.0 branch :)

@kevinold The terminal modify nosotros're because is the container approach outlined in the issue higher up. Otherwise, we're just finsihing testing the CLI and we're almost at that place!!!

The container approach is interesting. And to some extent is how we are treating modules in exercise right now quite frankly. Giving united states of america a solid dependency base per container with some secondary tier of logical system makes sense I recall. It still doesn't entirely solve for syncing dependencies project wide though without building some new finctionality to traverse and install deps in each container though.

I similar what I see with the containers @ac360 and the new classes to assist consilidate functionality. I'll be poking around to get a feel for it.

Cheers for the feedback @shortjared. I think to share code beyond containers it should be properly modularized as a linguistic communication-specific parcel.

Also, @shortjared the weblog links on Trek10.com are broken in the "Read Pro Tips On Our Web log". It's an piece of cake fix though.

Cheers @michaelwills let's see what anybody else says

given that structure, I am on the fence for how much the framework should dictate dependency management. Assuming containers are all tiptop level and then information technology's always projection -> containers -> container I could come across dissimilar plugins allowing you to practise whatever yous desire, merely not make it part of core. Only as said, I am on the fence.

That's partially considering not but is SLS young, just the whole paradigm being developed is besides young

I'thou sure they are, I got into a long drawn out fight with Jekyll and Jenkins over XMas. Notwithstanding trying to cleanup the mess. Thanks for the heads up.

@shortjared ouch! that is non the way to spend the holidays heh. Hope anybody (erm… system) has fabricated up and are friendly again ;)

@ac360 One of my biggest pain points right now with the framework is that every bit we iterate on things and add dependencies, half the fourth dimension I accept to become run npm install in diverse modules to get everything working

Information technology would be great to take some manner to just sls dependencies install or something to resolve it across the containers.

right, but should that exist in core? given that at that place are and then many different possibilities?

put another fashion. @ac360 would you like SLS to be opinionated on this issue? Or be *nix-ish in principle?

@michaelwills it was a big series of unfortunate events and kinda hilarious stupidity. I made a Jenkins build dashboard and a bunch of builds that flashed red and light-green builds rapidly to put up on or office dashboard for Christmas decorations. Some 300,000 builds after our Jenkins cluster decided to give upwardly on life and only accept everything with it. Ended up screwing with our website build pipeline and aye. :+1: still worth it.

Allow tools to develop that mankind out the best practice?

Right @shortjared. I think bigger portions of projects will be put into containers which will assistance avoid that. And if you lot only have 2-three containers per projection, it should be much easier to deal with dependencies than having separate dependencies at the module level.

The container will exist more than akin to a microservice, than modules were

@shortjared my kids are trying to sleep. I almost woke them upwards with that. I really had to stifle the laugh (considering the reason heh) but I experience your hurting

Arguably if you have several containers y'all could just have a bootstrapping script that runs the dep installers for each container and so. that could make sense.

Too, gitter mobile app likes to transport my messages before I am done writing them. sorry about those half letters.

even a _.merge(localdeps, projectdeps) kind of matter

I call back it's won't be an event putting a lot of logic into a single container

where it'll pull/merge from the projection for it'due south local package.json earlier boot off the build

But we'll see. A convenience command to install all dependencies would certainly be helpful.

my only overriding thought to those kinds of commands is to go on to develop plugins so core doesn't have to change as different build strategies are introduced

it seems like (not proven equally i haven't written any) that either the current or planned plugin architecture supports that

I totally agree on containers containing big chunks of logic. I know exactly how I would split up our electric current app to handle it correct now and it would actually be a fairly convenient distinction. Deploying a "container" (and the underlying modules / functions) seems like it would be a natural thing to practice besides.

Yes the containers help naturally define domain boundaries

correct now I accept java workers for a specific task, but already know i need some types of analysis washed in python, and some in node

Alright, I'm going to slumber on it and see what other feedback comes in. If it'due south good, information technology tin can be added to v0.i.0 fairly easily.

natural fit for what you laid out there @ac360

@michaelwills We demand to get Java into the framework. This is going to exist our next huge priority. Could you aid?

We merely need some architectural opinions.

We're going to hire someone to focus on Coffee.

But we desire to make sure we move in the correct management.

I am not a java guru merely I can go around a flake.

I can requite opinions. That's easy. Giving good opinions though… heh. As I grok the nodejs and python implementations though that'll make information technology easier

For java, specifically for dependencies, it'south more a matter of setting class paths and gathering the classes to build the jar. it seems easier than both python and nodejs but I am only getting a handle on basic gradle. Easier to reason about than maven for me.

and java beingness a compiled jar it makes it easier as well. compile, zip, stash it to the lambda.

I like the idea of "containers" but I'thousand non sold on the terminology. I'm wondering if it could cause confusion. Going to continue to think on it.

Did anyone else have to think about what or how containers fit in the structure?

Just bringing up the point that nosotros alive in a time where "container" is becoming synonymous with "Docker" and I'thousand wondering of someone new to the project might become confused with it

that'southward the first thing I thought of also and got all confused lol

Maybe they could be called bottles, crates, tubs

Gotta practise some thinking on what (if anything) I tin can suggest. I almost experience like "containers" are the "modules"

What's slap-up about that is that it's terminology well-nigh everyone is familiar with (at least in the Node ecosystem)

On the shared code piece of #460 I'd love to keep it simple with a "shared" binder

like project -> modules -> component -> part

you striking the boom on the head with component!

If yous like information technology give thanks @obie. I read his book last night and it got my brain going in my sleep ha. Merely your containers are modules clicked.

that's exactly the kind of structure/terminology currently floating around and (likely) something that someone new could pickup

Well, that "containers are modules" thing was just my take on the situation

Still trying to reason it out :D

Naming things is extremely hard

isn't "naming things" one of the hardest things in CS? heh

lol great minds call back alike!

we were typing at the same time @michaelwills :D

exactly heh. I do like that nomenclature though.

the thought is we are managing micro services which are loosly coupled but related by domain

the module encapsulates a domain (or at least it could) and I can reason nearly the disparate functions (aka methods) of a component

but yeah still processing it as well heh

ah, "domain" is another term that I call up would click better than containers in this context

that was my get-go thought but I couldn't detect a expert way to break it down from there to role.

yous could do domain -> component -> function equally well

I'g actually because suggesting: project -> modules -> module -> function

So, thinking on "component" for a minute, and wresting with what information technology is...

Just seems like calculation a grouping of modules (and calling it modules vs containers) would exist the mode to go

I do similar domain too, and can see it's context with shared lawmaking for a certain runtime (node, python, etc)

You know, a "domain" of node modules, a "domain" of python

yeah part of my idealistic hope is:

  • let the naming be clear to establish intent
  • allow the framework be light enough to do what it needs to do
  • let the ecosystem past flexible enough to allow devs practice what devs demand to do
    where in this example the structure is an aid to developers, but non a burden to exist borne past the framework developers. I could run into folks coming up with gulp, grunt, brocolli, gradle, maven, fabric, (insert favorite tool here) or whatever to do whatsoever they need so long as the contract is fulfilled

Interesting word. I wrestled with the name too.

service - modules - functions

If we are going total microservice

well that gets back to an earlier question I had for y'all @ac360 . How opinionated do you desire SLS to be?

should it be biased towards microservices? In what style?

I don't think it'south right to be opinionated. At to the lowest degree, non right now.

We've got tons of use-cases, unlike many traditional frameworks

I don't mind component. We've considered that and several others in the past.

One matter we haven't thought through is how this container tier of arrangement can piece of work with other container systems, like Docker.

More than ever, it would be easier to either deploy to Lambda or Docker

Don't know what the implications are, if whatever.

The overlap is interesting though.

so in theory, the "build" process, prepping a role for a deployment, tin target lambda, a docker image, some new container that comes out this year, etc.

lol, yes. Let'south keep information technology focused on Lambda for at present

just the signal is valid. similar java and other languages that have overloaded methods, you tin can accept different entry points depending on the terminal destination.

Right. Theoretically, in this container scenario, Lambdas are only copies of the same (Docker) container, with different entry points. We already zero upwardly the entire container into the Lambda role.

That only changes when we optimize for a particular entry point/job (aka Lambda).

For example, when we browserify.

Just thinking of tutum as a target heh

orchestrating docker is a whole other can of worms though in that location is good work going on

just catching up on the conversation

And with the context @ac360 "container" is growing on me. I practice recall we would end up explaining how container fits in the terminology in a FAQ somewhere...

I'm going to sleep on it, but I'chiliad definitely on the debate at present.

Same. Yeah, iteresting discussion here :)

Calling them containers might help bridge the gap new folks have with understanding what Lambdas are

:D Yeah, all skilful stuff hither

the fact that they are multi-lingual being core to that

Curious to run into what @joostfarla and @Nopik say heh

Yep, I'll check the feed every bit presently as I'g up tomorrow

hey. is having optional url params using wrong? "requestTemplates": { "awarding/json": "{\n\"limit\": \"$input.params('limit') \", \n\"position\": \"$input.params('position') \"}" },

Overnice discussions going on here! I've had the same thoughts regarding naming the stuff.

Nosotros could also proper noun them only apps, which might be less opiniated than service, container or domain.

app -> module -> function

each app could have its own CF stack, restApiId, etc

to make them fully contained

I like app there. Clearer than "domain"

I haven't grokked the templating merely I would imagine making them independent that way is doable.

app -> component -> office. Trying information technology out for size. :)

I could live with app -> module. gitter poll anyone?!

If nosotros desire to back up (merely not enforce) multiple microservices in 1 project, I think we too should divide the whole config/CF part.

@swarajgiri I can't say authoritatively but information technology doesn't seem like it should be a problem. Do y'all become an error?

apps/${appName}/modules/${$moduleName}/functions/${functionName}?

then the dependencies would live in the apps/${appName} dir

@joostfarla making the structure explicit. More folders in the hierarchy but clearer separation of concerns.

Ah and allowing other groupings for dependencies, configs, etc.

@michaelwills I agree the nesting is becoming quite deep, but I consider that as a negligible drawback

apps/$[appname]/lib for a java runtime, apps/$[appname]/node-modules, etc.

@michaelwills bounden each app to a specific runtime sounds reasonable to me, merely not certain if this volition friction match other people'south use cases

if you didn't then you'd need a convention for apps/$[appname]/java_lib apps/$[appname]/node_modulesand not sure what python would do in this case

@michaelwills don't think that will hold though, my vote goes to a unmarried runtime per app :smile:

@joostfarla Yep information technology would get very hairy. Did you lot take a await at #460 already?

@michaelwills yes, I like this idea!

accept to swoop in more than though to respond to the latter parts of the issue

I'm favoring eliminating the extra folders. The extensive directory structure is only non nice to work with

temp.png

We can e'er use s-.json files to detect what a folder is.

Let me know what you think whether this helps solve dependency direction issues.

I believe it does and information technology incorporates lots of your previous ideas.

@ac360 what I like almost the extra nesting is the explicitness of intention. Non doing this could make things quite messy, since eventually a lot of other dirs will be added (config, lib, templates, to name a few)

Sorry, take to exit now. Take to serve the governement today, so volition exist off until the evening probably.

temp.png

temp.png

Information technology offers explicitness where it is needed nigh: at the container level.

and not the added verbosity/folder structure at the part level.

Alright, definitely going to sleep now. Goodnight all!

@michaelwills i also like option 2, best of Vith worlds

I am partial to it. Gives some breathing room for the folders as you noted, just keeps it more curtailed at the office level

Don't mind the typo's, Gitter on iPhone sucks

ha my encephalon translated it without my fifty-fifty noticing. scary.

How can i change aws admission key in my installed serverless package ?

@hiteshj They are stored in admin.env in the root of the project

@joostfarla Thanks i found it

Howdy all- My squad keeps multiple AWS accounts for complete environment/stage sectionalization to avoid operational bug (messing with the incorrect Dynamo tables, etc.). That said, does Serverless have support or guidance on how to leverage the framework across multiple accounts since it uses a CF template, IAM roles, an S3 bucket, and hardcoded API access keys?

@ac360 If y'all have thoughts on my question to a higher place, your input would be greatly appreciated!

Nosotros'd like to keep an E2E environment in each account with our SLS stages mapping to dissimilar API gateway stages and use custom domains/DNS to map them properly

@michaelwills - The consequence was with the spacing.

                              {                \n                \"limit\":                \"                $input.params('limit')\",                  \n                  \"position\":                  \"$input.params('position')\"                \northward                }                          

If i leave out a empty space before the closing curly, api gateway throws an parsing fault.

Question : Is there is reason why nosotros use json files for config? We could apply a js file and export the entire json. Advantage would be, it would save usa from writing such a ugly and error prone mapping template

@swarajgiri Hmm hadn't seen that particular error for CF. But glad yous worked information technology out!

Exercise you meet how the this could exist a problem when someone is trying out a non-trivial mapping?

As for JSON vs JS, in v0.i.0 which will be landing soon, at that place are templates to help ease the cosmos of the JSON files using variables.

Indeed I practise. I am nonetheless fairly new to CF but personally I'll likely utilise preprocessing when generating those $.25

is at that place an updated ETA for 0.1?

Next day or so. @ac360 will likely have more info sometime in the morning/afternoon Us time

wouldn't a simple js file solve all those problems of pre-processing and having templates rendered using variables to finally output a crazy json?

It could, and it is a valid betoken. I am not sure if it has been discussed before though so there may be reasons for it.

While v0.i.0 is prepping for release, this used to exist some other project called JAWS

this is a heavy refactor of that projection

should i open up up an upshot in github or ping someone here for more info in json config files?

You can open an outcome and if you're available in the next 12 hours ping here as well.

Time for me to get some sleep now

hullo, how tin I deploy a module resources?It looks like that the nuance control only takes care of api gateway and function merely it does not trigger the module's resources deployment

just this is going to deploy only the resources declared in the resources-cf.json

i demand to deploy the one alleged in due south-module.json

"sls module install" looks like information technology updates the resources-cf with your changes in s-module.json

later you can use sls resources deploy

Documentation all the same lacks some stuff I approximate

ok but i what if i create the module within the project?

@ac360 cheers for the update virtually lambda api. looking frontward to aws team to improve their api ;)

@ac360 @zevmo you lot want me to attend that discussion as well?

@ac360 later xmas i'm slightly behind in following the contempo happenings in sl world, will become through 460 and some other discussions (#428?) asap

at that place's no support for dynamoDB / lambda trigger events right?

@picsoung - try adding this in your PolicyDocument in resources.cf.json

              {               "Upshot":                                  "Permit"                ,               "Resources":                                  "*"                ,               "Action":                [                  "dynamodb:*Item",                  "dynamodb:Query",                  "dynamodb:Scan"                  ]                }            

Once done, deploy sls resources deploy

thx @swarajgiri looks like what I already had

did it piece of work subsequently deploying?

does the function run locally?

have you added any env values locally that you might not take published? sls env listing

                          "PolicyDocument": {              "Version":              "2012-ten-17",              "Argument": [             {              "Outcome":              "Allow",              "Resource":              "*",              "Action": [              "dynamodb:*Item",              "dynamodb:Query",              "dynamodb:Browse"              ]             },             {              "Effect":              "Allow",              "Activity": [              "logs:CreateLogGroup",              "logs:CreateLogStream",              "logs:PutLogEvents"              ], …          

thats what I have

                          "PolicyDocument": {              "Version":              "2012-10-17",              "Argument": [             {              "Effect":              "Allow",              "Activeness": [              "logs:CreateLogGroup",              "logs:CreateLogStream",              "logs:PutLogEvents"              ],              "Resource": {              "Fn::Bring together": [              ":",                   [              "arn:aws:logs",                     {              "Ref":              "AWS::Region"              },              "*:*"              ]                 ]               }             },             {              "Effect":              "Allow",              "Resource":              "*",              "Action": [              "dynamodb:*Item",              "dynamodb:Query",              "dynamodb:Browse"              ]             }           ]         },          

thats exactly what i take

did you declare anything on "Resources"?

started from scratch.. and works

first real contribution in gitter. Time to become a beer, i suppose

i recollect he is creating the tables there

@picsoung is there an error bulletin you can run into in cloudwatch?

@ryansb it was {"errorMessage":"User: arn:aws:sts::ACCT_ID:assumed-part/sls-API-evolution-r-IamRoleLambda-2WB4JUNVM9Q6/awslambda_225_20160106140349268 is non authorized to perform: dynamodb:PutItem on resources: arn:aws:dynamodb:us-eastward-1:ACCT_ID:table/MyTable","errorType":"AccessDeniedException","

Perfect, so where he defines the IAM permission you lot can add

                              "dynamodb:PutItem",                "dynamodb:UpdateItem",                "dynamodb:DeleteItem",            

and that should fix your perms right up

(might as well be skilful to file a pull request so other folks don't striking that)

the *Particular office seemed logic to me :P

Yeah, I don't think you can put wildcards in the centre of permissions

I recollect they're only supported for the end of strings

guess this fourth dimension I am behind the IAM times (hehe, puns)

Does anyone know of a module that will send to SNS someday there is an error on any lambda part in a stage?

awesome, i volition exercise thanks!

I'g really not big on putting containers/components as another namespace, I similar @marklawlor's thought for lightweight grouping/teaming of modules and keeping runtime boundaries at the module level

especially for polyglot teams (which is function of the attraction of Lambda)

@ryansb If we allowed for only 1 runtime in a project (therefore treating projects similar the containers we've been discussing), would this be the worst thing in the world?

You lot simply have a Python project or a Nodejs project

Definitely non "worst in the earth", but 1 of the up sides of Lambda is that you tin accept polyglot services in one projection, and still have the same deployment/monitoring/logging/so on

and it'd split the module ecosystem pretty badly

because you'd see "ooooh, absurd a new sls module, I'll download"

then all of a sudden "oh...it's in {python|node} and my project is in $OTHER"

so suddenly that little slice of functionality would have to live in its own project if you still needed it

@ac360 Non a fan of single projection runtimes.

@ryansb good point for module level runtime language with sls module install.

@shortjared What's the downside for yous?

technically everyone is. I rely on it for hugo-lambda since it has a monster Go binary

no worries - it's i of those things that happens "nether the hood" without yous doing annihilation

but it's really good to know about.

And I am pretty sure I am much more than a n00b than you ha

does anyone use it to make long running connections to dynamodb? If not, lambda does create a new connection, unless of grade the container is nonetheless alive and kicking

Assuming the connection was initialized outside of the handler, according to the freeze and thaw in your link, there is a gamble the connection tin exist reused.

temp.png

@eahefnawy What do you think of this?

Containers are renamed to components. Modules are put directly into the component folder, reducing folder nesting.

so app is a projection in that screenshot?

so it's {projection}/components/{module}/{function}/<files go here>

Yes, nosotros'll rely on the south-.json files to determine what is what

can I ask why we even need components in that case? since the general effect is basically s/modules/components/

I feel like we'd get the same (or near the same) do good from replacing dorsum/modules with just modules

and the bonus of "we don't take to modify the docs much"

and for my thought about groups/teams of modules, it'due south occurred to me that when we deploy a function information technology doesn't matter if information technology's deployed a bit earlier something it depends on, since the lawmaking won't run until invoked

@ryansb I agree. However this allows for easiest dependency management and a articulate identify for shared code lib. Above all, these are patterns lean towards well-nigh in the framework, and I'm nervous nigh disrupting that.

yes I'one thousand with @ryansb on that

@ac360 in that scenario, components or module or both will be shareable/installable?

components are not shareable/installable

They are just a line in the sand that says "this has x runtime, and the lawmaking here will be packaged together"

I still have a gripe about that for deployment size. Using components would mean we have to include component stuff in every module when it'southward deployed

@ryansb Information technology's a concern. Still, nosotros have some tools already to help that. Like excludePatterns and the optimizer plugin.

What if, instead of a nesting level, we used teaming/groups to share code

one sec, lemme make an example

I am definitely interested in the teaming/groups idea, I just haven't seen an example yet.

              app |- modules    |- sessions       |- lib       |-                package.json       |- s-module.json    |- users       |- lib       |-                package.json       |- s-module.json |- lib    |- auth       |- s-team.json       |-                package.json       #                this                is                an installable                module                in                any linguistic communication            

then you would exist able to share code cross-module for each runtime

oh, forgot, in due south-project.json we'd ascertain teams/groups of modules with the lib directories they need

@ryansb when you lot say "installable module" do you lot mean a Serverless Module?

then dependencies stay slim, and irresolute dependencies/groups doesn't require moving whole directories

no, I mean in the language sense

and then it would exist an NPM or python module

at the level of lib/{proper name} so you lot'd have lib/name/{package.json or setup.py or whatever}

and you wouldn't be importing both {module}.lib and modules/lib, you'd have app.lib.foobar

or, in nodejs, require ../../lib/foobar

Actually, you wouldn't even have to define information technology in due south-project. Yous could do npm install or pip install against the ../../lib/foobar directory on deploy

so it'd be able to stay in the module-level parcel.json

This feels a bit complex to me and would crave a lot of testing to check for unintended consequences.

@eahefnawy What do you think?

I mean, all of these solutions feel (to me) more complex than "runtimes are module-level, any lawmaking you desire to share beyond that needs to go in a language-level package"

@picsoung Yeah, that repo is working for me in the AWS env. I just followed the "getting started" procedure for creating a role that has pretty much all privileges.

I was thinking teams could be something like this...

            app modules     module1      module2         function1             s-                function.json                            // Contains a "dependencies" property that specifies module1                      

If they depend on eachother, deploy them together

Hey guys! Trying to catch up on the chat.

I don't think it would be a very bad idea to allow ane runtime per projection, that would certainly simplify things.

@ryansb noted that would break the ability to install a module from some other language

            app modules     module1      module2         lib         function1         s-module.json              // contains a "dependencies" property that requires "module1"                      

my electric current project once it actually can run in sls would require python, coffee, and nodejs runtimes

@ac360 and a dependency in this context would mean running "deploy" would deploy module1 prior to module2?

@ryansb No, information technology means they are bundled together in the Lambda.

Just like building blocks.

so module1 and module2 would be merged?

This way people can create i module, and the community tin create additional modules to extend it too

We wouldn't need the containers at all

This goes well w/ infrastructure resource management too, I believe

I experience similar that'southward a recipe for "oops I broke everything" in this example:

  1. module1 exists, and is depended on past module2
  2. module1 makes some breaking alter and is deployed
  3. Everything is fine, module1 and module2 piece of work
  4. module2 is deployed for some unrelated change
  5. the change in module1 breaks module2
  6. Developer doesn't know what to whorl dorsum, since his module2 alter is working

I recollect conflating modules as both a functionality unit (a group of programs working toward X) and as a library (something required/imported to other code) is way disruptive

I was just about to ask the same question.

my initial agreement was that a module was just a standalone chunk of functionality to make use of.

significant if nosotros install a module we get access to those prepackaged lambda functions.

which brings me back to having shared code above the module level managed past the language dep management/packaging systems, rather than making a new one ourselves.

@ryansb Isn't that scenario truthful for Lambda evolution in general?

Fifty-fifty with a shared lib folder, that scenario notwithstanding happens

Yes, but that'southward within a module boundary

and is why I'm against sharing a lib to a higher place module-level

and with language packaging, you can pin the "known working" version for deployment

so your libraries (that are linguistic communication-packages with pip/npm) can advance and brand changes without breaking all the things

@ryansb speaks my mind today :D

I agree with mostly everything @ryansb shared ... although I'm still not sold on the teams/groups proposal either, getting too complex :/

With the module -> module dependency scenario, we could too add versioning.

my version of "teams/groups" is just a "this module needs the API provided by this other module"

so you can rely on your Residue API for users/auth beingness available to your search or whatever else API

just like in normal infrastructure that used microservices

@ryansb in your instance, is the auth module a complete standalone module?

in my case, the auth module is a microservice that provides auth stuff like making session tokens, checking passwords, and so forth

but information technology can integrate into your own organization like dynamodb for shared state

just I experience we're over engineering this...I'1000 with either keeping it the way it is now, or keeping Serverless projects single runtime, which is even simpler

no, this is a microservice-style where to practice auth things in other services, yous use the auth API

in any example, groups/teams aren't required to set the dependency trouble, so we can ignore that totally for now

so auth could be based on messaging or rest API that the module exposes

and each module in the height level Lib are just deployed independently

and in fact the structure mirrors the rest of the app

app/modules/module, app/lib/module

and those are really just burn and forget. only install and deploy for those in that lib folder.

+ane for relying on npm to handle packet/version bug

@jagthedr but npm only looks for node modules

I'm not sure if yous guys are bachelor, merely would you desire to hop into a Hangout to chat about this? I experience similar we could become it washed a bit quicker "in person"

My gut feeling says we will face lots of other challenges once we try to mix up different runtimes in a unmarried project.

(or schedule for another day)

We could provide three different projection templates (for each runtime)

which are adapted to the native build and dependency workflow

@ryansb an occasional non-regular office hours could be cool :)

I don't see how that'd exist easier than module-level everything, since part of the reason nosotros like modules is that they're portable to whatsoever sls project

wait sorry yep not project but module

because it would basically plow our module system from "serverless modules" into iii different systems, one for each runtime (and more, as they add runtimes)

@joostfarla I exercise agree, simply I too recall keeping runtime at module level wouldn't be too difficult, maybe just equally uncomplicated actually

@eahefnawy Right. But that would bring united states back to the dependency discussion, where this all started ;)

yeah, but I call back the best resolution to the dependency consequence is to brand those module-level-only

Hi all, only fix up a bare serverless project for the start fourth dimension. Loving the concept and then far. Are there any examples for creating a basic Rest API using dynamodb?

@bendavis78 yeah, 1 sec I'll link you lot

@ryansb I do want to conversation again with you (and everyone), simply don't want to jump on a call just however. To be honest, I'chiliad still a piffling slow to empathise your proposal. I'm lamentable to trouble you, but could you write it out in an upshot, so that we tin can all review it thoroughly? I'yard also trying to quit java today, so moving slowly in general (probably the incorrect solar day to quit coffee).

heh, it's never a bye to quit coffee

and yeah, I've iterated on it a couple times equally nosotros've talked in that event and in gitter

I'll write information technology out and @ y'all in it

@ryansb that last version is sinking in though.

@ac360 @ryansb Some clarification on the team/group idea would be great, since it's kinda hard to follow reading back

Suggestions are coming from every bending on this issue, so clear proposals really help.

And then nosotros can give it the consideration it deserves :)

Really think we're getting somewhere, with so many people sharing thoughts and looking from different angles :)

@joostfarla I'll do that separately

omg, x more than stars and we'll hit 6,000! :tada: :D

Yeah, I can't help just be amazed past the level of input here :)

Tracking the pros and cons might help.

Information technology'due south overwhelming, but and then cool...

ah, I see how the multiple runtime affair would brand it tough to bundle/version modules

@michaelwills Yous're right

if we tin can avoid creating our own package direction platform I recollect everyone will be saner for it...

@jagthedrummer yes that is agreed. It's just how much meta direction needs to exist added

TBH if it's possible information technology'due south just making sure the package managers fulfill the contract.

@ryansb Would you exist open up to writing out a short proposal in a Google doc? I'd like to put them all in one place as well as their pros and cons

I am not sure however what the module contract is.

gather all the dependencies and code for a function to set to be zipped

@ac360 @eahefnawy do you have a clear moving picture of the business organization the packet managers ain vs what SLS owns?

similar "given this set of files here, here, and hither, get together information technology all up in this tmp dir"

It might be worth incorporating plugins in the whole discussion, since these could potentially exist used to distribute / generate modules.

I know there'southward a lot of churn in the codebase at the moment with the push button to become to 0.i.0, so I realize this may not exist top priority, simply it would be lots easier for people to contribute if in that location were instructions on how to run the tests (and if they were all green)

(^ unrelated to previous convo)

@jagthedrummer that's in progress.

Information technology is a priority just non at the top of the list

I took an initial stab in primary but Get/SetEnv still failed

Example: if https://github.com/serverless/serverless-slackbot would be a plugin, this plugin could contain template code for generating a "Slash control" module. Past using Serverless create commands, a new module could exist generated for each "Slash command", having its own isolated cantankerous-function code and endpoints. Shared code is then versioned (because information technology resided in NPM) and can be called from all different modules.

It needs to be updated for v0.1.0

Does anyone have a working example of using sns (created programmatically) with lambda function?

@michaelwills I briefly looked at your PR for that, and I think the Get/SetEnv stuff was due to either a missing ENV var or maybe it was that the test harness wasn't catching an ENV var and over ridding some of the defaults. In either case at that place were still a lot of tests that I couldn't get to run locally, and I'm non certain why. I started to await into information technology and then realized that the 0.1.0 co-operative had diverged and so far that it would probably be wasted effort to figure it out on master.

@Alua-Kinzhebayeva practise yous hateful creating information technology? or doing something subsequent?

@Alua-Kinzhebayeva you might consider using @obie 's lib Saws

@jagthedrummer sounds almost right and that is where I ended upwards. key 'moduleone' tin can't be found but I haven't been able to get that resolved merely nonetheless

@Alua-Kinzhebayeva i normally lurk in this channel, feel free to striking me up if you lot demand assistance with it

also quite open up to suggestions for enhancements and additions... i'm casually adding to information technology every bit we need functionality on our own serverless project

@ac360 is my proposal the "module dependency" 1?

or do I make another department? These term overloads are killer

@ryansb lol, no That'south something unlike

I call back @eahefnawy are leaning towards the Container approach, with the name "Component" instead, and removing the "components" binder in favor of having each component listed directly in the project root

We're going to look for @ryansb's proposal considering of his heightened level of intelligence :) But that'south where we are at ATM.

@ac360 that implies back folder goes away?

I call up all the candidates (including mine, which I'm virtually to write out) impale back/

Hi, all. Been gone for awhile. Back and building a new project on sls while in parallel continuing with a JAWS-based project.

Running sls 0.xv, I'm trying to do something quite unproblematic: sls env set -s local -k foo -five barand am getting the following error:

                              /usr/local/lib/node_modules/serverless/node_modules/bluebird/js/main/hope.js:                677                throw                eastward;             ^                                  TypeError:                Cannot read property                'length'                of undefined     at EnvSet.cliPromptSelectRegion (/usr/local/lib/node_modules/serverless/lib/ServerlessPlugin.js:                274:52)     at                /usr/local/lib/node_modules/serverless/lib/actions/EnvSet.js:                146:26                From previous                consequence:                at EnvSet._prompt (/usr/local/lib/node_modules/serverless/lib/actions/EnvSet.js:                145:12) From previous                event:                at EnvSet.envSet (/usr/local/lib/node_modules/serverless/lib/actions/EnvSet.js:                110:12)      at processImmediate [as                _immediateCallback] (timers.js:                384:17) From previous                event:                at                /usr/local/lib/node_modules/serverless/lib/Serverless.js:                212:25                at Array.reduce (native)     at Serverless.actions.(anonymous function) (/usr/local/lib/node_modules/serverless/lib/Serverless.js:                211:25)     at Serverless.control (/usr/local/lib/node_modules/serverless/lib/Serverless.js:                182:44)     at Object.<anonymous> (/usr/local/lib/node_modules/serverless/bin/serverless:                13:36)     at Module._compile (module.js:                399:26)     at Object.Module._extensions..js (module.js:                406:10)     at Module.load (module.js:                345:32)     at Function.Module._load (module.js:                302:12)     at Office.Module.runMain (module.js:                431:x)     at startup (node.js:                141:xviii)     at node.js:                977:3                          

I imagine this is something simple. Any insight?

@ac360 drawback of the container approach is that modules cannot import dependencies residing in plugins.

@joostfarla should they though? Would a plugin dependency exist needed in lodge to go along dependency versions consistent inside a deployed office?

We might need to gather some thoughts on how plugins play with modules

Furthermore, when installing lets say the cors plugin, would these hooks automatically employ to all containers?

Same for the optimizer plugin, should all containers be optimized (which is Node-specific atm) with the same config?

maybe require plugins to specify rules about when to run them (e.one thousand. only on nodejs)?

Yeah that sounds too circuitous

The longer i think most it, the more I Lena towards the single runtime approach

I still actually dislike it considering it fractures modules into 3 ecosystems (more as they add together runtimes)

okay some terminology for my clarification. a micro service would be but a single office. a module is simply a logical grouping of those functions. it'south a convenient way to package a group of functions. a dependent module is basically just a module that needs to take all of its functions configured and deployed to AWS.

not really, a microservice may contain multiple Lambda functions

@michaelwills I encounter a microservice at the module level encompassing multiple Lambda functions

a module is a manner to grouping functions into logical groups that would share code

many of ours accept an endpoint or two plus some outcome listeners

A microservice should exist a separate project imo

and often a module would map to a microservice

@joostfarla yous're probably right. we're planning to become with that arroyo with our greenfield projection at 2U

one repo per microservice

and so and then what does a module become? I unit of code-sharing and deps?

2 microservices could run on dissimilar versions of Serverless with different plug-ins enabled

Equally @Nopik would say, get the data correct first heh. Nosotros have different definitions of what would exist a microservice.

i recall it gives you the pick of putting multiple versions of a given microservice into play

that's one affair I similar about it

a lot of the states think that microservices should exist immutable

immutable in the sense that once it is officially released it won't alter

then once you deploy a stable microservice you just supersede it with an entirely new microservice

I'd humbly disagree - microservices should exist mutable, but have a strict contract for whatsoever API they provide

that takes a lot more bailiwick across an system

both ways take pros and cons

@joostfarla I tin't run across why a micro service should be a project with serverless

Of course, the fact that we're having this debate probably means that sls shouldn't take a stand up on information technology. I don't think nosotros should require a scope for a project

jumping into the middle of an informed conversation, but concur with @ryansb. They should have a strict contract that tin be extended merely not broken, but enforcing that they never change in one case deployed seems overly constrained.

a lambda is a micro service which = a module in serverless

and allow a project contain N modules

so you remember nosotros should but have a module per projection or a lambda+api maybe

if yes yous should only remove the module directory ...

I see a project every bit a grouping of micro services working together.

My opinion (and usage so far) has been module ~= microservice, and a project ~= one application

For me, modules are merely a way of grouping functions, naught more than.

isn't the module / function construction kind of arbitrary? It maps well to AWS Lambda, but that'due south a limited starting point. If you can be declarative either when you lot create boilerplate or in configuration files, does project / code structure need to be divers a priori? (Perchance adding unnecessary "flexibility").

That having been said, my usage to date has been project == application, module == logical / categorical grouping of functions

thou. So where does the more granular (module==microservice, projection==app) version fail in your workflow?

I think the structure has to exist minimal & make clean by default. if people want actress nesting for some reason they should be free to exercise that and modify paths in the config.

but arguably that's a NTH

Could be a nice plugin 😉

(kurt, who sometimes makes upwardly acronyms to feel smart)

I have this nagging feeling that somewhen there will be something akin to unix pipes that allow for really flexible processing to accept code and become it deployed.

stream processing for code

@joostfarla and @kfreytag how would y'all feel about cross-module lawmaking sharing being done with includes? And then you could take

              app (project) --modules (modules directory)                ----users                ------(various functions)                ----newsfeed                ------(functions)                --lib                ----auth_utils                          

I think there'southward going to exist platform-related reasons to have groupings of Lambdas

then you'd specify in s-module to include auth_utils in the deploy package

@ryansb - That seems most right.

is there a good reason to have a modules/ directory instead of letting the modules live there?

then you lot wouldn't need to practice linguistic communication packaging, could share lawmaking anywhere in a project, but it wouldn't artificially inflate deploy artifacts

@obie only because I wouldn't want to terminate people from naming modules whatever they want

that way the peak level of the projection could have other directories (idk...like more CFN stuff, or docs, etc) without them being mistaken for modules

@ryansb — shouldn't the framework infer from the require of auth_utils in both functions that it need be deployed with both modules?

I like option 1 in the Google doc, simply with the back dir left out

so you'd exist able to practice stuff similar for $i in $(ls modules)

programmatic inclusion is problematic

ok, I call up I have a plan that should work for everyone :) I've gotta run correct now, but I'll accept information technology up by tonight

I do like the idea of an opinionated identify to put docs, etc. I'thousand not quite sure where to identify my sql files, etc. right now

Yeah modules dir is necessary

yeah, then you could have dirs for modules, lib, schemas, docs, tests so on

anyways, gotta run, thank you a ton for all the feedback everyone. I'll @ you lot folks when I have my stuff written

Leaving also, thanx all!!

now, does anybody know why an sls env fix -s local is failing for me?

@ryansb makes sense thanks

@obie will these discussions impact the remainder of your book? :)

Regarding configuration, is there some way to propagate updated .env to deployed functions, or would you just redeploy the function?

@michaelwills yes they will :)

@kfreytag i saw aforementioned error when I tried to set env for a phase that was non created yet

hmm. I idea that local was a "reserved" stage that existed past default. no?

well looks like it is broken :P

just started playing with serverless today. project bootstrap setup evolution stage for me

yes. saw that. readme docs talk about local, which existed in JAWS and (I presumed) was carried-over to serverless

How long should a basic function deploy take? Seems like mine is hanging.

(first time I've tried this)

Actually this could've been my last session that hanged. I was running a terminal inside atom editor.

@bendavis78 my unproblematic functions deploy in seconds. likely depends on how large the zip is and number of deps you require()'d

@bendavis78 — which Atom terminal are you using? terminal-plus has been less than reliable for me.

powerspearouble.blogspot.com

Source: https://gitter.im/serverless/serverless/archives/2016/01/06

0 Response to "Cannot Read Property 'length' of Undefined Serverless-plugin-browserify"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel