singularityhub / singularity-cli

streamlined singularity python client (spython) for singularity
https://singularityhub.github.io/singularity-cli/
Mozilla Public License 2.0
57 stars 31 forks source link

conversion issue (ENV) #20

Closed samcmill closed 6 years ago

samcmill commented 6 years ago

This is valid Dockerfile syntax to set 2 environment variables:

ENV A=B X=Y

When converting this from Docker to Singularity, the Singularity output is incorrect:

%post
A=B=X=Y
%environment
export A=B=X=Y
vsoch commented 6 years ago

thank you!

vsoch commented 6 years ago

okay, I think this is fixed up. here is the old parser:

parse_env('A=B')
['A=B']

# here is the specific bug
parse_env('A=B C=D')
['A=B=C=D']

parse_env(['A=B C=D'])
['A=B=C=D']

parse_env(['A=B','C=D'])
['A=B', 'C=D']

parse_env(['A B','C D'])
 ['A=B', 'C=D']

and the same with the update:

parse_env('A=B')
['A=B']

parse_env('A=B C=D')
['A=B', 'C=D']

parse_env(['A=B','C=D'])
['A=B', 'C=D']

parse_env(['A B','C D'])
['A=B', 'C=D']

This fix along with the "as Level" being removed are done in https://github.com/singularityhub/singularity-cli/pull/25. If you want to take a quick look and give an A-OK, I can merge and release on pypi as version 0.0.26 and update the version in Tunel. Thanks for your help with this!

vsoch commented 6 years ago

This was fixed, in version 0.0.28 on pypi