Uploaded image for project: 'Pegasus'
  1. Pegasus
  2. PM-1285

Exporting environmental variables in containers with the same technique

XMLWordPrintable

      As of version 4.8.3dev we are using two different ways of exporting environmental variables in containers with Docker and Singularity.
      For Docker we are exporting the environmental variables with the "-e" command line argument of the docker run command, while for Singularity we are exporting the environmental variables with an "export" command placed in the wrapper script that is executed in the containers and call pegasus-kickstart.

      I believe this distinction happened because Singularity doesn't provide a way to set additional environmental arguments for the container from the command line.

      However, the second solution can work for both cases and actually provide better support for Docker as well.
      Setting additional environmental variables with Docker's "-e" argument, doesn't work for all cases.
      1) We cannot do variable expansion based on an already existing variable in the container, since the container hasn't started yet.
      2) Some of the distributions tend to overwrite and not expand common variables. For example "PATH" is overwritten by Debian and Ubuntu, while CentOS expands it. So you cannot export "PATH" to a Docker container with "-e" reliably.

      So I'm suggesting to export variables in containers with the same way in both Docker and Singularity cases.

        1. docker_simapp1_ID0000001.sh
          3 kB
          George Papadimitriou
        2. singularity_simapp1_ID0000001.sh
          2 kB
          George Papadimitriou

            Assignee:
            vahi Karan Vahi
            Reporter:
            georgpap George Papadimitriou
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: