This is an automated email from the ASF dual-hosted git repository. msciabarra pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk-runtime-rust.git
commit eaa26f0d7b08c8b1fd38a48da51bd90fce93a867 Author: Michele Sciabarra <msciaba...@apache.org> AuthorDate: Wed Mar 6 09:18:38 2019 +0100 hello demo working --- README.md | 15 ++++++++++++++- example/hello/src/lib.rs | 13 ++++++++++--- rust1.32/Makefile | 7 +++++-- 3 files changed, 29 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index ca09760..d4e48bc 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,16 @@ # incubator-openwhisk-runtime-rust -Work in Progress! Do not use... +Work in Progress! Do not use yet... + + +# Work Done + +- implemented the actionloop +- implemented the Docker image +- implemented the action compiler + +# Work to do + +- Add the gradle build +- Implement the mandatory scala tests +- Submit and add to the list of supported runtimes diff --git a/example/hello/src/lib.rs b/example/hello/src/lib.rs index b507a82..5f43e8d 100644 --- a/example/hello/src/lib.rs +++ b/example/hello/src/lib.rs @@ -3,7 +3,14 @@ extern crate serde_json; use std::collections::HashMap; use serde_json::Value; -pub fn main(mut input_data: HashMap<String, Value>) -> HashMap<String, Value> { - input_data.insert("hello".to_string(),Value::String("world".to_string())); - input_data +pub fn main(args: HashMap<String, Value>) -> HashMap<String, Value> { + let name_opt = args.get("name"); + let name = if name_opt.is_some() { + name_opt.unwrap().as_str().unwrap() + } else { + "stranger" + }; + let mut out = HashMap::new(); + out.insert("greeting".to_string(), Value::String(format!("Hello, {}", name))); + out } diff --git a/rust1.32/Makefile b/rust1.32/Makefile index 46598eb..7ee6d5f 100644 --- a/rust1.32/Makefile +++ b/rust1.32/Makefile @@ -1,4 +1,4 @@ -USER?=openwhisk +USER=docker.io/actionloop IMAGE=actionloop-rust-v1.32 .PHONY: build @@ -9,4 +9,7 @@ build: devel: build docker run -ti -p 8080:8080 --entrypoint=bash \ -v $(PWD):/mnt -e OW_COMPILER=/mnt/compile \ - $(USER)/$(IMAGE) + +push: build + docker login + docker push $(USER)/$(IMAGE)