When using cnvrg to run experiments or to start a notebook, there are some cases where the user would like to run a bash script before starting the experiment or notebook.
To support that, cnvrg offers an easy solution as it searches for a prerun.sh file and automatically run it before the experiment/notebook starts:
chmod +x prerun.sh && ./prerun.sh
Before running a new experiment or starting a notebook:
- Create a file name 'prerun.sh' and locate it in the project head tree (in the main projects directory)
- Make sure to sync/push the file before starting an experiment or a notebook
When running the experiment or starting a notebook, cnvrg will first locate the prerun.sh file, will run the script and only then will start the experiment or notebook session.