Skip to content

Commit

Permalink
Fix regression causing an error when "secure" is provided in bucket s…
Browse files Browse the repository at this point in the history
…ettings
  • Loading branch information
allegroai committed Feb 9, 2024
1 parent 956e7e4 commit b78e9b9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions clearml/backend_config/bucket_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ def update(
use_credentials_chain=False,
token="",
extra_args=None,
secure=True,
profile=""
):
self.key = key
Expand All @@ -54,6 +55,7 @@ def update(
self.region = region
self.use_credentials_chain = use_credentials_chain
self.extra_args = extra_args
self.secure = secure
self.profile = profile

def is_valid(self):
Expand Down
3 changes: 3 additions & 0 deletions clearml/backend_interface/setupuploadmixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ def setup_aws_upload(
multipart=True, # bool
secure=True, # bool
verify=True, # bool
profile=None # Optional[str]
):
# type: (...) -> None
"""
Expand All @@ -85,6 +86,7 @@ def setup_aws_upload(
multipart.
:param secure: Server supports HTTPS. Only required when using a Non-AWS S3 solution that only supports HTTPS.
:param verify: Whether or not to verify SSL certificates.
:param profile: The AWS profile
Only required when using a Non-AWS S3 solution that only supports HTTPS with self-signed certificate.
"""
self._bucket_config = S3BucketConfig( # noqa
Expand All @@ -98,6 +100,7 @@ def setup_aws_upload(
multipart=multipart,
secure=secure,
verify=verify,
profile=profile
)
StorageHelper.add_aws_configuration(self._bucket_config, log=self.log)
self.storage_uri = StorageHelper.get_aws_storage_uri_from_config(self._bucket_config)
Expand Down
4 changes: 4 additions & 0 deletions clearml/backend_interface/task/populate.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,14 +213,18 @@ def create_task(self, dry_run=False):
task_state['script']['requirements'] = repo_info.script.get('requirements') or {}
if self.cwd:
self.cwd = self.cwd
# cwd should be relative to the repo_root, but we need the full path
# (repo_root + cwd) in order to resolve the entry point
cwd = (Path(repo_info.script['repo_root']) / self.cwd).as_posix()

if not Path(cwd).is_dir():
raise ValueError("Working directory \'{}\' could not be found".format(cwd))
entry_point = \
Path(repo_info.script['repo_root']) / repo_info.script['working_dir'] / repo_info.script[
'entry_point']
# resolve entry_point relative to the current working directory
entry_point = entry_point.relative_to(cwd).as_posix()
# restore cwd - make it relative to the repo_root again
cwd = Path(cwd).relative_to(repo_info.script['repo_root']).as_posix()
task_state['script']['entry_point'] = entry_point or ""
task_state['script']['working_dir'] = cwd or "."
Expand Down

0 comments on commit b78e9b9

Please sign in to comment.