Skip to content

Commit

Permalink
Merge pull request #92 from eth-cscs/dev
Browse files Browse the repository at this point in the history
Fixed check on xfer-external/download when file is uploaded to staging area
  • Loading branch information
fcruzcscs authored Apr 7, 2021
2 parents e4b4d6c + ce50014 commit 238cb96
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion doc/openapi/firecrest-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ servers:
- url: 'http://FIRECREST_URL'
- url: 'https://FIRECREST_URL'
info:
version: 1.7.2-beta1
version: 1.7.3-beta1
title: FirecREST Developers API
description: >
This API specification is intended for FirecREST developers only. There're some endpoints that are not available in the public version for client developers.
Expand Down
2 changes: 1 addition & 1 deletion doc/openapi/firecrest-developers-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ servers:
- url: 'http://FIRECREST_URL'
- url: 'https://FIRECREST_URL'
info:
version: 1.7.2-beta1
version: 1.7.3-beta1
title: FirecREST API
description: >
FirecREST platform, a RESTful Services Gateway to HPC resources, is a
Expand Down
7 changes: 5 additions & 2 deletions src/common/cscs_api_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,6 @@ def exec_remote_command(auth_header, system_name, system_addr, action, file_tran
logging.info(f"stdout: ({stdout_errno}) --> {stdout_errda}")
logging.info(f"sdtout: ({stdout_errno}) --> {outlines}")

# TODO: change precedence of error, because in /xfer-external/download this gives error and it s not an error
if stderr_errno == 0:
if stderr_errda and not (in_str(stderr_errda,"Could not chdir to home directory") or in_str(stderr_errda,"scancel: Terminating job")):
result = {"error": 1, "msg": stderr_errda}
Expand All @@ -359,13 +358,17 @@ def exec_remote_command(auth_header, system_name, system_addr, action, file_tran
else:
result = {"error": 0, "msg": outlines}
elif stderr_errno > 0:
result = {"error": stderr_errno, "msg": stderr_errda or stdout_errda}
if stderr_errno == 7:
result = {"error": 7, "msg": "Failed to connect to staging area server"}
else:
result = {"error": stderr_errno, "msg": stderr_errda or stdout_errda}
elif len(stderr_errda) > 0:
result = {"error": 1, "msg": stderr_errda}
elif stdout_errno == -2:
result = {"error": -2, "msg": "Receive ready timeout exceeded"}
elif stderr_errno == -1:
result = {"error": -1, "msg": "No exit status was provided by the server"}



# first if paramiko exception raise
Expand Down
2 changes: 1 addition & 1 deletion src/storage/s3v2OS.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ def create_upload_form(self, sourcepath, containername, prefix, ttl, max_file_si
"headers": {}
}

command = f"curl -i -X {httpVerb} '{url}?AWSAccessKeyId={self.user}&Signature={sig}&Expires={expires}' -T {sourcepath}"
command = f"curl --show-error -s -i -X {httpVerb} '{url}?AWSAccessKeyId={self.user}&Signature={sig}&Expires={expires}' -T {sourcepath}"

retval["command"] = command

Expand Down
2 changes: 1 addition & 1 deletion src/storage/s3v4OS.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ def create_upload_form(self, sourcepath, containername, prefix, ttl, max_file_si
"headers": {}
}

command = f"curl -i -X {httpVerb} {endpoint_url}/{containername}"
command = f"curl --show-error -s -i -X {httpVerb} {endpoint_url}/{containername}"

for k,v in retval["parameters"]["data"].items():
command += f" -F '{k}={v}'"
Expand Down
2 changes: 1 addition & 1 deletion src/storage/swiftOS.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ def create_upload_form(self,sourcepath,containername,prefix,ttl,max_file_size):
signature = hmac.new(secret, hmac_body, sha1).hexdigest()

# added OBJECT_PREFIX as dir_[task_id] in order to become unique the upload instead of user/filename
command = f"curl -i {swift_url}/{swift_version}/{swift_account}/{containername}/{prefix}/" \
command = f"curl --show-error -s -i {swift_url}/{swift_version}/{swift_account}/{containername}/{prefix}/" \
f" -X POST " \
f"-F max_file_size={max_file_size} -F max_file_count={max_file_count} " \
f"-F expires={expires} -F signature={signature} " \
Expand Down

0 comments on commit 238cb96

Please sign in to comment.