Skip to content
Snippets Groups Projects
Commit c521a0ec authored by Sebastian Brommer's avatar Sebastian Brommer :hand_splayed_tone4:
Browse files

update prepare script

parent fd9a42f2
No related branches found
No related tags found
No related merge requests found
......@@ -6,16 +6,16 @@ import json
def get_job_ad():
instream = sys.stdin
# dump the input stream to a file for debugging
with open("/scratch/job_ad.txt", "w") as f:
for line in instream:
f.write(line)
# # dump the input stream to a file for debugging
# with open("/scratch/job_ad.txt", "w") as f:
# for line in instream:
# f.write(line)
job_ad = {}
# format of the job ad is key = value
for line in instream:
if "=" in line:
key, value = line.split(" = ")
if " = " in line:
key = line.split(" = ")[0]
value = line.replace(f"{key} = ", "")
job_ad[key.strip()] = value.strip()
return job_ad
......@@ -59,12 +59,12 @@ def main():
dumpfilepath = "/scratch/job_ad.json"
with open(dumpfilepath, "w") as f:
json.dump(job_ad, f, indent=4)
container_image = job_ad.get("container_image")
docker_image = job_ad.get("docker_image")
container_image = job_ad.get("ContainerImage")
docker_image = job_ad.get("DockerImage")
if not container_image and not docker_image:
print(
"container_image = /cvmfs/unpacked.cern.ch/registry.hub.docker.com/mschnepf/slc7-condocker:latest"
"ContainerImage = /cvmfs/unpacked.cern.ch/registry.hub.docker.com/mschnepf/slc7-condocker:latest"
)
print("WantDocker = false")
return
......@@ -77,7 +77,7 @@ def main():
condor_arg = image_path
else:
condor_arg = f"docker://{domain}/{imagename}"
print(f"container_image = {condor_arg}")
print(f"ContainerImage = {condor_arg}")
print("WantDocker = false")
# write the image path to a .cfg file to be used by condor
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment