Package config

A _viash.yaml file in the root of the package repository is called a Viash package config. It allows defining project-wide settings such as the location of the Viash components, which Viash version to use and more.

Example package config

# project settings
name: project_template
organization: viash-io
version: 0.3.0
# metadata
description: |
  This is a project template for viash projects.
keywords: [viash, template]
license: GPL-3.0
links:
  repository: https://github.com/viash-io/viash_project_template
  issue_tracker: https://github.com/viash-io/viash_project_template/issues
  docker_registry: ghcr.io
# authors:
#   - name: Alice
#     roles: [author, maintainer]
#   - name: Bob
#     roles: [author]

# settings
viash_version: 0.9.0-RC6

Viash version

Pinning the version of Viash used in your project is essential to ensure reproducibility thereof across multiple systems. In doing so, all Viash commands will be run using that version of Viash.

Example:

echo 'viash_version: "0.9.0"' > _viash.yaml

viash --version
viash 0.9.0 (c) 2020 Data Intuitive

Source directory

Overrides the --src parameter of any viash ns command. This is useful in case the directory containing the Viash component source code is in a directory different from src/.

Destination directory

Overrides the --target parameter of any viash ns command. This is useful in case the artifacts generated by Viash should be stored in a directory different from target/.

Advanced configuration

Viash allows for rewriting component configuration files using config mods. Config mods allow making changes to the config mods on the fly.

The template project contains these default config mods:

config_mods: |
  .version := 'dev'
  .argument_groups[true].arguments[.multiple == true].multiple_sep := ":"
  .runners[.type == 'nextflow'].directives.tag := '$id'

This has the following effects:

  • Set the version of any components to 'dev'.

  • Overrides the default multiple seperator ; and sets it to :.

  • Adds a default directive to the Nextflow runner.