allegroai / clearml-agent

ClearML Agent - ML-Ops made easy. ML-Ops scheduler & orchestration solution
https://clear.ml/docs/
Apache License 2.0
229 stars 89 forks source link

How to run a bash script instead of a Python script in clearml-agent? #205

Open konstantinator opened 1 month ago

konstantinator commented 1 month ago

I've noticed that with clearml, I can only run Python scripts, which is not very convenient for me. I would like to run Python scripts through bash using accelerate (for training on multiple GPUs). Currently, I have to launch the bash script through Python code, like this:

import os
os.system('./hello.sh')

The sh script (hello.sh) itself looks something like this:

CUDA_VISIBLE_DEVICES=0,1 \
accelerate launch --config_file config.yaml hello.py --arg_1 2 --arg_2 file.csv

This solution seems like a workaround. Is there a more proper approach?

jkhenning commented 1 month ago

Hi @konstantinator , thanks for the input! This is currently the way to do that. We'll add an option to run bash scripts in future versions :)