Skip to content

Commit 7f9b0c5

Browse files
committed
provided runtimeisms
1 parent f73889c commit 7f9b0c5

File tree

2 files changed

+17
-12
lines changed

2 files changed

+17
-12
lines changed

README.md

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,24 +36,23 @@ $ docker run --rm \
3636
## Local Testing
3737

3838
Once you've build a Rust lambda function artifact the `provided` runtime expects
39-
deployments of that artifact to be named **bootstrap**
39+
deployments of that artifact to be named **bootstrap**. The lambda-rust docker image
40+
builds a zip file containing your binary files renamed to bootstrap
4041

41-
```sh
42-
$ mv target/lambda/release/{your-crate-name} target/lambda/release/bootstap
43-
```
44-
45-
You can then invoke this bootstap executable with the lambda-ci provided docker image
42+
You can invoke this bootstap executable with the lambda-ci provided docker image
4643

4744

4845
```sh
4946
# start a docker container replicating the "provided" lambda runtime
5047
# awaiting an event to be provided via stdin
51-
$ docker run \
52-
-i -e DOCKER_LAMBDA_USE_STDIN=1 \
53-
--rm \
54-
-v \
55-
"$PWD/target/lambda/release":/var/task \
56-
lambci/lambda:provided
48+
$ unzip \
49+
target/lambda/release/{your-binary-name}.zip \
50+
-d /tmp/lambda && \
51+
docker run \
52+
-i -e DOCKER_LAMBDA_USE_STDIN=1 \
53+
--rm \
54+
-v /tmp/lambda:/var/task \
55+
lambci/lambda:provided
5756

5857
# provide payload via stdin (typically a json blob)
5958

build.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,11 @@ cd "$CARGO_TARGET_DIR"/release
1919
find -maxdepth 1 -executable -type f
2020
); do
2121
strip "$file"
22+
rm "$file.zip" > 2&>/dev/null
23+
# note: would use printf "@ $(basename $file)\n@=bootstrap" | zipnote -w "$file.zip"
24+
# if not for https://bugs.launchpad.net/ubuntu/+source/zip/+bug/519611
25+
mv "$file" bootstrap
26+
zip "$file.zip" bootstrap
27+
rm bootstrap
2228
done
2329
) 1>&2

0 commit comments

Comments
 (0)