Tasks
A Task is the basic building block for a program execution on Firestarter. It contains the URL or CID of the program image, the command to execute in VM and the program arguments. It also has fields for defining the input and output files for the program.
Task specific input files are specified as inputContexts where the source
field contains either a URL or a Firestarter private IPFS network CID.
Input context target
specifies the file path in the program VM. Its prefix must always be /mnt/gevulot/input
.
Task specific output files are specified as outputContexts where the source
specifies the file path in the program VM. Its prefix must always be /mnt/gevulot/output
. retentionPeriod
value species how long the file is kept live in the Gevulot network. Unit of retentionPeriod
is seconds. In general 900
(15 minutes) is a good default.
Task spec compute units
CPUs
Number of CPUs may be specified as raw number or as a string with unit suffix. List of available units:
cpu
,cpus
core
,cores
mcpu
,mcpus
millicpu
,millicpus
mcore
,mcores
millicore
,millicores
e.g. 3 CPU cores -> cpus: 3
or cpus: 3 cpu
or cpus: 3000 mcores
Memory
Amount of memory reserved for the task may be specified as a raw number in bytes or as a string with unit suffix (e.g., B, Kb, Kib, Mb, Mib, Gb, Gib).
e.g. 32GB -> memory: 32000000
or memory: 32GB
NOTE: Due to platform orchestration overhead, the Task memory requirement cannot be the same as the maximum amount of RAM on the worker node. Current implementation allocates 10% extra and 64MB at minimum for the extra overhead required. This is subject to change as we optimize the system.
GPUs
Number of GPUs may be specified as raw number or as a string with unit suffix. List of available units:
gpu
,gpus
mgpu
,mgpus
milligpu
,milligpus
e.g. 1 GPU -> gpus: 1
or gpus: 1 gpu
or gpus: 1000 milligpus
Example
Here is a Hello World example task that reads a text input file from an HTTP URL, prints it and writes the system's CPU & RAM information into the output file.
The task can be submitted using gvltctl
. Install the latest gvltctl
tool from releases.
gvltctl task create -e "$GEVULOT_ENDPOINT" -n "$GEVULOT_MNEMONIC" -f task.yaml
The gvltctl
will then submit a transaction that allocates a dedicated worker for the task on-chain. The output looks roughly as follows:
You can use gvltctl task get
to fetch the latest version of a task (with the status field):
In the example above, the task was already executed.
Task outputs
Taske always have stdout
and stderr
output stored in the Firestarter private IPFS network, if the respective storeStdout
and storeStderr
are set to true
. If the task has outputContexts
specified, the corresponding CIDs can be found from the status
part as well. The resulting CIDs in status.outputContexts
are in the same order as specified in the spec.outputContexts
.
In the above example, the output file produced by the program can be accessed through a read-only IPFS gateway at https://data.firestarter.gevulot.com/ipfs
For example above output file can be fetched with:
curl https://data.firestarter.gevulot.com/ipfs/QmfF7B77SF1ehLrohzphWj8YtpXLJ4biGFqJjW6sjPTUNe
Similarly the stdout and stderr can be fetched with:
curl https://data.firestarter.gevulot.com/ipfs/QmReATRWt5Cya4sCVUXGr9xiuta3StEg5R8WA14ojKNCpm
and
curl https://data.firestarter.gevulot.com/ipfs/QmbFMke1KXqnYyBBWxB74N4c5SBnJMVAiMNRcGu6x1AwQH
Last updated