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
  • Loading branch information
KUAN-HSUN-LI committed Oct 9, 2021
1 parent 7da8a7f commit 090f666
Show file tree
Hide file tree
Showing 25 changed files with 1,158 additions and 373 deletions.
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 + '\'' +
'}';
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
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;
}
}
Original file line number Diff line number Diff line change
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 + '\'' +
'}';
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
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;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,16 @@
package org.apache.submarine.server.model.database.mappers;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.apache.submarine.server.model.database.entities.ModelVersionEntity;

public interface ModelVersionMapper {
List<ModelVersionEntity> selectAllVersions(String name);
ModelVersionEntity select(@Param("name") String name, @Param("version") Integer version);
ModelVersionEntity selectWithTag(@Param("name") String name, @Param("version") Integer version);
void insert(ModelVersionEntity modelVersion);
void update(ModelVersionEntity modelVersion);
void delete(@Param("name") String name, @Param("version") Integer version);
List<ModelVersionEntity> list(String name);
ModelVersionEntity select(ModelVersionEntity modelVersionEntity);

int insert(ModelVersionEntity modelVersionEntity);
int delete(ModelVersionEntity modelVersionEntity);
int deleteAll(String name);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* 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.mappers;

import org.apache.submarine.server.model.database.entities.ModelVersionTagEntity;


public interface ModelVersionTagMapper {
void insert(ModelVersionTagEntity registeredModelTag);
void delete(ModelVersionTagEntity registeredModelTag);
}

0 comments on commit 090f666

Please sign in to comment.