[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [HTCondor-users] Is it possible to set which classads are passed as env vars to docker?




In general, HTCondor sets the same environment variables for a Docker or Singularity job that it would for a vanilla universe job, but it has to use different methods to do get them into the job. Environment variables that a vanilla, docker or singularity job sees can come from several different places:


1) The job submit file, with the "Environment = ..." command

1a) A shortcut to copy all environment variables from condor_submit's environment to the job is with "GetEnv = true", but we would generally recommend not to use this, if possible, as it tends to set environment variables you might not want set. Better to be explicit about the exact variables that should be set.

1b) Really, these come from the job ad, so if you have have a modern condor with schedd transforms, a schedd transform could insert these, though the syntax to append environment variables is ... tricky.

2) The Starter can inject additional, site-specific environment variables into the job with the STARTER_JOB_ENVIRONMENT config setting.

3) The admin can copy all environment variables from the starter's environment into the job by setting JOB_INHERITS_STARTER_ENVIRONMENT = true. As the same with "GetEnv = true", we would generally recommend not using this.


-greg


On 3/17/21 9:48 AM, jcaballero.hep@xxxxxxxxx wrote:
Hi Michael,

Not really.
I already have that wrapper script.
It receives from condor a given set of arguments, including some classads.
What I was asking is how to modify that list of classads being âsentâ to the wrapper script.

Cheers,
Jose

On Mar 17, 2021, at 2:42 PM, Michael Pelletier via HTCondor-users <htcondor-users@xxxxxxxxxxx> wrote:

ïFor an 8.8 solution, you could write a wrapper script and point the "DOCKER" config value to it. The script would then be able to mangle the argument list in any way it liked. That's the approach I took with Singularity before the extra-args option was added.

Michael V Pelletier
Principal Engineer

Raytheon Technologies
Digital Technology
HPC Support Team


-----Original Message-----
From: HTCondor-users <htcondor-users-bounces@xxxxxxxxxxx> On Behalf Of thomas.hartmann@xxxxxxx
Sent: Wednesday, March 17, 2021 6:23 AM
To: htcondor-users@xxxxxxxxxxx
Subject: [External] Re: [HTCondor-users] Is it possible to set which classads are passed as env vars to docker?

Hi Jose,

for Singularity, I know that the extra arguments ad allows to tweak Singularity arguments [1]
   SINGULARITY_EXTRA_ARGUMENTS = ...

Release 8.9.1 seems to have added the same option for Docker
   DOCKER_EXTRA_ARGUMENTS = ...
but I have not tried it myself - so YMMV ;)

Cheers,
   Thomas

[1]
https://htcondor.readthedocs.io/en/latest/admin-manual/singularity-support.html

[2]
https://htcondor.readthedocs.io/en/latest/admin-manual/configuration-macros.html#DOCKER_EXTRA_ARGUMENTS

On 17/03/2021 11.07, jcaballero.hep@xxxxxxxxx wrote:
Hi,

I see some classads are passed as environment variables to the docker
command via -e input option. For example:

-e TEMP=...
-e _CONDOR_SCRATCH_DIR=...
-e _CONDOR_SLOT=...

etc.

Is this list of classads hardcoded? Or is there a way to configure?

Thanks a lot in advance.
Cheers,
Jose
_______________________________________________
HTCondor-users mailing list
To unsubscribe, send a message to htcondor-users-request@xxxxxxxxxxx
with a
subject: Unsubscribe
You can also unsubscribe by visiting
https://lists.cs.wisc.edu/mailman/listinfo/htcondor-users

The archives can be found at:
https://lists.cs.wisc.edu/archive/htcondor-users/


_______________________________________________
HTCondor-users mailing list
To unsubscribe, send a message to htcondor-users-request@xxxxxxxxxxx with a
subject: Unsubscribe
You can also unsubscribe by visiting
https://lists.cs.wisc.edu/mailman/listinfo/htcondor-users

The archives can be found at:
https://lists.cs.wisc.edu/archive/htcondor-users/
_______________________________________________
HTCondor-users mailing list
To unsubscribe, send a message to htcondor-users-request@xxxxxxxxxxx with a
subject: Unsubscribe
You can also unsubscribe by visiting
https://lists.cs.wisc.edu/mailman/listinfo/htcondor-users

The archives can be found at:
https://lists.cs.wisc.edu/archive/htcondor-users/