sapiosciences/sapio_worker

By sapiosciences

Updated 29 days ago

The base image that allows for the Sapio Platform to be extended with the Java Sapio Plugin API

Image
Languages & frameworks
1

10K+

sapiosciences/sapio_worker repository overview

Sapio Worker

This serves as a base image for the Sapio Worker. The worker is a Java application that connects to a Sapio Server to extend functionality through Sapio Sciences Java API.

The primary use case for the Sapio Worker is to allow customers who don't control the server to extend the functionality of the server in the same way that Sapio Sciences does. This is done by creating plugins that are loaded into the worker and are then bound to the server through Dirmi and Apache Fury for low overhead communication. The other way to extend the server is through the Sapio Sciences Webhook API.

Docker Structure

Multiple JVMs are installed in the container to support multiple versions of Java. On startup the docker bootstrap will pick the closest version of Java as the Sapio Server to avoid potential serialization issues.

To add your plugins to the worker, you want to extend this image and add your plugins to the /opt/deployment/plugins directory. The worker will scan this directory for jars containing plugins and load them into the worker JVM.

Shared libraries can be added to the /opt/deployment/sharedlib directory. All jars in this directory will be added to the classpath of a parent ClassLoader that is shared between all plugins. This is useful for sharing common libraries between plugins. This functionality is identical to the applib directory in the Sapio Server. You can also have plugin manifest classpath reference libraries present in the /opt/deployment/lib directory.

Required Configurations

  • VELOXWORKER_WEBSERVICE_URL (String):
    • The Sapio Platform webservice that the worker will use during startup to configure and negotiate the dirmi connection to the same server
    • Value set should end with /webservice/api
    • Example Value: https://localhost:8443/webservice/api
  • VELOXWORKER_AUTH (String)
    • An API key that is typically generated by the server to identify and authorize this worker to interact over the API
    • Example Value: V2VsY29tZSB0byB0aGUgSmF2YSBab25lLCBsZXQgeW91ciBwcm9ncmFtcyBzb2FyLApJbiB0aGUgSmF2YSBab25lLCB3ZSBjb2RlIGZvcmV2ZXJtb3Jl

Optional Configurations

  • VELOXWORKER_WEBSERVICE_TRUSTING (Boolean):

    • Default Value: false
    • If set to true the worker will trust all HTTPS certificates presented by the server. This is useful for testing but should not be used in production as it's susceptible to MITM.
  • VELOXWORKER_DEFAULT_RMI_HOSTS (String):

    • Default Value: ``
    • A comma-separated list of hosts that the worker will attempt to connect to establish a dirmi connection. If the server RMI socket is behind a load balancer or proxy this should be set to the hostname of the load balancer or proxy. After attempting to connect to the hosts in this list the worker will attempt to connect to the hosts returned by the webservice.
  • VELOXWORKER_DEFAULT_RMI_PORT (Integer):

    • Default Value: ``
    • The port that the worker will attempt to connect to establish a dirmi connection. If the server RMI socket is behind a load balancer or proxy this should be set to the port of the load balancer or proxy. After attempting to connect to the hosts in this list the worker will attempt to connect to the hosts returned by the webservice.
  • VELOXWORKER_SERVICE_API_ENABLED (Boolean):

    • Default Value: true
    • If set to true the worker will expose a REST API for interacting with the worker service. Currently only a /status/healthcheck endpoint is exposed which is useful when running the worker in a containerized environment.
  • VELOXWORKER_SERVICE_API_HOST (String):

    • Default Value: 0.0.0.0
    • The host that the worker service API will bind to
    • Example Value: 0.0.0.0. Will bind to all hosts
  • VELOXWORKER_SERVICE_API_PORT (Integer):

    • Default Value: 8080
    • The port that the worker service API will bind to

Tag summary

Content type

Image

Digest

sha256:0143564e6

Size

361.8 MB

Last updated

29 days ago

docker pull sapiosciences/sapio_worker:24.12