Skip to content

FAQ and troubleshooting

How can I add an external resource to my Viash component?

Section titled “How can I add an external resource to my Viash component?”

You can add additional resources such as a file containing helper functions. List those files under the resources section of your component config and refer to them in your script using meta["resources_dir"] + "/myresource.txt". See the Viash documentation for concrete examples on how to add helper functions and other resources to your component.

The __merge__ field merges another YAML file into a Viash config. One of its primary uses is ensuring that all components in a task share the same API.

Each task in OpenProblems contains strict definitions of the input/output file interface of its components and the file formats of those files. These interfaces are stored as YAML files in the api subdirectory of each task. When a component config includes __merge__: ../../api/comp_method.yaml, Viash automatically imports those argument definitions, keeping all method configs consistent with the task’s API.


Choosing between multiple versions of Java

Section titled “Choosing between multiple versions of Java”

Your system might have multiple versions of Java installed. To check which versions are available (usually under /usr/lib/jvm/):

ls -1 /usr/lib/jvm/
java-11-openjdk
java-19-openjdk
java-19-openjdk-19.0.0.0.36-2.rolling.el8.x86_64
...

Add the following to your ~/.bashrc (or your execution script) to select the correct version:

export JAVA_HOME=/usr/lib/jvm/java-19-openjdk

If you get a permission denied error on Linux, add your user to the docker group:

sudo usermod -aG docker $USER

Log out and back in again, then verify:

groups
docker run hello-world

If Docker commands fail with a “daemon not running” error, enable Docker to start on boot:

sudo systemctl enable docker
sudo systemctl start docker
docker run hello-world

Check whether Viash is installed in $HOME/.local/bin:

ls $HOME/.local/bin/viash

If it exists but the command is still not found, $HOME/.local/bin is likely missing from your PATH. Check with:

echo $PATH

If /home/youruser/.local/bin is absent, look up instructions for adding a folder to your PATH for your operating system and shell.

Same as above — check $HOME/.local/bin/nextflow exists, then verify $HOME/.local/bin is in your PATH.