The recently-introduced include_directory option allows all the files in the input notebook's directory to be copied into the container image in the directory of the generated script. In typical notebook code, such auxiliary files are expected to be found in the CWD. When the image is run as an EOAP by cwltool, a new working directory is created and used, so code like t = Path("myauxfile.txt").read_text() won't work. current workaround (documented here) is to check if __file__ is set and if so, resolve paths relative to it. It would be more user-friendly for the xcengine run-time wrapper code to automatically ensure that the auxiliary files are in the CWD, no matter where it is. It should be enough to check whether the CWD is the default, and if not, to move the auxiliary files to the new CWD.
Implementation will be easier after the implementation of #97 -- then /home/mambauser/workdir/ should contain only run-time auxiliary files, making the copying more straightforward.
The recently-introduced
include_directoryoption allows all the files in the input notebook's directory to be copied into the container image in the directory of the generated script. In typical notebook code, such auxiliary files are expected to be found in the CWD. When the image is run as an EOAP by cwltool, a new working directory is created and used, so code liket = Path("myauxfile.txt").read_text()won't work. current workaround (documented here) is to check if__file__is set and if so, resolve paths relative to it. It would be more user-friendly for the xcengine run-time wrapper code to automatically ensure that the auxiliary files are in the CWD, no matter where it is. It should be enough to check whether the CWD is the default, and if not, to move the auxiliary files to the new CWD.Implementation will be easier after the implementation of #97 -- then
/home/mambauser/workdir/should contain only run-time auxiliary files, making the copying more straightforward.