@@ -6,15 +6,8 @@ We will then upload it to IronWorker and run it.
6
6
7
7
## Prerequisites
8
8
9
- These workflows have been tested on Linux and Mac. You must have a:
10
-
11
- - Working [ Go] [ go ] >=1.5 installation,
12
- - Working [ Glide] [ glide ] installation,
13
- - Working [ Docker] [ docker ] installation.
14
-
15
- [ go ] : http://golang.org
16
- [ glide ] : http://glide.sh
17
- [ docker ] : http://www.docker.com
9
+ TODO: Update these to use real ironcli static build. Also add ironcli
10
+ installation instructions.
18
11
19
12
We are going to use a development branch of ` ironcli ` instead of the official
20
13
release. TODO: ` go install ` will fail due to (lack of) vendoring.
@@ -53,7 +46,7 @@ Create an empty directory for your project and save this code in a file called
53
46
Now let's use ` ironcli ` 's Lambda functionality to create a Docker image. We can
54
47
then run the Docker image with a payload to execute the Lambda function.
55
48
56
- $ $GOPATH/bin/ ironcli lambda create-function --function-name irontest/node-exec:1 --runtime nodejs --handler node_exec.handler node_exec.js
49
+ $ ironcli lambda create-function --function-name irontest/node-exec:1 --runtime nodejs --handler node_exec.handler node_exec.js
57
50
Image output Step 1 : FROM iron/lambda-nodejs
58
51
---> 66fb7af42230
59
52
Step 2 : ADD node_exec.js ./node_exec.js
@@ -67,8 +60,8 @@ then run the Docker image with a payload to execute the Lambda function.
67
60
68
61
As you can see, this is very similar to creating a Lambda function using the
69
62
` aws ` CLI tool. We name the function as we would name other Docker images. The
70
- ` 1 ` indicates the version. You can use any string. This way you can make
71
- changes to your code and tell IronWorker to run the newer code . The handler is
63
+ ` 1 ` indicates the version. You can use any string. This way you can configure
64
+ your deployment environment to use different versions . The handler is
72
65
the name of the function to run, in the form that nodejs expects
73
66
(` module.function ` ). Where you would package the files into a ` .zip ` to upload
74
67
to Lambda, we just pass the list of files to ` ironcli ` . If you had node
@@ -86,7 +79,7 @@ You should now see the generated Docker image.
86
79
The ` test-function ` subcommand can launch the Dockerized function with the
87
80
right parameters.
88
81
89
- $ $GOPATH/bin/ ironcli lambda test-function --function-name irontest/node-exec:1 --payload '{ "cmd": "echo Dockerized Lambda" }'
82
+ $ ironcli lambda test-function --function-name irontest/node-exec:1 --payload '{ "cmd": "echo Dockerized Lambda" }'
90
83
Dockerized Lambda!
91
84
92
85
You should see the output. Try changing the command to ` date ` or something more
@@ -148,8 +141,3 @@ Code page.
148
141
149
142
$ curl -X POST -d '{ "cmd": "echo Dockerized Lambda" }' '<webhook URL>'
150
143
151
- ---
152
-
153
- TODO:
154
- NOTE to devs: Perhaps prefetch Lambda function runners on to certain machines?
155
-
0 commit comments