YanokMolfar Image
Docker image standard for Yanok automation platform
Overview
Molfar Image is a type of image that is able to be run on the Yanok automation platform and is able to interact with other images of the same standard. Images use Docker's LABEL definition to define the interface for an OCI image and the platform.
All labels for this definition are scoped under com.yanok.molfar.
Alternative Definition Method:
It is possible to generate a single JSON string with the same definition structure and place it under com.yanok.molfar.json_schema.
Top-level Docker Definition
| Label | Required | Purpose |
|---|---|---|
schema_version | Yes | Schema version used to define the tasks |
name | Yes | Human readable image name, shorter version of description |
description | Yes | A description of what the image and its collection of tasks does |
tasks | Yes | A list of task definitions |
authorizations | No | A list of authentication tasks |
shared | No | Shared definitions for task parameters, secrets, and artifacts |
Contextual Environment Variables
The system provides the following contextual environment variables to every task
| Name | Purpose | Example |
|---|---|---|
MOLFAR_ACCOUNT_ID | ID of the account that operates this pipeline | 4daa6ebd-afa1-4fc5-8cdd-362ae0d487c6 |
MOLFAR_PIPELINE_ID | ID of the pipeline | f4898e94-529b-48c6-8a7d-689ebd561fd1 |
MOLFAR_YANOK_ACCESS_TOKEN | The user's access token for making calls to Yanok Platform | akjAR21mdsAvcvsaqKJAFS |
Task Definition
A task is executed when triggered by the workflow. Workflow data is passed in and out using parameters, secrets, and artifacts.
Task Properties
name Title for what the task does
description Detailed description of what the task does
command How to start this task
args Command arguments
Data Flow
parameters List of task parameters
secrets List of task secrets
artifacts List of input and output artifacts
task_type Specific task type (split, reduce, other)
Specific Task Types
For data parallel processing, the map-reduce pattern uses specific task types
Split Functions
Split functions must have an output parameter that is a single number representing chunks generated.
task_type: splitReduce Functions
Reduce functions must have a single input artifact (directory) and single output artifact (file).
task_type: reduceOther Functions
Standard processing tasks that don't follow map-reduce pattern.
task_type: otherDockerfile Examples
Curl Example
FROM alpine/curl:latest ENTRYPOINT ["curl", "-fsSL", "$(cat /tmp/url)", "-o", "/tmp/out"] LABEL com.yanok.molfar.schema_version="v0.0.2" LABEL com.yanok.molfar.name="Get File with Curl" LABEL com.yanok.molfar.description="Use curl to download a remote file" LABEL com.yanok.molfar.tasks.default.artifacts.input.path="/tmp/url" LABEL com.yanok.molfar.tasks.default.artifacts.input.direction="input" LABEL com.yanok.molfar.tasks.default.artifacts.input.mime_types="text/plain" LABEL com.yanok.molfar.tasks.default.artifacts.input.purpose="URL to be downloaded" LABEL com.yanok.molfar.tasks.default.artifacts.output.path="/tmp/out" LABEL com.yanok.molfar.tasks.default.artifacts.output.direction="output" LABEL com.yanok.molfar.tasks.default.artifacts.output.mime_types="text/plain" LABEL com.yanok.molfar.tasks.default.artifacts.output.purpose="Content of the downloaded page"
Google Drive Integration Example
FROM yanok/google-drive-integration ENTRYPOINT "bin/run" LABEL com.yanok.molfar.schema_version="v0.0.2" LABEL com.yanok.molfar.name="Google Drive" LABEL com.yanok.molfar.description="Integration with Google Drive to handle files" LABEL com.yanok.molfar.tasks.read_file.name="Gets a file's metadata or content by ID" LABEL com.yanok.molfar.tasks.read_file.description="Get metadata and content from Google Drive" LABEL com.yanok.molfar.tasks.read_file.args="files-get" LABEL com.yanok.molfar.tasks.read_file.secrets.auth_token.name="ACCESS_TOKEN" LABEL com.yanok.molfar.tasks.read_file.secrets.auth_token.purpose="Access token for authentication" LABEL com.yanok.molfar.tasks.read_file.secrets.auth_token.from="googleauth.access_token" LABEL com.yanok.molfar.authorizations.googleauth.type="oauth2_auth_code" LABEL com.yanok.molfar.authorizations.googleauth.client_id_env_name="CLIENT_ID" LABEL com.yanok.molfar.authorizations.googleauth.client_secret_env_name="CLIENT_SECRET"
For more documentation and examples, visit the Yanok Documentation