Skip to main content
Yanok Yanok

Molfar Image

Docker image standard for Yanok automation platform

Schema Version: v0.0.3 Docker OCI Compatible

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

LabelRequiredPurpose
schema_versionYesSchema version used to define the tasks
nameYesHuman readable image name, shorter version of description
descriptionYesA description of what the image and its collection of tasks does
tasksYesA list of task definitions
authorizationsNoA list of authentication tasks
sharedNoShared definitions for task parameters, secrets, and artifacts

Contextual Environment Variables

The system provides the following contextual environment variables to every task

NamePurposeExample
MOLFAR_ACCOUNT_IDID of the account that operates this pipeline4daa6ebd-afa1-4fc5-8cdd-362ae0d487c6
MOLFAR_PIPELINE_IDID of the pipelinef4898e94-529b-48c6-8a7d-689ebd561fd1
MOLFAR_YANOK_ACCESS_TOKENThe user's access token for making calls to Yanok PlatformakjAR21mdsAvcvsaqKJAFS

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

Required
name

Title for what the task does

Required
description

Detailed description of what the task does

Optional
command

How to start this task

Optional
args

Command arguments

Data Flow

Optional
parameters

List of task parameters

Optional
secrets

List of task secrets

Optional
artifacts

List of input and output artifacts

Optional
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: split

Reduce Functions

Reduce functions must have a single input artifact (directory) and single output artifact (file).

task_type: reduce

Other Functions

Standard processing tasks that don't follow map-reduce pattern.

task_type: other

Dockerfile 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