Skip to content

moehajj/starlarky-workshop-fintech-devcon

Repository files navigation

Starlarky Workshop (Fintech Devcon 2021)

Agenda

A. Build a Starlarky FaaS Server.

  1. Setup your environment.

  2. Complete the service code to integrate the Starlarky runtime and build your FaaS Server.

  3. Build, Test, Iterate.

  4. (extra) Checkout the different features already available in Starlarky, and try to build your own use-cases!

Solution: starlarky-grpc-faas-example

B. Implement a Custom Module.

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!

  1. Customize your own Starlarky module using Java.

  2. Inject your custom module via input bindings.

    bindings.put(“custom”, new CustomModule());
  3. Invoke your custom module from inside the script.

    ...
    custom.method(arg1, arg2, argName=arg3)
    ...
  4. Build, Test, Iterate.

C. Contribute to Starlarky!

Starlarky is open-source, which means we want the community to freely use, contribute and help build great solutions for everyone.

  1. Clone the Starlarky repository.

  2. Contribute a module using Starlarky.

  3. (extra) Try using py2star to port an existing module in python, or to write your module in python and convert it seamless.

  4. Contribute a module using Java.

  5. 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.

  6. Test, Iterate.

Setup

Tools Required

Server

  • 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"
  • (optional) Install Docker and docker-compose

Simple Client

Configure Maven

Configure maven to retrieve Github artifacts using this guide.

Build & Run

Using Java

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

Using Docker

You can deploy your FaaS using docker-compose.

Build.

docker-compose run build

Deploy.

doker-compose up --build -d starlarky-service

Test

You can test your implementation using a grpcurl based client.

Try modifying the code and testing new features!

./simple_client.sh

Resources

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published