Skip to content

Commit e9f97f9

Browse files
authored
release prep (#20)
1. add license headers and boilerplate files 2. adopt standard runtime directory `core` structure for language versions 3. rename docker image to action-rust-v1.34 from actionloop-rust-v1.34
1 parent 8b7af15 commit e9f97f9

File tree

19 files changed

+194
-50
lines changed

19 files changed

+194
-50
lines changed

CONTRIBUTING.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
<!--
2+
#
3+
# Licensed to the Apache Software Foundation (ASF) under one or more
4+
# contributor license agreements. See the NOTICE file distributed with
5+
# this work for additional information regarding copyright ownership.
6+
# The ASF licenses this file to You under the Apache License, Version 2.0
7+
# (the "License"); you may not use this file except in compliance with
8+
# the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
#
18+
-->
19+
[![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0)
20+
21+
# Contributing to Apache OpenWhisk
22+
23+
Anyone can contribute to the OpenWhisk project and we welcome your contributions.
24+
25+
There are multiple ways to contribute: report bugs, improve the docs, and
26+
contribute code, but you must follow these prerequisites and guidelines:
27+
28+
- [Contributor License Agreement](#contributor-license-agreement)
29+
- [Raising issues](#raising-issues)
30+
- [Coding Standards](#coding-standards)
31+
32+
### Contributor License Agreement
33+
34+
All contributors must sign and submit an Apache CLA (Contributor License Agreement).
35+
36+
Instructions on how to do this can be found here:
37+
[http://www.apache.org/licenses/#clas](http://www.apache.org/licenses/#clas)
38+
39+
Once submitted, you will receive a confirmation email from the Apache Software Foundation (ASF) and be added to
40+
the following list: http://people.apache.org/unlistedclas.html.
41+
42+
Project committers will use this list to verify pull requests (PRs) come from contributors that have signed a CLA.
43+
44+
We look forward to your contributions!
45+
46+
## Raising issues
47+
48+
Please raise any bug reports or enhancement requests on the respective project repository's GitHub issue tracker. Be sure to search the
49+
list to see if your issue has already been raised.
50+
51+
A good bug report is one that make it easy for us to understand what you were trying to do and what went wrong.
52+
Provide as much context as possible so we can try to recreate the issue.
53+
54+
A good enhancement request comes with an explanation of what you are trying to do and how that enhancement would help you.
55+
56+
### Discussion
57+
58+
Please use the project's developer email list to engage our community:
59+
[dev@openwhisk.apache.org](dev@openwhisk.apache.org)
60+
61+
In addition, we provide a "dev" Slack team channel for conversations at:
62+
https://openwhisk-team.slack.com/messages/dev/
63+
64+
### Coding standards
65+
66+
Please ensure you follow the coding standards used throughout the existing
67+
code base. Some basic rules include:
68+
69+
- all files must have the Apache license in the header.
70+
- all PRs must have passing builds for all operating systems.
71+
- the code is correctly formatted as defined in the [Scalariform plugin properties](tools/eclipse/scala.properties). If you use IntelliJ for development this [page](https://plugins.jetbrains.com/plugin/7480-scalariform) describes the setup and configuration of the plugin.

NOTICE.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Apache OpenWhisk Runtime Rust
2+
Copyright 2016-2020 The Apache Software Foundation
3+
4+
This product includes software developed at
5+
The Apache Software Foundation (http://www.apache.org/).

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
To use as a Docker action:
2626

2727
```
28-
wsk action update myAction my_action.rs --docker openwhisk/actionloop-rust-v1.34
28+
wsk action update myAction my_action.rs --docker openwhisk/action-rust-v1.34
2929
```
3030

3131
The file `my_action.rs` looks like:
@@ -85,5 +85,5 @@ serde_derive = "1.0"
8585
```
8686
Once you have all your code zipped in a file with the showed folder structure you can generate your action with the following command:
8787
```
88-
wsk action create yourAction /full_path_to/yourCode.zip --docker openwhisk/actionloop-rust-v1.34
88+
wsk action create yourAction /full_path_to/yourCode.zip --docker openwhisk/action-rust-v1.34
8989
```
File renamed without changes.

core/rust1.34/Makefile

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one or more
3+
# contributor license agreements. See the NOTICE file distributed with
4+
# this work for additional information regarding copyright ownership.
5+
# The ASF licenses this file to You under the Apache License, Version 2.0
6+
# (the "License"); you may not use this file except in compliance with
7+
# the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
18+
USER=docker.io/openwhisk
19+
IMAGE=action-rust-v1.34
20+
21+
.PHONY: build
22+
23+
build:
24+
docker build -t $(USER)/$(IMAGE) .
25+
26+
devel: build
27+
docker run -ti -p 8080:8080 --entrypoint=bash \
28+
-v $(PWD):/mnt -e OW_COMPILER=/mnt/compile \
29+
$(USER)/$(IMAGE)
30+
31+
push: build
32+
docker login
33+
docker push $(USER)/$(IMAGE)

rust1.34/build.gradle renamed to core/rust1.34/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@
1515
* limitations under the License.
1616
*/
1717

18-
ext.dockerImageName = 'actionloop-rust-v1.34'
19-
apply from: '../gradle/docker.gradle'
18+
ext.dockerImageName = 'action-rust-v1.34'
19+
apply from: '../../gradle/docker.gradle'
File renamed without changes.
File renamed without changes.
File renamed without changes.

rust1.34/src/action_loop/src/main.rs renamed to core/rust1.34/src/action_loop/src/main.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
118
use actions::main as actionMain;
219

320
use serde_derive::Deserialize;

core/rust1.34/src/actions/src/lib.rs

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
extern crate serde_json;
19+
20+
use serde_derive::{Deserialize, Serialize};
21+
use serde_json::{Error, Value};
22+
23+
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
24+
struct Input {
25+
#[serde(default = "stranger")]
26+
name: String,
27+
}
28+
29+
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
30+
struct Output {
31+
greeting: String,
32+
}
33+
34+
fn stranger() -> String {
35+
"stranger".to_string()
36+
}
37+
38+
pub fn main(args: Value) -> Result<Value, Error> {
39+
let input: Input = serde_json::from_value(args)?;
40+
let output = Output {
41+
greeting: format!("Hello, {}", input.name),
42+
};
43+
serde_json::to_value(output)
44+
}

example/hello/src/lib.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
118
extern crate serde_json;
219

320
use serde_derive::{Deserialize, Serialize};

rust1.34/Makefile

Lines changed: 0 additions & 16 deletions
This file was deleted.

rust1.34/src/actions/src/lib.rs

Lines changed: 0 additions & 27 deletions
This file was deleted.

settings.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
*/
1717

1818
include 'tests'
19-
include 'rust1.34'
19+
include 'core:rust1.34'
2020

21-
rootProject.name = 'runtime-actionlooop'
21+
rootProject.name = 'runtime-rust'
2222

2323
gradle.ext.openwhisk = [
2424
version: '1.0.0-SNAPSHOT'

tests/src/test/scala/runtime/actionContainers/ActionLoopRustBasicTests.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import org.scalatest.junit.JUnitRunner
2525
@RunWith(classOf[JUnitRunner])
2626
class ActionLoopRustBasicTests extends BasicActionRunnerTests with WskActorSystem {
2727

28-
val image = "actionloop-rust-v1.34"
28+
val image = "action-rust-v1.34"
2929

3030
override def withActionContainer(env: Map[String, String] = Map.empty)(code: ActionContainer => Unit) = {
3131
withContainer(image, env)(code)

0 commit comments

Comments
 (0)