-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat: Enable customizing artifact output path #3965
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/bot run all
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
1 similar comment
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
@@ -29,6 +29,7 @@ | |||
from sagemaker.experiments._helper import ( | |||
_ArtifactUploader, | |||
_LineageArtifactTracker, | |||
_DEFAULT_ARTIFACT_PREFIX, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit the name of this sounds like it will prefix the actual name of the artifact but its really a prefix for a s3 path where the associated files will be stored
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it's a bit confusing to use this name here. But _DEFAULT_ARTIFACT_PREFIX
is not introduced in this PR, it's already defined in _helper.py. There is a variable called artifact_prefix
, so I'm assuming that is why we called the default variable to be _DEFAULT_ARTIFACT_PREFIX
.
A workaround could be change the following method defined in _ArtifactUploader
.
class _ArtifactUploader(object):
"""Artifact uploader"""
def __init__(
self,
trial_component_name,
sagemaker_session,
artifact_bucket=None,
artifact_prefix=None, # HERE!!!
):
self.sagemaker_session = sagemaker_session
self.trial_component_name = trial_component_name
self.artifact_bucket = artifact_bucket
self.artifact_prefix = (
_DEFAULT_ARTIFACT_PREFIX if artifact_prefix is None else artifact_prefix # HERE!!!
)
self._s3_client = self.sagemaker_session.boto_session.client("s3")
In this way, we don't need to import _DEFAULT_ARTIFACT_PREFIX
to run.py
artifact_prefix=_DEFAULT_ARTIFACT_PREFIX | ||
if artifact_prefix is None | ||
else artifact_prefix, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit this indentation is unintuitive
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nm looks like there is not many better alternatives https://stackoverflow.com/questions/28897010/how-to-make-a-line-break-on-the-python-ternary-operator
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/bot run all
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Codecov Report
@@ Coverage Diff @@
## master #3965 +/- ##
==========================================
- Coverage 90.32% 89.59% -0.73%
==========================================
Files 1292 305 -987
Lines 113972 28188 -85784
==========================================
- Hits 102940 25256 -77684
+ Misses 11032 2932 -8100
|
Issue #, if available:
#3609
Description of changes:
artifact_bucket
andartifact_prefix
toRun
constructorartifact_bucket
andartifact_prefix
toload_run
Testing done:
tests/unit/sagemaker/experiments/test_run.py
tests/unit/sagemaker/experiments/helpers.py
Merge Checklist
Put an
x
in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your pull request.General
Tests
unique_name_from_base
to create resource names in integ tests (if appropriate)By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.