Skip to content

Commit 8dd54c7

Browse files
authored
Remove non-action loop proxies. (#93)
* Remove old proxies. * Update README.
1 parent 95f1358 commit 8dd54c7

23 files changed

Lines changed: 76 additions & 2189 deletions

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ deploy:
4545
all_branches: true
4646
repo: apache/openwhisk-runtime-python
4747
- provider: script
48-
script: "./tools/travis/publish.sh openwhisk 3 nightly && ./tools/travis/publish.sh openwhisk 3-ai nightly && ./tools/travis/publish.sh openwhisk 3-loop nightly && ./tools/travis/publish.sh openwhisk 3-loopai nightly"
48+
script: "./tools/travis/publish.sh openwhisk 3 nightly && ./tools/travis/publish.sh openwhisk 3-ai nightly"
4949
on:
5050
branch: master
5151
repo: apache/openwhisk-runtime-python

README.md

Lines changed: 52 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -21,96 +21,82 @@
2121
[![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0)
2222
[![Build Status](https://travis-ci.org/apache/openwhisk-runtime-python.svg?branch=master)](https://travis-ci.org/apache/openwhisk-runtime-python)
2323

24+
## Build Runtimes
25+
26+
The runtimes are built using Gradle.
27+
The file [settings.gradle](settings.gradle) lists the images that are build by default.
28+
To build all those images, run the following command.
2429

25-
### Give it a try today
26-
To use as a docker action using python 3
2730
```
28-
wsk action update myAction myAction.py --docker openwhisk/python3action:1.0.2
31+
./gradlew distDocker
2932
```
3033

31-
### To use on deployment that contains the rutime as a kind
32-
To use as a kind action using python 3
34+
You can optionally build a specific image by modifying the Gradle command. For example:
3335
```
34-
wsk action update myAction myAction.py --kind python:3
36+
./gradlew core:python3ActionLoop:distDocker
3537
```
36-
Replace `python:3` with `python:2` to use python 2.
3738

39+
The build will produce Docker images such as `actionloop-python-v3.7`
40+
and will also tag the same image with the `whisk/` prefix. The latter
41+
is a convenience, which if you're testing with a local OpenWhisk
42+
stack, allows you to skip pushing the image to Docker Hub.
3843

39-
### Python 3 AI Action
40-
This action enables developers to create AI Services with OpenWhisk. It comes with preinstalled libraries useful for running machine learning and deep learning inferences. See more about [python3aiaction](./core/python3AiAction).
44+
The image will need to be pushed to Docker Hub if you want to test it
45+
with a hosted OpenWhisk installation.
4146

42-
### Local development
43-
```
44-
./gradlew core:pythonAction:distDocker
45-
```
46-
This will produce the image `whisk/python3action`
47+
### Using Gradle to push to a Docker Registry
4748

48-
Build and Push image
49-
```
50-
docker login
51-
./gradlew core:pythonAction:distDocker -PdockerImagePrefix=$prefix-user -PdockerRegistry=docker.io
52-
```
49+
The Gradle build parameters `dockerImagePrefix` and `dockerRegistry`
50+
can be configured for your Docker Registery. Make usre you are logged
51+
in first with the `docker` CLI.
5352

54-
Deploy OpenWhisk using ansible environment that contains the kind `python:3` and `python:2`
55-
Assuming you have OpenWhisk already deploy locally and `OPENWHISK_HOME` pointing to root directory of OpenWhisk core repository.
53+
- Use the `docker` CLI to login. The following assume you will substitute `$DOCKER_USER` with an appropriate value.
54+
```
55+
docker login --username $DOCKER_USER
56+
```
5657

57-
Set `ROOTDIR` to the root directory of this repository.
58+
- Now build, tag and push the image accordingly.
59+
```
60+
./gradlew distDocker -PdockerImagePrefix=$DOCKER_USER -PdockerRegistry=docker.io
61+
```
5862

59-
Redeploy OpenWhisk
60-
```
61-
cd $OPENWHISK_HOME/ansible
62-
ANSIBLE_CMD="ansible-playbook -i ${ROOTDIR}/ansible/environments/local"
63-
$ANSIBLE_CMD setup.yml
64-
$ANSIBLE_CMD couchdb.yml
65-
$ANSIBLE_CMD initdb.yml
66-
$ANSIBLE_CMD wipe.yml
67-
$ANSIBLE_CMD openwhisk.yml
68-
```
63+
### Using Your Image as an OpenWhisk Action
6964

70-
Or you can use `wskdev` and create a soft link to the target ansible environment, for example:
71-
```
72-
ln -s ${ROOTDIR}/ansible/environments/local ${OPENWHISK_HOME}/ansible/environments/local-python
73-
wskdev fresh -t local-python
74-
```
65+
You can now use this image as an OpenWhisk action. For example, to use
66+
the image `actionloop-python-v3.7` as an action runtime, you would run
67+
the following command.
7568

76-
Use the `docker` commands to tag the image and push it into your own Docker Hub account
77-
```
78-
docker tag whisk/python3action $user_prefix/python3action
79-
docker push $user_prefix/python3action
80-
```
81-
Then create the action using your image from dockerhub
8269
```
83-
wsk action update myAction myAction.py --docker $user_prefix/python3action
70+
wsk action update myAction myAction.py --docker $DOCKER_USER/actionloop-python-v3.7
8471
```
85-
The `$user_prefix` is usually your dockerhub user id.
8672

87-
### Testing
88-
Install dependencies from the root directory on $OPENWHISK_HOME repository
73+
## Test Runtimes
74+
75+
There are suites of tests that are generic for all runtimes, and some that are specific to a runtime version.
76+
To run all tests, there are two steps.
77+
78+
First, you need to create an OpenWhisk snapshot release. Do this from your OpenWhisk home directory.
8979
```
9080
./gradlew install
9181
```
9282

93-
Using gradle for the ActionContainer tests you need to use a proxy if running on Mac, if Linux then don't use proxy options
94-
You can pass the flags `-Dhttp.proxyHost=localhost -Dhttp.proxyPort=3128` directly in gradle command.
95-
Or save in your `$HOME/.gradle/gradle.properties`
96-
```
97-
systemProp.http.proxyHost=localhost
98-
systemProp.http.proxyPort=3128
99-
```
100-
Using gradle to run all tests
101-
```
102-
./gradlew :tests:test
103-
```
104-
Using gradle to run some tests
83+
Now you can build and run the tests in this repository.
10584
```
106-
./gradlew :tests:test --tests *ActionContainerTests*
85+
./gradlew tests:test
10786
```
108-
Using IntelliJ:
109-
- Import project as gradle project.
110-
- Make sure working directory is root of the project/repo
111-
- Add the following Java VM properties in ScalaTests Run Configuration, easiest is to change the Defaults for all ScalaTests to use this VM properties
87+
88+
Gradle allows you to selectively run tests. For example, the following
89+
command runs tests which match the given pattern and excludes all
90+
others.
11291
```
113-
-Dhttp.proxyHost=localhost
114-
-Dhttp.proxyPort=3128
92+
./gradlew :tests:test --tests *ActionLoopContainerTests*
11593
```
11694

95+
## Python 3 AI Runtime
96+
This action runtime enables developers to create AI Services with OpenWhisk. It comes with preinstalled libraries useful for running machine learning and deep learning inferences. [Read more about this runtime here](./core/python3AiActionLoop).
97+
98+
## Import Project into IntelliJ
99+
100+
Follow these steps to import the project into your IntelliJ IDE.
101+
- Import project as gradle project.
102+
- Make sure working directory is root of the project/repo.

core/python3Action/CHANGELOG.md

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

core/python3Action/Dockerfile

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

core/python3Action/build.gradle

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

0 commit comments

Comments
 (0)