Skip to content

OSCAR Service

OSCAR allows the creation of serverless file-processing services based on container images. These services require a user-defined script with the commands responsible of the processing. The platform automatically mounts a volume on the containers with the FaaS Supervisor component, which is in charge of:

  • Downloading the file that invokes the service and make it accessible through the INPUT_FILE_PATH environment variable.
  • Execute the user-defined script.
  • Upload the content of the output folder accessible via the TMP_OUTPUT_DIR environment variable.

FaaS Supervisor

FaaS Supervisor, the component in charge of managing the input and output of services, allows JSON or base64 encoded body in service requests. The body of these requests will be automatically decoded into the invocation's input file available from the script through the $INPUT_FILE_PATH environment variable.

The output of synchronous invocations will depend on the application itself:

  1. If the script generates a file inside the output dir available through the $TMP_OUTPUT_DIR environment variable, the result will be the file encoded in base64.
  2. If the script generates more than one file inside $TMP_OUTPUT_DIR, the result will be a zip archive containing all files encoded in base64.
  3. If there are no files in $TMP_OUTPUT_DIR, FaaS Supervisor will return its logs, including the stdout of the user script run. To avoid FaaS Supervisor's logs, you must set the service's log_level to CRITICAL.

This way users can adapt OSCAR's services to their own needs.

The FaaS Supervisor supports the following storage back-ends:

Container images

Container images on asynchronous services use the tag imagePullPolicy: Always, which means that Kubernetes will check for the image digest on the image registry and download it if it is not present. So, if you are using an image without a specific tag or with the latest tag, the service will automatically download and use the most recent version of the image on its executions, whenever the image is updated.

You can follow one of the examples in order to test the OSCAR framework for specific applications. We recommend you to start with the plant classification example.

External Storage Providers

FaaS Supervisor, download the input file and upload the output file. There are multiple Storage available to interact with. Each Storage has parameters, an authentication process, and particularities.

MinIO

OSCAR installs a MinIO inside the cluster. This default MinIO can be referenced as minio or minio.default in the input and output parameters of the OSCAR service. Suppose you define a new MinIO cluster in the storage provider. You can use a MinIO outside the cluster. MinIO Storage works as input or output without any other third-party software. Also, MinIO can make a bucket replication between two buckets.

dCache

dCache use WebDAV protocol. dCache works as an output storage without any other third-party software. However, DCNiOS is necessary for input storage.

The EGI check-in authentication process is not available.

S3

You have to pass the AWS credentials to the FaaS Supervisor by defining them in the environment variables with the keys AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, and AWS_DEFAULT_REGION. S3 works as an output storage system without any third-party software. But DCNiOS is necessary as input storage.

ONEDATA

ONEDATA is a global data access solution for science that only works as an output storage provider. Check the ONEDATA Storage provider for more information.

Storage