Skip to content

Commit

Permalink
SUBMARINE-1052. Create submarine model management service in server
Browse files Browse the repository at this point in the history
### What is this PR for?
Create the model management service in the server for later use in model serving and model management workbench.

### What type of PR is it?
[Feature]

### Todos

### What is the Jira issue?
https://issues.apache.org/jira/browse/SUBMARINE-1052

### How should this be tested?
CI pass.
All of the tests for new functions are provided under the `submarine-server/server-core/src/test/java/org/apache/submarine/server/model/database` directory.

### Screenshots (if appropriate)

### Questions:
* Do the license files need updating? No
* Are there breaking changes for older versions? No
* Does this need new documentation? No

Author: KUAN-HSUN-LI <b06209027@ntu.edu.tw>

Signed-off-by: Kevin <pingsutw@apache.org>

Closes #770 from KUAN-HSUN-LI/SUBMARINE-1052 and squashes the following commits:

a01fd85 [KUAN-HSUN-LI] SUBMARINE-1052. Create submarine model management service in server
f9432ab [KUAN-HSUN-LI] SUBMARINE-1052. Add exception
4234892 [KUAN-HSUN-LI] Remove useless code
e5bc7c2 [KUAN-HSUN-LI] SUBMARINE-1052. Create submarine model management service in server
090f666 [KUAN-HSUN-LI] SUBMARINE-1052. Create submarine model management service in server
  • Loading branch information
