Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add --no-eval for OCI compatible argument and env var handling #704

Merged
merged 4 commits into from
Apr 13, 2022

Conversation

dtrudg
Copy link
Member

@dtrudg dtrudg commented Apr 11, 2022

Description of the Pull Request (PR):

Address #487 by adding a --no-eval actions flag, which does the following:

  1. Quotes environment variable values in the inject-singularity-env.sh generated script using single quotes to
    ensure the values are not evaluated when the injection script is sourced.

    This behavior applies to existing and newly created images.

  2. Uses an alternate path in the generated runscript for images built from OCI sources, that avoids evaluating CMD / ENTRYPOINT parts, and args in the shell.

    This behavior only applies to newly created images, that contain the new form of the generated OCI runscript.

The --no-eval flag is implictly added by the Docker/OCI --compat mode.

Also adds test cases that cover this new functionality, the historic behavior, and general handling of CMD / ENTRYPOINT/ CMD+ENTRYPOINT handling and overrides in Docker/OCI images. This should help us a lot in catching any changes to the 'historic' behaviour, that has been modified inadvertently in the past.

There is no change to the historic behavior of Singularity (run without --no-eval or --compat) at this time. OCI / Docker compatible handling by default may be considered for a future release.

This fixes or addresses the following GitHub issues:

Before submitting a PR, make sure you have done the following:

@dtrudg dtrudg added the enhancement New feature or request label Apr 11, 2022
@dtrudg dtrudg added this to the SingularityCE 3.10 milestone Apr 11, 2022
@dtrudg dtrudg self-assigned this Apr 11, 2022
@dtrudg dtrudg force-pushed the issue487 branch 5 times, most recently from f4cefcc to 3b7648f Compare April 12, 2022 15:22
Address sylabs#487 by adding a `--no-eval` actions flag, which does the
following:

1) Quotes environment variable value in the
`inject-singularity-env.sh` generated script using single quotes to
ensure the values are not evaluated when the injection script is
sourced.

This behavior applies to existing and newly created images.

2) Uses an alternate path in the generated runscript for images built
from OCI sources, that avoids evaluating CMD / ENTRYPOINT parts, and
args in the shell.

This behavior only applies to newly created images, that contain the
new form of the generated OCI runscript.

The `--no-eval` flag is implictly added by the Docker/OCI `--compat`
mode.
@dtrudg dtrudg marked this pull request as ready for review April 12, 2022 15:57
Copy link
Member

@tri-adam tri-adam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work, LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Compatibility mode to match Docker/OCI arg and env escaping / quoting behaviour
2 participants