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/01/27 11:33:31 UTC

[GitHub] [submarine] KUAN-HSUN-LI opened a new pull request #876: SUBMARINE-1182.

KUAN-HSUN-LI opened a new pull request #876:
URL: https://github.com/apache/submarine/pull/876


   ### What is this PR for?
   1. Use the unique source of the model to make the following serving work
   2. Provide create model version REST API
   3. Fix bugs
   
   ### What type of PR is it?
   [Bug Fix | Feature]
   
   ### Todos
   * [x] - Provide unique model source.
   * [x] - Serving a model created by experiment.
   * [ ] - Update document.
   * [ ] - Provide tests.
   
   ### What is the Jira issue?
   https://issues.apache.org/jira/browse/SUBMARINE-1182
   
   ### How should this be tested?
   
   
   ### Screenshots (if appropriate)
   1. PyTorch example
   https://user-images.githubusercontent.com/38066413/151348577-6a6c14a3-3404-43e7-92b1-f0a7a63bb6fe.mp4
   2. TensorFlow example
   https://user-images.githubusercontent.com/38066413/151350155-669d8442-63f3-4349-90f9-66c2f6ae6c35.mp4
   
   
   
   ### Questions:
   * Do the license files need updating? No
   * Are there breaking changes for older versions? No
   * Does this need new documentation? Yes
   


-- 
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



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

Posted by GitBox <gi...@apache.org>.
KUAN-HSUN-LI commented on a change in pull request #876:
URL: https://github.com/apache/submarine/pull/876#discussion_r806396052



##########
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:
       Sure
   




-- 
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



[GitHub] [submarine] asfgit closed pull request #876: SUBMARINE-1182. Use the unique source for model management and use it for later serving

Posted by GitBox <gi...@apache.org>.
asfgit closed pull request #876:
URL: https://github.com/apache/submarine/pull/876


   


-- 
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



[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

Posted by GitBox <gi...@apache.org>.
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



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

Posted by GitBox <gi...@apache.org>.
KUAN-HSUN-LI commented on a change in pull request #876:
URL: https://github.com/apache/submarine/pull/876#discussion_r806396052



##########
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:
       Sure
   




-- 
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



[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

Posted by GitBox <gi...@apache.org>.
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



[GitHub] [submarine] asfgit closed pull request #876: SUBMARINE-1182. Use the unique source for model management and use it for later serving

Posted by GitBox <gi...@apache.org>.
asfgit closed pull request #876:
URL: https://github.com/apache/submarine/pull/876


   


-- 
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



[GitHub] [submarine] KUAN-HSUN-LI commented on pull request #876: SUBMARINE-1182. Use the unique source for model management and use it for later serving

Posted by GitBox <gi...@apache.org>.
KUAN-HSUN-LI commented on pull request #876:
URL: https://github.com/apache/submarine/pull/876#issuecomment-1023117247


   @pingsutw  @jeff-901 Help me review the PR. Thanks!


-- 
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