File Injection#
Files#
Local files can be injected into a task’s container image. You can define file contents inline or pass a relative path. The file path must be relative to the where the spec resides.
Note
File injection is not supported when submitting a workflow through the UI. Please use the CLI to submit workflows with local files. For more information, see Submit via CLI.
Inline#
The following example defines a file inline:
workflow:
name: "inline-files"
tasks:
- name: task1
image: ubuntu
command: [sh]
args: [/tmp/run.sh] # (1)
files:
- contents: | # (2)
echo "Hello from task1!"
path: /tmp/run.sh # (3)
Executes the file as a shell script.
The
contentsfield is used to define the contents of the file.The
pathfield is used to designate where to create this file in the task’s container.
Localpath#
The following example defines a file with its relative path on the host machine:
workflow:
name: "localpath-files"
tasks:
- name: task1
image: ubuntu
command: [sh]
args: [/tmp/run.sh]
files:
- localpath: files/my_script.sh # (1)
path: /tmp/run.sh # (2)
The
localpathfield is used to designate the path of the file on the host machine.The
pathfield is used to designate where to create this file in the task’s container.
Warning
The localpath field only supports files. NOT directories.
Directory Inputs#
OSMO does not upload local directories during workflow submission.
For large inputs, place the data in external object storage and reference it with url in
inputs, or produce it in an upstream task and consume it through a task dependency.
See also
See Inputs and Outputs for supported
taskandurldata flows.See Submit via CLI for CLI-only features that remain supported during submission.