diff --git a/README.adoc b/README.adoc index 1f3c627b1..cd5771810 100644 --- a/README.adoc +++ b/README.adoc @@ -62,7 +62,7 @@ endpoints and/or message stream listeners/publishers with RabbitMQ, Kafka etc. * _Packaging functions for deployments, specific to the target platform (e.g., Project Riff, AWS Lambda and more)_ * _Adapters to expose function to the outside world as HTTP endpoints etc._ * _Deploying a JAR file containing such an application context with an isolated classloader, so that you can pack them together in a single JVM._ -* _Adapters for https://github.com/spring-cloud/spring-cloud-function/tree/master/spring-cloud-function-adapters/spring-cloud-function-adapter-aws[AWS Lambda], https://github.com/spring-cloud/spring-cloud-function/tree/master/spring-cloud-function-adapters/spring-cloud-function-adapter-azure[Azure], https://github.com/spring-cloud/spring-cloud-function/tree/master/spring-cloud-function-adapters/spring-cloud-function-adapter-gcp[Google Cloud Functions], https://github.com/spring-cloud/spring-cloud-function/tree/master/spring-cloud-function-adapters/spring-cloud-function-adapter-openwhisk[Apache OpenWhisk] and possibly other "serverless" service providers._ +* _Adapters for https://github.com/spring-cloud/spring-cloud-function/tree/master/spring-cloud-function-adapters/spring-cloud-function-adapter-aws[AWS Lambda], https://github.com/spring-cloud/spring-cloud-function/tree/master/spring-cloud-function-adapters/spring-cloud-function-adapter-azure[Azure], https://github.com/spring-cloud/spring-cloud-function/tree/master/spring-cloud-function-adapters/spring-cloud-function-adapter-gcp[Google Cloud Functions], and possibly other "serverless" service providers._ == Getting Started diff --git a/docs/src/main/asciidoc/_intro.adoc b/docs/src/main/asciidoc/_intro.adoc index c1895c454..93a9ba207 100644 --- a/docs/src/main/asciidoc/_intro.adoc +++ b/docs/src/main/asciidoc/_intro.adoc @@ -49,4 +49,4 @@ endpoints and/or message stream listeners/publishers with RabbitMQ, Kafka etc. * _Packaging functions for deployments, specific to the target platform (e.g., Project Riff, AWS Lambda and more)_ * _Adapters to expose function to the outside world as HTTP endpoints etc._ * _Deploying a JAR file containing such an application context with an isolated classloader, so that you can pack them together in a single JVM._ -* _Adapters for https://github.com/spring-cloud/spring-cloud-function/tree/master/spring-cloud-function-adapters/spring-cloud-function-adapter-aws[AWS Lambda], https://github.com/spring-cloud/spring-cloud-function/tree/master/spring-cloud-function-adapters/spring-cloud-function-adapter-azure[Azure], https://github.com/spring-cloud/spring-cloud-function/tree/master/spring-cloud-function-adapters/spring-cloud-function-adapter-gcp[Google Cloud Functions], https://github.com/spring-cloud/spring-cloud-function/tree/master/spring-cloud-function-adapters/spring-cloud-function-adapter-openwhisk[Apache OpenWhisk] and possibly other "serverless" service providers._ +* _Adapters for https://github.com/spring-cloud/spring-cloud-function/tree/master/spring-cloud-function-adapters/spring-cloud-function-adapter-aws[AWS Lambda], https://github.com/spring-cloud/spring-cloud-function/tree/master/spring-cloud-function-adapters/spring-cloud-function-adapter-azure[Azure], https://github.com/spring-cloud/spring-cloud-function/tree/master/spring-cloud-function-adapters/spring-cloud-function-adapter-gcp[Google Cloud Functions], and possibly other "serverless" service providers._ 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" -} -``` diff --git a/docs/src/main/asciidoc/adapters/openwhisk.adoc b/docs/src/main/asciidoc/adapters/openwhisk.adoc deleted file mode 100644 index 2085bebf9..000000000 --- a/docs/src/main/asciidoc/adapters/openwhisk.adoc +++ /dev/null @@ -1,6 +0,0 @@ -*{project-version}* - -The https://openwhisk.apache.org/[OpenWhisk] adapter is in the form of an executable jar that can be used in a a docker image to be deployed to Openwhisk. The platform works in request-response mode, listening on port 8080 on a specific endpoint, so the adapter is a simple Spring MVC application. - -== Quick Start -include::adapters/openwhisk-quick-start.adoc[] diff --git a/docs/src/main/asciidoc/sagan-index.adoc b/docs/src/main/asciidoc/sagan-index.adoc index 71e9b2113..fac997ff1 100644 --- a/docs/src/main/asciidoc/sagan-index.adoc +++ b/docs/src/main/asciidoc/sagan-index.adoc @@ -18,7 +18,7 @@ Spring Cloud Function features: * _Packaging functions for deployments, specific to the target platform (e.g., Project Riff, AWS Lambda and more)_ * _Adapters to expose function to the outside world as HTTP endpoints etc._ * _Deploying a JAR file containing such an application context with an isolated classloader, so that you can pack them together in a single JVM._ -* _Adapters for https://github.com/spring-cloud/spring-cloud-function/tree/master/spring-cloud-function-adapters/spring-cloud-function-adapter-aws[AWS Lambda], https://github.com/spring-cloud/spring-cloud-function/tree/master/spring-cloud-function-adapters/spring-cloud-function-adapter-azure[Microsoft Azure], https://github.com/spring-cloud/spring-cloud-function/tree/master/spring-cloud-function-adapters/spring-cloud-function-adapter-gcp[Google Cloud Functions], https://github.com/spring-cloud/spring-cloud-function/tree/master/spring-cloud-function-adapters/spring-cloud-function-adapter-openwhisk[Apache OpenWhisk] and possibly other "serverless" service providers._ +* _Adapters for https://github.com/spring-cloud/spring-cloud-function/tree/master/spring-cloud-function-adapters/spring-cloud-function-adapter-aws[AWS Lambda], https://github.com/spring-cloud/spring-cloud-function/tree/master/spring-cloud-function-adapters/spring-cloud-function-adapter-azure[Microsoft Azure], https://github.com/spring-cloud/spring-cloud-function/tree/master/spring-cloud-function-adapters/spring-cloud-function-adapter-gcp[Google Cloud Functions], and possibly other "serverless" service providers._ Here's a complete, executable, testable Spring Boot application (implementing a simple string manipulation): @@ -42,6 +42,5 @@ public class Application { * https://github.com/spring-cloud/spring-cloud-function/tree/master/spring-cloud-function-samples/function-sample-aws[AWS Lambda] * https://github.com/spring-cloud/spring-cloud-function/tree/master/spring-cloud-function-samples/function-sample-azure[Microsoft Azure] * https://github.com/spring-cloud/spring-cloud-function/tree/master/spring-cloud-function-samples/function-sample-gcp-http[Google Cloud Functions] -* https://github.com/spring-cloud/spring-cloud-function/tree/master/spring-cloud-function-adapters/spring-cloud-function-adapter-openwhisk[Openwhisk] diff --git a/docs/src/main/asciidoc/spring-cloud-function.adoc b/docs/src/main/asciidoc/spring-cloud-function.adoc index 3a130920b..815ccc48c 100644 --- a/docs/src/main/asciidoc/spring-cloud-function.adoc +++ b/docs/src/main/asciidoc/spring-cloud-function.adoc @@ -962,15 +962,8 @@ As well as being able to run as a standalone process, a Spring Cloud Function application can be adapted to run one of the existing serverless platforms. In the project there are adapters for https://github.com/spring-cloud/spring-cloud-function/tree/{branch}/spring-cloud-function-adapters/spring-cloud-function-adapter-aws[AWS -Lambda], -https://github.com/spring-cloud/spring-cloud-function/tree/{branch}/spring-cloud-function-adapters/spring-cloud-function-adapter-azure[Azure], -and -https://github.com/spring-cloud/spring-cloud-function/tree/{branch}/spring-cloud-function-adapters/spring-cloud-function-adapter-openwhisk[Apache -OpenWhisk]. The https://github.com/fnproject/fn[Oracle Fn platform] -has its own Spring Cloud Function adapter. And -https://projectriff.io[Riff] supports Java functions and its -https://github.com/projectriff/java-function-invoker[Java Function -Invoker] acts natively is an adapter for Spring Cloud Function jars. +Lambda], and https://github.com/spring-cloud/spring-cloud-function/tree/{branch}/spring-cloud-function-adapters/spring-cloud-function-adapter-azure[Azure]. The https://github.com/fnproject/fn[Oracle Fn platform] has its own Spring Cloud Function adapter. And https://projectriff.io[Riff] supports Java functions and its +https://github.com/projectriff/java-function-invoker[Java Function Invoker] acts natively is an adapter for Spring Cloud Function jars. include::adapters/aws-intro.adoc[] include::adapters/azure-intro.adoc[] diff --git a/spring-cloud-function-dependencies/pom.xml b/spring-cloud-function-dependencies/pom.xml index 9dd103699..d792315fa 100644 --- a/spring-cloud-function-dependencies/pom.xml +++ b/spring-cloud-function-dependencies/pom.xml @@ -61,11 +61,6 @@ spring-cloud-function-adapter-gcp ${project.version} - - org.springframework.cloud - spring-cloud-function-adapter-openwhisk - ${project.version} - org.springframework.cloud spring-cloud-function-kotlin