Skip to content

Commit ce7d864

Browse files
mrutkowspritidesai
authored andcommitted
Improve README build instructions & add troubleshooting (#97)
* Improve README build instructions & add troubleshooting * Improve README build instructions & add troubleshooting * remove trailing whitespace XCode did not trim
1 parent 9ebb05f commit ce7d864

5 files changed

Lines changed: 60 additions & 11 deletions

File tree

.travis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,17 @@ deploy:
4545
on:
4646
tags: true
4747
all_branches: true
48-
repo: apache/incubator-openwhisk-runtime-java
48+
repo: apache/openwhisk-runtime-java
4949
- provider: script
5050
script: "./tools/travis/publish.sh openwhisk 8 nightly"
5151
on:
5252
branch: master
53-
repo: apache/incubator-openwhisk-runtime-java
53+
repo: apache/openwhisk-runtime-java
5454
- provider: script
5555
script: "./tools/travis/publish.sh openwhisk 8a nightly"
5656
on:
5757
branch: master
58-
repo: apache/incubator-openwhisk-runtime-java
58+
repo: apache/openwhisk-runtime-java
5959
env:
6060
global:
6161
- secure: D4kU9O6bs63Myb4jaEgw1O2Kuy6aTAUKEX1qZ0eYMDouLnPOPnZaFWmpISKTrJyz7hJH7yY8Cj7xl5qwsLB6JZZMtqT6yj5J/jkUJjyLKdQH81PrYy22rH99xS2t5A1dsC0A/Bf39R/qNc5tx1wCMVDF4O2rFsUtn+8vE+rn0nXsiPeWhhZagk/Hrq8YbwzDJHOGHfWe1nZIcU8MORzTriX7J2VAF0AcirPandMxff4FgzNLk432DN2GvgZIlNtZGT1DWLtJV/Sp3unD9abXr5xqNDIW+fHrMq8j/JdHC6+PFtZRFrl0Vr6X8c61PkB/ELGF2MyzNgBTnEaJixl1pianr91WK4y0oLUwpSJCz4yoQGVimAAtqMgNXjEyFMcpLClzS5TjMXKaUfi9mBn9GMCwLi3VAuVtMtH2IRW03PxIPyxkbj1j8Nrd0jh408MuMpuzyECgb+E5ffbd+0YD5XUNlTkYLFi4sEh2xpzvjGrNbrTe99zFrHt3e+dbmoahmaCyDRsxD2CDI8b++HyN78z/jO9A7kFc2TAZbWa6Xygkj1nEpnR1y4TB6eqdDo7Y6W20dLjeSSF8rACw3bM3lJh+K4/nv4Nlo6pfblhvs7T53ftst+tHpxJoQy/gDC0TcuyBThrHTeI1j7k4HkQyN+NqezBdFN2ElufjQ74ds2c=

README.md

Lines changed: 53 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
# Apache OpenWhisk runtimes for java
2121

22-
[![Build Status](https://travis-ci.org/apache/incubator-openwhisk-runtime-java.svg?branch=master)](https://travis-ci.org/apache/incubator-openwhisk-runtime-java)
22+
[![Build Status](https://travis-ci.org/apache/openwhisk-runtime-java.svg?branch=master)](https://travis-ci.org/apache/openwhisk-runtime-java)
2323

2424
## Changelogs
2525
- [Java 8 CHANGELOG.md](core/java8/CHANGELOG.md)
@@ -94,19 +94,40 @@ wsk action invoke --result helloJava --param name World
9494
```
9595

9696
## Local development
97+
98+
### Pre-requisites
99+
- Gradle
100+
- Docker Desktop (local builds)
101+
102+
### Build and Push image to a local Docker registry
103+
104+
1. Start Docker Desktop (i.e., Docker daemon)
105+
106+
2. Build the Docker runtime image locally using Gradle:
97107
```
98108
./gradlew core:java8:distDocker
99109
```
100-
This will produce the image `whisk/java8action`
110+
This will produce the image `whisk/java8action` and push it to the local Docker Desktop registry with the `latest` tag.
111+
112+
3. Verify the image was registered:
113+
```
114+
$ docker images whisk/*
115+
REPOSITORY TAG IMAGE ID CREATED SIZE
116+
whisk/java8action latest 35f90453905a 7 minutes ago 521MB
117+
```
118+
119+
### Build and Push image to a remote Docker registry
101120

102-
Build and Push image
121+
Build the Docker runtime image locally using Gradle supplying the image Prefix and Registry domain (default port):
103122
```
104123
docker login
105124
./gradlew core:java8:distDocker -PdockerImagePrefix=$prefix-user -PdockerRegistry=docker.io
106125
```
107126

127+
## Deploying the Java runtime image to OpenWhisk
128+
108129
Deploy OpenWhisk using ansible environment that contains the kind `java:8`
109-
Assuming you have OpenWhisk already deploy locally and `OPENWHISK_HOME` pointing to root directory of OpenWhisk core repository.
130+
Assuming you have OpenWhisk already deployed locally and `OPENWHISK_HOME` pointing to root directory of OpenWhisk core repository.
110131

111132
Set `ROOTDIR` to the root directory of this repository.
112133

@@ -159,7 +180,35 @@ wsk action update helloJava hello.jar --main Hello --docker $user_prefix/java8ac
159180
```
160181
The `$user_prefix` is usually your dockerhub user id.
161182

183+
---
184+
185+
# Troubleshooting
186+
187+
### Gradle build fails with "Too many files open"
188+
189+
This may occur on MacOS as the default maximum # of file handles per session is `256`. The gradle build requires many more and is unable to open more files (e.g., `java.io.FileNotFoundException`). For example, you may see something like:
190+
191+
```
192+
> java.io.FileNotFoundException: /Users/XXX/.gradle/caches/4.6/scripts-remapped/build_4mpzm2wl8gipqoxzlms7n6ctq/7gdodk7z6t5iivcgfvflmhqsm/cp_projdf5583fde4f7f1f2f3f5ea117e2cdff1/cache.properties (Too many open files)
193+
194+
```
195+
You can see this limit by issuing:
196+
```
197+
$ ulimit -a
198+
open files (-n) 256
199+
```
200+
201+
In order to increase the limit, open a new terminal session and issue the command (and verify):
202+
```
203+
$ ulimit -n 10000
204+
205+
$ ulimit -a
206+
open files (-n) 10000
207+
```
208+
209+
### Gradle Task fails on `:core:java8:tagImage`
162210

211+
Docker daemon is not started and the Task is not able to push the image to your local registry.
163212

164213
# License
165214
[Apache 2.0](LICENSE.txt)

core/java8actionloop/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# limitations under the License.
1616
#
1717
FROM golang:1.12 as builder
18-
RUN env CGO_ENABLED=0 go get github.com/apache/incubator-openwhisk-runtime-go/main
18+
RUN env CGO_ENABLED=0 go get github.com/apache/openwhisk-runtime-go/main
1919

2020
FROM adoptopenjdk/openjdk8:x86_64-ubuntu-jdk8u212-b03
2121

tools/travis/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ set -ex
2323
SCRIPTDIR=$(cd $(dirname "$0") && pwd)
2424
ROOTDIR="$SCRIPTDIR/../.."
2525
WHISKDIR="$ROOTDIR/../openwhisk"
26-
UTILDIR="$ROOTDIR/../incubator-openwhisk-utilities"
26+
UTILDIR="$ROOTDIR/../openwhisk-utilities"
2727

2828
export OPENWHISK_HOME=$WHISKDIR
2929

tools/travis/setup.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ HOMEDIR="$SCRIPTDIR/../../../"
2626

2727
# clone OpenWhisk utilities repo. in order to run scanCode
2828
cd $HOMEDIR
29-
git clone https://github.com/apache/incubator-openwhisk-utilities.git
29+
git clone https://github.com/apache/openwhisk-utilities.git
3030

3131
# clone main openwhisk repo. for testing purposes
32-
git clone --depth=1 https://github.com/apache/incubator-openwhisk.git openwhisk
32+
git clone --depth=1 https://github.com/apache/openwhisk.git openwhisk
3333
cd openwhisk
3434
./tools/travis/setup.sh

0 commit comments

Comments
 (0)