softprops / serverless-rust

⚡ 🦀 a serverless framework plugin for rustlang applications
https://www.npmjs.com/package/serverless-rust
MIT License
541 stars 81 forks source link

Dockerless build option #58

Closed durangatan closed 4 years ago

durangatan commented 4 years ago

What did you implement:

In order to deploy my rust serverless project in CircleCI, I need a build process that doesn't spawn a docker container that mounts volumes.

From the circle ci docs:

It is not possible to mount a volume from your job space into a container in Remote Docker (and vice versa).

I added a dockerless option that, instead of spawning a container, simply builds the lambdas and zips them in the current execution environment. build.sh is ripped directly fromlambda-rust.

Not sure if this is something you'd want to make available in this plugin; I know it assumes a lot about the user's execution environment. I just figured I'd make a PR upstream since it was really helpful in my project.

Closes: #xxx

How did you verify your change:

What (if anything) would need to be called out in the CHANGELOG for the next release:

dockerless custom option.

softprops commented 4 years ago

this looks great. I'm trying to wrap up some integration test issues for dev profiles then I can switch over to this. The dockerless option makes a lot of sense

maxcountryman commented 4 years ago

@durangatan another way around this is to use machine instead of docker for your build jobs. For a more complete example, see my comment here.

durangatan commented 4 years ago

@maxcountryman thanks for pointing to that example. For my project the best option is to use the docker build type with a custom image (I need to install more than just rust and node).

stitchyourphoto commented 4 years ago

@durangatan I'd be interested in seeing this get merged in, however, it looks like there are merge conflicts. Is there anything I can do to lend some assistance?

durangatan commented 4 years ago

@stitchyourphoto I don't have bandwidth at the moment to complete this work but if you want to take a crack at it I wouldn't be opposed!

softprops commented 4 years ago

Sorry for dragging my feet on this for so long folks.

I wasn't sure how feasible this would be in practice.

I've built up some recent confidence in contributing what I've learned with this project to aws sam https://github.com/awslabs/aws-lambda-builders/pull/174. I think I've gained a little more exposure to how to do this natively and think I can now take what I've learned with my approach in sam and make it an option here which I can release as an opt in feature.