viash run

Executes a viash component from the provided viash config file. viash generates a temporary executable and immediately executes it with the given parameters.

Usage:

viash run config.vsh.yaml [-p docker] [-k true/false]  -- [arguments for script]

Arguments

--config

A viash config file (example: config.vsh.yaml). This argument can also be a script with the config as a header.

--verbosity

Executables have 8 levels of verbosity:

  • emergency
  • alert
  • critical
  • error
  • warning
  • notice
  • info
  • debug

The default verbosity level is notice. You can manually set the verbosity by using the --verbosity <int_level> option. For example, if you wanted to only show errors or worse:

viash run config.vsh.yaml – –verbosity 3

-v, --verbose

Bump up the verbosity by one level. By passing -vv the verbosity goes up by two levels.

-c, --config_mod

Modify a viash config at runtime using a custom DSL. (default = List())

-k, --keep

Whether or not to keep temporary files. By default, files will be deleted if all goes well but remain when an error occurs. By specifying --keep true, the temporary files will always be retained, whereas --keep false will always delete them. The temporary directory can be overwritten by setting defining a VIASH_TEMP directory.

-p, --platform

Specifies which platform amongst those specified in the viash config to use. If this is not provided, the first platform will be used. If no platforms are defined in the viash config, the native platform will be used. In addition, the path to a platform yaml file can also be specified.

-h, --help

Show help message

Examples

Running without arguments

Simply run a Viash component with its default platform and no script arguments:

viash run config.vsh.yaml

Passing script arguments

Run a component with script arguments:

viash run config.vsh.yaml -- --input="Hello!" -o=my_file.txt

Preserve temporary files

Here’s how you run a Viash component using the Docker platform and keep the temporary files:

viash run config.vsh.yaml --platform docker --keep true

Combining run options with script arguments

This example runs a component using the native platform and passes arguments to the script:

viash run config.vsh.yaml --platform native -- --input="Hello!" -o=my_file.txt

Override a config with config mods

Run a Viash component using a config mod to override the config file. In this case, pull an image from a docker registry and specify a specific docker registry server URL.

viash run config.vsh.yaml -p docker \
  -c '.platforms[.type == "docker"].setup_strategy := "pull"' \
  -c '.platforms[.type == "docker"].container_registry := "url-to-registry"'

See also