KUAN-HSUN-LI authored and pingsutw committed Oct 24, 2021
1 parent 535770e commit 9ba44b9
Show file tree
Hide file tree
Showing 25 changed files with 1,367 additions and 374 deletions.
Expand Up @@ -53,8 +53,8 @@ public enum ConfVars {

JDBC_DRIVERCLASSNAME("jdbc.driverClassName", "com.mysql.jdbc.Driver"),
JDBC_URL("jdbc.url", "jdbc:mysql://127.0.0.1:3306/submarine" +
"?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&" +
"failOverReadOnly=false&zeroDateTimeBehavior=convertToNull&useSSL=false"),
"?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&allowMultiQueries=true" +
"failOverReadOnly=false&zeroDateTimeBehavior=convertToNull&useSSL=false&"),
JDBC_USERNAME("jdbc.username", "submarine"),
JDBC_PASSWORD("jdbc.password", "password"),
METASTORE_JDBC_URL("metastore.jdbc.url", "jdbc:mysql://127.0.0.1:3306/metastore" +
Expand Down
Expand Up @@ -97,7 +97,7 @@ private static void usingTestDatabase() {
// Run the test unit using the test database
SubmarineConfiguration conf = SubmarineConfiguration.getInstance();
conf.setJdbcUrl("jdbc:mysql://127.0.0.1:3306/submarine_test?" +
"useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&" +
"useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&allowMultiQueries=true&" +
"failOverReadOnly=false&zeroDateTimeBehavior=convertToNull&useSSL=false");
conf.setJdbcUserName("submarine_test");
conf.setJdbcPassword("password_test");
Expand Down
Expand Up @@ -19,30 +19,31 @@

package org.apache.submarine.server.model.database.entities;

import java.sql.Timestamp;
import java.util.List;

public class ModelVersionEntity {
private String name;

private Integer version;

private Long createTime;

private Long lastUpdatedTime;

private String description;
private String source;

private String userId;

private String experimentId;

private String currentStage;

private String source;
private Timestamp creationTime;

private String runId;
private Timestamp lastUpdatedTime;

private String status;
private String dataset;

private String statusMessage;
private String description;

private String runLink;
private List<String> tags;

public String getName() {
return name;
Expand All @@ -60,28 +61,12 @@ public void setVersion(Integer version) {
this.version = version;
}

public Long getCreateTime() {
return createTime;
}

public void setCreateTime(Long createTime) {
this.createTime = createTime;
}

public Long getLastUpdatedTime() {
return lastUpdatedTime;
}

public void setLastUpdatedTime(Long lastUpdatedTime) {
this.lastUpdatedTime = lastUpdatedTime;
}

public String getDescription() {
return description;
public String getSource() {
return source;
}

public void setDescription(String description) {
this.description = description;
public void setSource(String source) {
this.source = source;
}

public String getUserId() {
Expand All @@ -92,6 +77,14 @@ public void setUserId(String userId) {
this.userId = userId;
}

public String getExperimentId() {
return experimentId;
}

public void setExperimentId(String experimentId) {
this.experimentId = experimentId;
}

public String getCurrentStage() {
return currentStage;
}
Expand All @@ -100,60 +93,61 @@ public void setCurrentStage(String currentStage) {
this.currentStage = currentStage;
}

public String getSource() {
return source;
public Timestamp getCreationTime() {
return creationTime;
}

public void setSource(String source) {
this.source = source;
public void setCreationTime(Timestamp creationTime) {
this.creationTime = creationTime;
}

public String getRunId() {
return runId;
public Timestamp getLastUpdatedTime() {
return lastUpdatedTime;
}

public void setRunId(String runId) {
this.runId = runId;
public void setLastUpdatedTime(Timestamp lastUpdatedTime) {
this.lastUpdatedTime = lastUpdatedTime;
}

public String getStatus() {
return status;
public String getDataset() {
return dataset;
}

public void setStatus(String status) {
this.status = status;
public void setDataset(String dataset) {
this.dataset = dataset;
}

public String getStatusMessage() {
return statusMessage;
public String getDescription() {
return description;
}

public void setStatusMessage(String statusMessage) {
this.statusMessage = statusMessage;
public void setDescription(String description) {
this.description = description;
}

public String getRunLink() {
return runLink;
public List<String> getTags() {
return tags;
}

public void setRunLink(String runLink) {
this.runLink = runLink;
public void setTags(List<String> tags) {
this.tags = tags;
}

public ModelVersionEntity() {}

public String toString() {
return "ModelVersionEntity{" +
"name='" + name + '\'' +
",version='" + version + '\'' +
", createTime='" + createTime + '\'' +
", lastUpdatedTime=" + lastUpdatedTime + '\'' +
", description='" + description + '\'' +
", userId='" + userId + '\'' +
", currentStage='" + currentStage + '\'' +
", source='" + source + '\'' +
", runLink='" + runLink + '\'' +
", runId='" + runId + '\'' +
", status='" + status + '\'' +
", statusMessage='" + statusMessage + '\'' +
'}';
"name='" + name + '\'' +
",version='" + version + '\'' +
", source='" + source + '\'' +
", userId='" + userId + '\'' +
", experimentId='" + experimentId + '\'' +
", currentStage='" + currentStage + '\'' +
", creationTime='" + creationTime + '\'' +
", lastUpdatedTime=" + lastUpdatedTime + '\'' +
", dataset=" + dataset + '\'' +
", description='" + description + '\'' +
", tags='" + tags + '\'' +
'}';
}
}
@@ -0,0 +1,63 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

package org.apache.submarine.server.model.database.entities;

public class ModelVersionTagEntity {

private String name;

private Integer version;

private String tag;

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

public Integer getVersion() {
return version;
}

public void setVersion(Integer version) {
this.version = version;
}

public String getTag() {
return tag;
}

public void setTag(String tag) {
this.tag = tag;
}

public ModelVersionTagEntity() {};

public String toString() {
return "ModelVersionEntity{" +
"name='" + name + '\'' +
",version='" + version + '\'' +
", tag='" + tag + '\'' +
'}';
}
}
Expand Up @@ -19,16 +19,21 @@

package org.apache.submarine.server.model.database.entities;

public class RegisteredModelNameEntity {
import java.sql.Timestamp;
import java.util.List;

public class RegisteredModelEntity {

private String name;

private Long createTime;
private Timestamp creationTime;

private Long lastUpdatedTime;
private Timestamp lastUpdatedTime;

private String description;

private List<String> tags;

public String getName() {
return name;
}
Expand All @@ -37,19 +42,19 @@ public void setName(String name) {
this.name = name;
}

public Long getCreateTime() {
return createTime;
public Timestamp getCreationTime() {
return creationTime;
}

public void setCreateTime(Long createTime) {
this.createTime = createTime;
public void setCreationTime(Timestamp creationTime) {
this.creationTime = creationTime;
}

public Long getLastUpdatedTime() {
public Timestamp getLastUpdatedTime() {
return lastUpdatedTime;
}

public void setLastUpdatedTime(Long lastUpdatedTime) {
public void setLastUpdatedTime(Timestamp lastUpdatedTime) {
this.lastUpdatedTime = lastUpdatedTime;
}

Expand All @@ -61,14 +66,23 @@ public void setDescription(String description) {
this.description = description;
}

public RegisteredModelNameEntity() {}
public List<String> getTags() {
return tags;
}

public void setTags(List<String> tags) {
this.tags = tags;
}

public RegisteredModelEntity() {}

public String toString() {
return "RegisteredModelNameEntity{" +
return "RegisteredModelEntity{" +
"name='" + name + '\'' +
", createTime='" + createTime + '\'' +
", createTime='" + creationTime + '\'' +
", lastUpdatedTime=" + lastUpdatedTime + '\'' +
", description='" + description + '\'' +
", tags='" + tags + '\'' +
'}';
}
}
@@ -0,0 +1,52 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

package org.apache.submarine.server.model.database.entities;

public class RegisteredModelTagEntity {

private String name;

private String tag;

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

public String getTag() {
return tag;
}

public void setTag(String tag) {
this.tag = tag;
}

public RegisteredModelTagEntity() {};

public String toString() {
return "ModelVersionEntity{" +
"name='" + name + '\'' +
", tag='" + tag + '\'' +
'}';
}
}

0 comments on commit 9ba44b9

Please sign in to comment.