-
Complete the service code to integrate the Starlarky runtime and build your FaaS Server.
-
(extra) Checkout the different features already available in Starlarky, and try to build your own use-cases!
Solution: starlarky-grpc-faas-example
Is there something you can't do with Starlarky? Do you want to access your own backend service or 3rd party providers (e.g, KYC provide, PII analytics, etc.), without exposing potentially unsafe language features to Starlarky directly?
You can build a Starlarky module using Java to achieve just that!
-
Customize your own Starlarky module using Java.
-
Inject your custom module via input bindings.
bindings.put(“custom”, new CustomModule());
-
Invoke your custom module from inside the script.
... custom.method(arg1, arg2, argName=arg3) ...
Starlarky is open-source, which means we want the community to freely use, contribute and help build great solutions for everyone.
-
Clone the Starlarky repository.
-
Contribute a module using Starlarky.
-
(extra) Try using py2star to port an existing module in python, or to write your module in python and convert it seamless.
-
Contribute a module using Java.
-
Build Starlarky, the Starlarky version is set to
1.0-SNAPSHOT
by default, you can choose to modify that if you like.Then update the Starlarky version in the pom.xml of your FaaS solution to reflect these changes.
-
Test, Iterate.
-
Maven & Java 11
- Install using
sdkman
curl -s "https://get.sdkman.io" | bash source ~/.sdkman/bin/sdkman-init.sh sdk install maven 3.6.3 sdk install java 11.0.11.j9-adpt
- Set
$JAVA_HOME
in your~/.bash_profile
export JAVA_HOME="$HOME/.sdkman/candidates/java/current"
- Install using
-
(optional) Install Docker and docker-compose
Configure maven to retrieve Github artifacts using this guide.
You can build and run your application from the command line using maven and java.
Build.
mvn clean install -DskipTests
Run.
java \
-Dgrpc.port=6565 \
-jar ./target/starlarky-workshop-fintech-devncon-1.0.jar
You can deploy your FaaS using docker-compose
.
Build.
docker-compose run build
Deploy.
doker-compose up --build -d starlarky-service
You can test your implementation using a grpcurl
based client.
Try modifying the code and testing new features!
./simple_client.sh