Dear All,
I build my docker image with my external code. I would like to make AiiDA to run it. I followed the instruction in the manual, where an example setup is shown:
verdi code create core.code.containerized \
--non-interactive \
--label containerized-code \
--computer some-computer \
--filepath-executable "/bin/sh" \
--image-name "docker://alpine:3" \
--engine-command "singularity exec --bind $PWD:$PWD {image_name}"
So far it is straight forward. However, I had an issue running my code, when I checked _aiidasubmit.sh
I mediatelly saw where the problem is:
'docker' 'run' '-v' '$(pwd):/data' 'pq-aiida' '/bin/entrypoint.sh' < 'aiida.inp' > 'aiida-pq2.out'`
Since I want to mount the local directory into my container, I need to resolve $(pwd)
, but in that case I need double quotes not single. So I checked the documentation. There are two option that seams relevant: wrap_cmdline_params
and use_double_quotes
. So set them to (false,false)
, (true,false)
, (false,true)
and (true,true)
and non of the option actually could resolve my problem of $(pwd)
being in single quotes as you can see on the respective results:
'docker' 'run' '-v' '$(pwd):/data' 'pq-aiida' '/bin/entrypoint.sh' < 'aiida.inp' > 'aiida-pq2.out'
'docker' 'run' '-v' '$(pwd):/data' 'pq-aiida' "'/bin/entrypoint.sh' < 'aiida.inp' > 'aiida-pq2.out' "
'docker' 'run' '-v' '$(pwd):/data' 'pq-aiida' "/bin/entrypoint.sh" < 'aiida.inp' > 'aiida-pq2.out'
'docker' 'run' '-v' '$(pwd):/data' 'pq-aiida' ""'"'"/bin/entrypoint.sh"'"'" < 'aiida.inp' > 'aiida-pq2.out' "
Last one is somewhat crazy, anyway, my quostion is how can I force AiiDA to use single quotes in order to mount mount my local directory to the container?