diff --git a/docs/src/main/asciidoc/adapters/openwhisk-quick-start.adoc b/docs/src/main/asciidoc/adapters/openwhisk-quick-start.adoc deleted file mode 100644 index 86cc66332..000000000 --- a/docs/src/main/asciidoc/adapters/openwhisk-quick-start.adoc +++ /dev/null @@ -1,80 +0,0 @@ -Implement a POF (be sure to use the `functions` package): - -``` -package functions; - -import java.util.function.Function; - -public class Uppercase implements Function { - - public String apply(String input) { - return input.toUpperCase(); - } -} -``` - -Install it into your local Maven repository: - -``` -./mvnw clean install -``` - -Create a `function.properties` file that provides its Maven coordinates. For example: - -``` -dependencies.function: com.example:pof:0.0.1-SNAPSHOT -``` - -Copy the openwhisk runner JAR to the working directory (same directory as the properties file): - -``` -cp spring-cloud-function-adapters/spring-cloud-function-adapter-openwhisk/target/spring-cloud-function-adapter-openwhisk-2.0.0.BUILD-SNAPSHOT.jar runner.jar -``` - -Generate a m2 repo from the `--thin.dryrun` of the runner JAR with the above properties file: - -``` -java -jar -Dthin.root=m2 runner.jar --thin.name=function --thin.dryrun -``` - -Use the following Dockerfile: - -``` -FROM openjdk:8-jdk-alpine -VOLUME /tmp -COPY m2 /m2 -ADD runner.jar . -ADD function.properties . -ENV JAVA_OPTS="" -ENTRYPOINT [ "java", "-Djava.security.egd=file:/dev/./urandom", "-jar", "runner.jar", "--thin.root=/m2", "--thin.name=function", "--function.name=uppercase"] -EXPOSE 8080 -``` - -> NOTE: you could use a Spring Cloud Function app, instead of just a jar with a POF in it, in which case you would have to change the way the app runs in the container so that it picks up the main class as a source file. For example, you could change the `ENTRYPOINT` above and add `--spring.main.sources=com.example.SampleApplication`. - -Build the Docker image: - -``` -docker build -t [username/appname] . -``` - -Push the Docker image: - -``` -docker push [username/appname] -``` - -Use the OpenWhisk CLI (e.g. after `vagrant ssh`) to create the action: - -``` -wsk action create example --docker [username/appname] -``` - -Invoke the action: - -``` -wsk action invoke example --result --param payload foo -{ - "result": "FOO" -} -```