-
Notifications
You must be signed in to change notification settings - Fork 358
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
State of release #216
Comments
Can confirm that using the
|
unfortunately the readme has gone stale. I can help with this. You should only need the At this point you might be best served by using the examples here adapting the packaging and deployment notes from the readme. Let us know if you get stuck. |
Are there plans to cut a new release tho? Or should we plan to keep using the github dependency for a while still? I'm also curious when the hello-with-ctx example is going to be expanded on. It isn't super clear to me how that's supposed to work with the macro-based implementation and the example is just copy / paste the hello example right now. Everything else seems more or less clear from the examples and a little bit of trial and error (for instance the examples deal with serde Values for input / output but really they just need to derive the serde traits). I guess one other question I personally have is - can this be used with proxy API gateways? |
@Luminoth I'm not sure how the context is meant to be accessed, but this seems to work: use lambda::{lambda, INVOCATION_CTX};
use serde_json::Value;
type Error = Box<dyn std::error::Error + Send + Sync + 'static>;
#[lambda]
#[tokio::main]
async fn main(event: Value) -> Result<(), Error> {
INVOCATION_CTX.with(|ctx| {
println!("Context is {:#?}", ctx);
});
println!("Event is {:#?}", event);
Ok(())
} Here The downside of this approach is that the context is only available in the closure you pass to Note: I tested this with the latest revision, ebc5474 as of this writing. |
Yup. Definitely lost a day with this. Looking forward to a new release. Also, happy to help with docs, if for no other reason than to help future me. :) |
I also noticed that there's no git tag/release for the latest crate version (v0.2.1). |
Hi, I am also struggling with this - any news? Has this maybe been abandoned? Or moved to a different repo? |
I feel the struggle. What are the current blockers to publishing a new release now that the http crate is in line with the new "core" crate? |
Not abandoned; I'm just short on time. I'm in the process of getting the Lambda runtime team to assign headcount/staff to this runtime—not sure when that will happen, but that would give this library some better stewardship and maintainership than I can currently afford to.
Docs, I think? I'd like to give them a once-over before we cut a beta. |
@davidbarsky few other notes. I'm prepping for some new releases of packaged workflows for serverless rust plugin and am trying to get official support for aws sam through the pipeline. I've been updating a bunch of getting templates to reference master in prep for a forth coming release. This made me think about a few things we might want before cutting a release
[dependencies]
- lambda_runtime = "0.2"
+ tokio = { version = "0.2", features = ["macros"] }
+ lambda = { git = "https://github.com/awslabs/aws-lambda-rust-runtime/", branch = "master"} -use lambda_runtime::{error::HandlerError, lambda, Context};
+use lambda::handler_fn;
use serde_json::Value;
-fn main() {
- lambda!(handler)
+type Error = Box<dyn std::error::Error + Sync + Send + 'static>;
+#[tokio::main]
+async fn main() -> Result<(), Error> {
lambda::run(handler_fn(handler)).await?;
Ok(())
}
-fn handler(
- event: Value,
- _: Context,
-) -> Result<Value, HandlerError> {
+async fn handler(event: Value) -> Result<Value, Error> {
Ok(event)
}
|
Oh also and a finalized lambda context api. I feel like there's some room for improvement there |
@davidbarsky @softprops |
I hear you. I don't think I have of merge permissions but I'm happy to take a look. api docs and and examples on master should reflect the state of current code. What is ultimately going to be useful is a helpful changelog entry for what changed which is alot. A second in the README for unrelated but upcoming changes would also be good. The good news is this current version has a much smaller surface area to cover. I'm going to take a stab at the trying to find a slightly nicer context api. |
I'm sorry for the frustration. I've been working on a release blog post for the new changes, which will include an updated README.md. |
@softprops As for the context API, I think an explicit argument is probably best at this point. The task local approach was too out-there. |
If it would be help I'd be happy to help
I knew you'd come around ;) I actually just tried to make it work by trying to impl I then started down the path of type wrapper types Ultimately I think the explicit context argument is probably best because...
I rework this tonight/tomorrow and push up a pull. my circadian is all kinds of messed up right now :) |
@davidbarsky If it helps generate movement, can you nudge the the sam folks if you know anyone on the inside that could help push aws/aws-lambda-builders#174 along. An ideal but unlikely case time-wise would be this lambda runtime release post could include a nice I feel like it might also be useful to do a beta release before posting to catch anything missed |
if changelog management is something that got dropped (which is completely understandable) you could consider switching to an automated cicd workflow where version bumps, publish, and changelog are driven by conventional commits with a tool like standard-version - I have a version of this up on a repo of mine that i would be happy to share or talk through |
At the risk of overwhelming with offers of help from people unfamiliar with the codebase, I would also love to contribute in any way i can - super psyched about the changes just over the horizon here! |
Can we list out what blockers remain and maybe open a issue with a task list of blockers remain? I'm asking because I've finally had some success at capturing the sam teams attention on the pull adding first class support for the lambda runtime aws/aws-lambda-builders#174 Something I anticipate being problematic is that the integration tests over there depend on this crate by way of git source uri. I'd rather have them point to a release on crates.io to minimize potential breakage in their integration tests when the master branch here changes. |
@softprops I believe the README.md is incorrect; that is the only remaining blocker for release. Oh, as an update, we can't use the crates.io publishing workflow for this repository, unfortunately. GitHub Secrets are disabled by AWS and would require a security assessment on our end, which isn't great. |
Would it be OK with AWS' security to use a hosted build service like travis or would the same process apply? |
I think it was less about a build service an more about secret manager for crates io token. Automating crate publishing doesn't feel like a blocker for this release. It was just an idea to facilitate more frequent releases |
I didn't mean it to come off as that, I'm sorry. This was just a handy mechanism to communicate that blocker :).
We'd need to run automated releases through AWS specifically. In other words, the secrets need to be stored on AWS-controlled services and machines. Non-AWS ones need a security review and possibly a pentest. |
Might be worth carrying over the conversation about automating releases to new gh issue. That conversation might outlast this one |
@davidbarsky, can we enumerate the blockers (maybe with a checklist), it's sad see the release postponed for indeterminate amount of time... |
I know there are a bunch of people waiting for a release, so this might be interesting to you: |
Might be worth it to link #294 to give context to why this one was closed EDIT: I realise that wording sounded a bit passive aggressive, but was definitely not the intention! |
@Tehnix you are completely right. That was an oversight on my part. |
Hey all, would it be possible to cut a release at the current master commit level or similar? As long as it's post #111 that should work.
Coming in as a new user I was confused between the differing formats in the examples source and in the docs. It didn't help that the examples source (which is the correct way to do things) doesn't compile with the latest version of the crate. Once the dependency is renamed to
lambda = { git = "https://github.com/awslabs/aws-lambda-rust-runtime/", branch = "master" }
everything works for the new syntax.I can try and provide documentation and examples improvements PRs but if the maintainers could cut a release I think that'd go a long way to usability.
The text was updated successfully, but these errors were encountered: