You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@submarine.apache.org by GitBox <gi...@apache.org> on 2022/02/14 00:08:46 UTC

[GitHub] [submarine] pingsutw commented on a change in pull request #876: SUBMARINE-1182. Use the unique source for model management and use it for later serving

pingsutw commented on a change in pull request #876:
URL: https://github.com/apache/submarine/pull/876#discussion_r805436903



##########
File path: submarine-sdk/pysubmarine/submarine/artifacts/repository.py
##########
@@ -19,45 +19,36 @@
 
 
 class Repository:
-    def __init__(self, experiment_id: str):
+    def __init__(self):
         self.client = boto3.client(
             "s3",
             aws_access_key_id=os.environ.get("AWS_ACCESS_KEY_ID"),
             aws_secret_access_key=os.environ.get("AWS_SECRET_ACCESS_KEY"),
             endpoint_url=os.environ.get("MLFLOW_S3_ENDPOINT_URL"),
         )
-        self.dest_path = experiment_id
         self.bucket = "submarine"
 
     def _upload_file(self, local_file: str, bucket: str, key: str) -> None:
         self.client.upload_file(Filename=local_file, Bucket=bucket, Key=key)
 
-    def _list_artifact_subfolder(self, artifact_path: str):
+    def list_artifact_subfolder(self, dest_path):
         response = self.client.list_objects(
             Bucket=self.bucket,
-            Prefix=os.path.join(self.dest_path, artifact_path) + "/",
+            Prefix=f"{dest_path}/",
             Delimiter="/",
         )
         return response.get("CommonPrefixes")
 
-    def log_artifact(self, local_file: str, artifact_path: str) -> None:
-        dest_path = self.dest_path
-        dest_path = os.path.join(dest_path, artifact_path)
+    def log_artifact(self, dest_path: str, local_file: str) -> None:
+        dest_path = os.path.join(dest_path)

Review comment:
       we didn't join any other path here, could we remove this line?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@submarine.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org