OpenFaas JVM template supporting afterburn with the new watchdog implementation. This is an answer to the cold start problem when using the serverless architecture.
-
Deploy OpenFaaS
-
Install OpenFaaS CLI
-
Get the template and create the function and run the sample
faas-cli template pull https://github.com/amirkarimi/openfaas-jvm-afterburn-template
faas-cli new --lang jvm-afterburn jvm_burner
faas-cli build -f jvm_burner.yml
faas-cli deploy -f jvm_burner.yml
echo test | faas-cli invoke jvm_burner
You just need to generate a JAR file using your favorate langauge and tools, rename the JAR file to app.jar
and copy to the function
folder.
This is useful for testing/debugging purposes.
- Build the new version of watchdog supporting Afterburn. Navigate to another dir.
git clone [email protected]:openfaas-incubator/of-watchdog.git \
cd of-watchdog \
./build.sh
-
Copy
of-watchdog
to a where the main JAR file exists -
Run watchdog:
mode=afterburn fprocess="java -jar app.jar" ./of-watchdog
- Send the requests to
localhost:8081