From 21a41d2f80b8acd365464ab8fa2ef3bc0799edcd Mon Sep 17 00:00:00 2001 From: jdhayhurst Date: Wed, 3 Jun 2020 18:28:37 +0100 Subject: [PATCH] trigger the ftp logic with env var, dirnames are just gcsts --- sumstats_service/resources/api_utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sumstats_service/resources/api_utils.py b/sumstats_service/resources/api_utils.py index 32cdabd..8ac05ba 100644 --- a/sumstats_service/resources/api_utils.py +++ b/sumstats_service/resources/api_utils.py @@ -48,8 +48,8 @@ def validate_files_from_payload(callback_id, content): content = json.dumps(content).translate(str.maketrans({'"': '\\"'})) bsub_com = 'singularity exec --bind {sp} docker://{image}:{tag} validate-payload -cid {cid} -out {outfile} -storepath {sp} -ftpserver {ftps} -ftpuser {ftpu} -ftppass {ftpp} -payload \'{content}\''.format( image=config.SINGULARITY_IMAGE, tag=config.SINGULARITY_TAG, cid=callback_id, outfile=outfile, sp=config.STORAGE_PATH, ftps=config.FTP_SERVER, ftpu=config.FTP_USERNAME, ftpp=config.FTP_PASSWORD, content=content) - command = 'export http_proxy={hp}; export https_proxy={hsp}; mkdir -p {pd}; bsub -oo {pd}/stdout -eo {pd}/stderr -M {mem} -R "rusage[mem={mem}]" "{bsub_com}"'.format( - pd=par_dir, q=config.COMPUTE_FARM_QUEUE, mem=memory, bsub_com=bsub_com, hp=config.REMOTE_HTTP_PROXY, hsp=config.REMOTE_HTTPS_PROXY) + command = 'export http_proxy={hp}; export https_proxy={hsp}; export VALIDATE_WITH_SSH={ssh} mkdir -p {pd}; bsub -oo {pd}/stdout -eo {pd}/stderr -M {mem} -R "rusage[mem={mem}]" "{bsub_com}"'.format( + pd=par_dir, q=config.COMPUTE_FARM_QUEUE, mem=memory, bsub_com=bsub_com, hp=config.REMOTE_HTTP_PROXY, hsp=config.REMOTE_HTTPS_PROXY, ssh=config.VALIDATE_WITH_SSH) logger.debug('command:\n{}'.format(command)) stdin, stdout, stderr = ssh.exec_command(command) jobid = ssh.parse_jobid(stdout)