jiwq commented on a change in pull request #622:
URL: https://github.com/apache/submarine/pull/622#discussion_r666287760
##########
File path:
submarine-server/server-api/src/main/java/org/apache/submarine/server/api/spec/ExperimentMeta.java
##########
@@ -51,6 +55,22 @@ public void setName(String name) {
this.name = name;
}
+ /**
+ * Get the experiment id which is unique within a namespace.
+ * @return experiment id
+ */
+ public String getExpID() {
+ return experimentId;
+ }
+
+ /**
+ * experiment id must be unique within a namespace. Is required when
creating experiment.
+ * @param experimentId experiment id
+ */
+ public void setExpID(String experimentId) {
Review comment:
```suggestion
public void setExperimentId(String experimentId) {
```
##########
File path:
submarine-server/server-api/src/main/java/org/apache/submarine/server/api/spec/ExperimentMeta.java
##########
@@ -51,6 +55,22 @@ public void setName(String name) {
this.name = name;
}
+ /**
+ * Get the experiment id which is unique within a namespace.
+ * @return experiment id
+ */
+ public String getExpID() {
Review comment:
Disallow to abridge the name, because it will reduce readability.
```suggestion
public String getExperimentId() {
```
##########
File path:
submarine-server/server-core/src/main/java/org/apache/submarine/server/experiment/ExperimentManager.java
##########
@@ -108,8 +108,10 @@ public Experiment createExperiment(ExperimentSpec spec)
throws SubmarineRuntimeE
spec.getMeta().getEnvVars().put(RestConstants.SUBMARINE_TRACKING_URI, url);
spec.getMeta().getEnvVars().put(RestConstants.LOG_DIR_KEY,
RestConstants.LOG_DIR_VALUE);
- String lowerName = spec.getMeta().getName().toLowerCase();
+ String lowerName = spec.getMeta().getName().toLowerCase();
spec.getMeta().setName(lowerName);
+ spec.getMeta().setExpID(id.toString().replaceAll("_", "-"));
Review comment:
What's the reason of considering '-' rather than '_'?
Supported character set of K8s:
https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#syntax-and-character-set
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]