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

Allow extra volume bindings and custom wrapper config file #678

Merged
merged 4 commits into from
Sep 4, 2022

Conversation

gouttegd
Copy link
Contributor

This PR:

a) Adds a new ODK_BINDS variable to the run.sh wrapper script, which can be used to specify extra volume bindings within the Docker or Singularity container. Use as follows:

ODK_BINDS=/path/to/host/dir1:/path/to/container/dir1[:options][,...] sh run.sh ...

b) Adds a new ODK_DOCKER_OPTIONS variable, to allow user to pass any custom options to the invocation of docker run. Another variable, ODK_SINGULARITY_OPTIONS, does the same for the invocation of singularity exec.

c) Allows to set variables for the run.sh wrapper in a file named run.sh.conf (in the same directory as the wrapper script itself). That file should contain standard Bourne-shell variable declarations, and will be sourced (if it exists) by the wrapper script. It allows to use variables such as the new ODK_BINDS, ODK_DOCKER_OPTIONS, but also the pre-existing ODK_IMAGE or ODK_TAG, once and for all in the run.sh.conf file, instead of having to export them to the user’s environment or set them every time the wrapper script is invoked.

closes #675

Add a new overridable variable to the `run.sh` script to allow users to
specify extra volume bindings. If set, the variable should contain a
comma-separated list of bindings of the form:

  <directory on the host>:<mounting point in the container>[:options]`
Allow users to pass arbitrary options to the `docker run` command by
setting the `ODK_DOCKER_OPTIONS` variable prior to calling the `run.sh`
script.

Likewise, users of Singularity can set the `ODK_SINGULARITY_OPTIONS`
variable to pass arbitrary options to the `singularity exec` command.
Make the `run.sh` wrapper script check for a `run.sh.conf` file in the
`src/ontology` directory, and source that file if it exists.

This is to allow users to customize the behaviour of the wrapper script
by setting any of the ODK_* variable in that `run.sh.conf` file, instead
of having to export them in the environment or to manually set them at
each invocation of the wrapper script.

The `run.sh.conf` file is excluded from version control. It is intended
for local use only, not to be shared between all editors of the
ontology.
@gouttegd gouttegd self-assigned this Aug 31, 2022
@gouttegd gouttegd requested a review from matentzn August 31, 2022 22:21
@gouttegd gouttegd merged commit b66db3e into master Sep 4, 2022
@gouttegd gouttegd deleted the allow-extra-binds branch September 4, 2022 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make it easier to pass additional volume bindings into run.sh
2 participants