This is an automated email from the ASF dual-hosted git repository.

rabbah pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/openwhisk.git


The following commit(s) were added to refs/heads/master by this push:
     new eb29fe5  Improved standalone launch script (#4805)
eb29fe5 is described below

commit eb29fe5cd0ce2f46ca507c4acbe40acc3818d9b9
Author: Michele Sciabarra <[email protected]>
AuthorDate: Sun Feb 2 12:01:47 2020 +0100

    Improved standalone launch script (#4805)
    
    * use the nightly image by default
    
    * create a test action
    
    * better readme
    
    * Update core/standalone/README.md
---
 core/standalone/README.md | 15 ++++++++++-----
 core/standalone/start.sh  |  4 ++--
 core/standalone/waitready |  5 +++++
 3 files changed, 17 insertions(+), 7 deletions(-)

diff --git a/core/standalone/README.md b/core/standalone/README.md
index ff19351..d21260a 100644
--- a/core/standalone/README.md
+++ b/core/standalone/README.md
@@ -392,15 +392,21 @@ If you have docker and bash installed, you can launch the 
standalone openwhisk f
 
 `bash <(curl -sL https://s.apache.org/openwhisk.sh)`
 
-If you do not want to execute arbitrary code straight from the net, you can 
look at [this script](start.sh), check it and run it when you feel safe.
+The script will start the standalone controller with Docker, and will also try 
to open the playground. It was tested on Linux, OSX and Windows with Git Bash. 
If a browser does not automatically open the OpenWhisk playground, you can 
access it at `http://localhost:3232`.
+
+The default standalone controller image is published as 
`openwhisk/standalone:nightly` for convenience.
+
+You can specify a different image to this script and also pass additional 
parameters to Docker. The general format is:
 
-The script will start the standalone controller with Docker, and will also try 
to open the playground. It was tested on Linux, OSX and Windows with Git Bash. 
If a browser does not open with playground, access it at 
`http://localhost:3232`.
+`bash <(curl -sL https://s.apache.org/openwhisk.sh) [<image-name>] 
[<additional-docker-parameters>...]`
 
-You can then install the [wsk 
CLI](https://github.com/apache/openwhisk-cli/releases) and retrieve the command 
line to configure `wsk` with:
+If you do not want to execute arbitrary code straight from the net, you can 
look at [this script](start.sh), check it and run it when you feel safe.
+
+If the playground is not enough, you can then install the [wsk 
CLI](https://github.com/apache/openwhisk-cli/releases) and retrieve the command 
line to configure `wsk` with:
 
 `docker logs openwhisk | grep 'wsk property'`
 
-To properly shut down OpenWhisk and containers it creates, use [this 
script](stop.sh) or run the command:
+To properly shut down OpenWhisk and any additional containers it has created, 
use [this script](stop.sh) or run the command:
 
 `docker exec openwhisk stop`
 
@@ -414,7 +420,6 @@ You can pass additional parameters (for example set system 
properties) to the JV
 
 You can also set additional environment variables for each container running 
actions invoked by OpenWhisk by setting `CONTAINER_EXTRA_ENV`. For example, 
setting `-e CONTAINER_EXTRA_ENV=__OW_DEBUG_PORT=8081` enables debugging for 
those images supporting starting the action under a debugger, like the 
typescript runtime.
 
-
 [1]: https://github.com/apache/incubator-openwhisk/blob/master/docs/cli.md
 [2]: https://github.com/apache/incubator-openwhisk/blob/master/docs/samples.md
 [3]: https://github.com/apache/incubator-openwhisk-apigateway
diff --git a/core/standalone/start.sh b/core/standalone/start.sh
index c81ec76..ee83b7e 100755
--- a/core/standalone/start.sh
+++ b/core/standalone/start.sh
@@ -15,13 +15,13 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 #
-USER="${1:-openwhisk}"
+IMAGE="${1:-openwhisk/standalone:nightly}"
 shift
 docker run --rm -d \
   -h openwhisk --name openwhisk \
   -p 3233:3233 -p 3232:3232 \
   -v //var/run/docker.sock:/var/run/docker.sock \
- $USER/standalone "$@"
+ "$IMAGE" "$@"
 docker exec openwhisk waitready
 case "$(uname)" in
  (Linux) xdg-open http://localhost:3232 ;;
diff --git a/core/standalone/waitready b/core/standalone/waitready
index 78c876f..643d537 100755
--- a/core/standalone/waitready
+++ b/core/standalone/waitready
@@ -20,3 +20,8 @@ wsk property set --apihost "http://$(hostname):3233" --auth 
"$AUTH"
 until wsk action list 2>/dev/null >/dev/null
 do sleep 1 ; echo server still not ready - retrying
 done
+wsk action update testme <(echo 'function main(){return {"ready":true}}') 
--kind nodejs:10
+until wsk action invoke testme -r 2>/dev/null | grep 'ready'
+do sleep 1 ; echo server initializing... 
+done
+wsk action delete testme

Reply via email to