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

Exporting environmental variables in containers with the same technique



    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 4.8.2
    • Fix Version/s: master, 4.9.0, 4.8.3
    • Component/s: Code Generators
    • Labels:


      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.




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


              • Created: