mirror of
https://github.com/clearml/clearml
synced 2025-04-08 22:54:44 +00:00
Fix regression causing an error when "secure" is provided in bucket settings
This commit is contained in:
parent
956e7e4478
commit
b78e9b9047
@ -45,6 +45,7 @@ class S3BucketConfig(object):
|
|||||||
use_credentials_chain=False,
|
use_credentials_chain=False,
|
||||||
token="",
|
token="",
|
||||||
extra_args=None,
|
extra_args=None,
|
||||||
|
secure=True,
|
||||||
profile=""
|
profile=""
|
||||||
):
|
):
|
||||||
self.key = key
|
self.key = key
|
||||||
@ -54,6 +55,7 @@ class S3BucketConfig(object):
|
|||||||
self.region = region
|
self.region = region
|
||||||
self.use_credentials_chain = use_credentials_chain
|
self.use_credentials_chain = use_credentials_chain
|
||||||
self.extra_args = extra_args
|
self.extra_args = extra_args
|
||||||
|
self.secure = secure
|
||||||
self.profile = profile
|
self.profile = profile
|
||||||
|
|
||||||
def is_valid(self):
|
def is_valid(self):
|
||||||
|
@ -67,6 +67,7 @@ class SetupUploadMixin(object):
|
|||||||
multipart=True, # bool
|
multipart=True, # bool
|
||||||
secure=True, # bool
|
secure=True, # bool
|
||||||
verify=True, # bool
|
verify=True, # bool
|
||||||
|
profile=None # Optional[str]
|
||||||
):
|
):
|
||||||
# type: (...) -> None
|
# type: (...) -> None
|
||||||
"""
|
"""
|
||||||
@ -85,6 +86,7 @@ class SetupUploadMixin(object):
|
|||||||
multipart.
|
multipart.
|
||||||
:param secure: Server supports HTTPS. Only required when using a Non-AWS S3 solution that only supports HTTPS.
|
: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 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.
|
Only required when using a Non-AWS S3 solution that only supports HTTPS with self-signed certificate.
|
||||||
"""
|
"""
|
||||||
self._bucket_config = S3BucketConfig( # noqa
|
self._bucket_config = S3BucketConfig( # noqa
|
||||||
@ -98,6 +100,7 @@ class SetupUploadMixin(object):
|
|||||||
multipart=multipart,
|
multipart=multipart,
|
||||||
secure=secure,
|
secure=secure,
|
||||||
verify=verify,
|
verify=verify,
|
||||||
|
profile=profile
|
||||||
)
|
)
|
||||||
StorageHelper.add_aws_configuration(self._bucket_config, log=self.log)
|
StorageHelper.add_aws_configuration(self._bucket_config, log=self.log)
|
||||||
self.storage_uri = StorageHelper.get_aws_storage_uri_from_config(self._bucket_config)
|
self.storage_uri = StorageHelper.get_aws_storage_uri_from_config(self._bucket_config)
|
||||||
|
@ -213,6 +213,8 @@ class CreateAndPopulate(object):
|
|||||||
task_state['script']['requirements'] = repo_info.script.get('requirements') or {}
|
task_state['script']['requirements'] = repo_info.script.get('requirements') or {}
|
||||||
if self.cwd:
|
if self.cwd:
|
||||||
self.cwd = 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()
|
cwd = (Path(repo_info.script['repo_root']) / self.cwd).as_posix()
|
||||||
|
|
||||||
if not Path(cwd).is_dir():
|
if not Path(cwd).is_dir():
|
||||||
@ -220,7 +222,9 @@ class CreateAndPopulate(object):
|
|||||||
entry_point = \
|
entry_point = \
|
||||||
Path(repo_info.script['repo_root']) / repo_info.script['working_dir'] / repo_info.script[
|
Path(repo_info.script['repo_root']) / repo_info.script['working_dir'] / repo_info.script[
|
||||||
'entry_point']
|
'entry_point']
|
||||||
|
# resolve entry_point relative to the current working directory
|
||||||
entry_point = entry_point.relative_to(cwd).as_posix()
|
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()
|
cwd = Path(cwd).relative_to(repo_info.script['repo_root']).as_posix()
|
||||||
task_state['script']['entry_point'] = entry_point or ""
|
task_state['script']['entry_point'] = entry_point or ""
|
||||||
task_state['script']['working_dir'] = cwd or "."
|
task_state['script']['working_dir'] = cwd or "."
|
||||||
|
Loading…
Reference in New Issue
Block a user