serverless-rust icon indicating copy to clipboard operation
serverless-rust copied to clipboard

CI Pipeline Compatibility

Open lexi-ember opened this issue 2 years ago • 5 comments

What did you implement:

  • Add "strictMode" functionality
    • "strictMode" is on by default
    • When enabled, an error is thrown when no Rust builds are found
    • When disabled, the error is suppressed
    • "strictMode" can be disabled with custom.rust.strictMode: false
  • Fix validation warning
    • serverless does not accept "rust" as a runtime
    • a function can be marked as "rust" the old way, or by adding tags.language: "rust"
  • Support predefined artifacts and skip recompile
    • This allows an artifact to be built in one CI-step and deployed in another
    • When artifact is defined, the artifact zip is uploaded and compile is skipped

Closes: #123

How did you verify your change:

Change was verified locally using npm link locally. The following scenarios were verified:

  • custom.rust.strictMode set to false, provider changed to provided.al2
    • This resulted in no builds, since no rust functions were found, but no errors
  • Set top-level provider.runtime to provided.al2 and added tags: language: "rust"
    • This resulted in the Rust function being correctly identified and compiled
  • Added param:artifact as per linked issue
    • When built with serverless deploy --stage stage, compile occurred as per usual
    • When built with serverless deploy --stage stage --param="artifact=path/file.zip" build was skipped and provided artifact was deployed

lexi-ember avatar Sep 29 '23 03:09 lexi-ember

Thanks for these changes! I think at this point in this project lifecycle, you might be be better off starting your own fork of this project since this version of it has been abandoned.

I have been looking at gathering the changes from the different PR's available, and pre-existing forks, and merging them into one that we can continue development on.

seanpianka avatar Sep 30 '23 18:09 seanpianka

I noticed when I forked that some tests weren't passing.

Added a commit with lint passing (my mistake), updates to the test for my code, and fixes to the pre-existing failures.

lexi-ember avatar Oct 03 '23 17:10 lexi-ember

Thanks for these changes! I think at this point in this project lifecycle, you might be be better off starting your own fork of this project since this version of it has been abandoned.

I have been looking at gathering the changes from the different PR's available, and pre-existing forks, and merging them into one that we can continue development on.

We did fork internally and it's working like a charm, but I figured it only made sense to at least offer it back.

Low expectations on getting it merged in, but at the very least the diff is there for others who want similar behaviour.

lexi-ember avatar Oct 05 '23 07:10 lexi-ember

@TravisCalder you have just implemented what I was planning to do! This part to skip the build, is critical for us :D :D :
https://github.com/TravisCalder/serverless-rust/blob/master/index.js#L303 Did you publish a public release of this or are you planning to do so? Thanks!

nrodriguez-chub avatar Nov 15 '23 11:11 nrodriguez-chub

I didn't see this reply, sorry about that. We're keeping an internal build of it since we use GitLab but you're welcome to use the code from this Pull Request. We're using it now for 4 different Serverless deployments with 1-3 lambdas per deployment and it's working like a charm.

On Wed, Nov 15, 2023 at 5:02 AM nrodriguez-chub @.***> wrote:

@TravisCalder https://github.com/TravisCalder you have just implemented what I was planning to do! This part to skip the build, is critical for us :D :D : https://github.com/TravisCalder/serverless-rust/blob/master/index.js#L303 Did you publish a public release of this or are you planning to do so? Thanks!

— Reply to this email directly, view it on GitHub https://github.com/softprops/serverless-rust/pull/124#issuecomment-1812290347, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAG6A4ZWJOF36KUT4IRA7N3YESOM5AVCNFSM6AAAAAA5L26A2SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMJSGI4TAMZUG4 . You are receiving this because you were mentioned.Message ID: @.***>

lexi-ember avatar Dec 26 '23 23:12 lexi-ember