This is an automated email from the ASF dual-hosted git repository.

pingsutw pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/submarine.git


The following commit(s) were added to refs/heads/master by this push:
     new 2d15b72  SUBMARINE-958. Experiment Tag at Customized Experiment
2d15b72 is described below

commit 2d15b720e21b5381dd5e5fb01e04557ffeef4d3c
Author: noidname01 <[email protected]>
AuthorDate: Mon Aug 16 17:26:38 2021 +0800

    SUBMARINE-958. Experiment Tag at Customized Experiment
    
    ### What is this PR for?
    
    This is the frontend implementation of 
[SUBMARINE-943](https://issues.apache.org/jira/browse/SUBMARINE-943)
    Users can add multiple tags to mark experiments with their own category.
    Also add e2e test for tags.
    
    ### What type of PR is it?
    [Feature]
    
    ### Todos
    
    None
    
    ### What is the Jira issue?
    
    https://issues.apache.org/jira/projects/SUBMARINE/issues/SUBMARINE-958
    
    ### How should this be tested?
    
    Just fill in the tags when creating an experiment.
    
    ### Screenshots (if appropriate)
    
    ![2021-08-06 11-46-03 
的螢幕擷圖](https://user-images.githubusercontent.com/55401762/128453067-e282aed0-c93e-490b-85c3-d610fcdca667.png)
    
    
https://user-images.githubusercontent.com/55401762/129542663-3a61f277-d0cf-49ee-9147-afc648807c84.mp4
    
    ![2021-08-16 17-30-42 
的螢幕擷圖](https://user-images.githubusercontent.com/55401762/129542555-44787310-2de6-40da-84bc-adf79376848a.png)
    ### Questions:
    * Do the license files need updating? No
    * Are there breaking changes for older versions? No
    * Does this need new documentation? No
    
    Author: noidname01 <[email protected]>
    
    Signed-off-by: Kevin <[email protected]>
    
    Closes #698 from noidname01/SUBMARINE-958 and squashes the following 
commits:
    
    bc9594a3 [noidname01] add e2e test on tags
    be9b051e [noidname01] add comment
    fe8bcc19 [noidname01] add tags at customized experiment
---
 .../org/apache/submarine/integration/experimentIT.java  |  5 ++---
 .../submarine/integration/pages/ExperimentPage.java     | 12 +++++++++++-
 .../workbench-web/src/app/interfaces/experiment-spec.ts |  1 +
 .../experiment-customized-form.component.html           | 14 ++++++++++++++
 .../experiment-customized-form.component.ts             | 17 +++++++++++++++--
 .../experiment-home/experiment-home.component.ts        |  1 -
 .../template-form/template-form.component.ts            |  1 +
 7 files changed, 44 insertions(+), 7 deletions(-)

diff --git 
a/submarine-test/test-e2e/src/test/java/org/apache/submarine/integration/experimentIT.java
 
b/submarine-test/test-e2e/src/test/java/org/apache/submarine/integration/experimentIT.java
index 5a5f87d..ab3c92e 100644
--- 
a/submarine-test/test-e2e/src/test/java/org/apache/submarine/integration/experimentIT.java
+++ 
b/submarine-test/test-e2e/src/test/java/org/apache/submarine/integration/experimentIT.java
@@ -70,9 +70,8 @@ public class experimentIT extends AbstractSubmarineIT {
     experimentPage.advancedButtonCLick();
     experimentPage.envBtnClick();
     String experimentName = "experiment-e2e-test";
-    experimentPage.fillExperimentMeta(experimentName, "e2e des", "default",
-            "python /var/tf_mnist/mnist_with_summaries.py 
--log_dir=/train/log" +
-                    " --learning_rate=0.01 --batch_size=150",
+    experimentPage.fillExperimentMeta(experimentName, "e2e des", "default", 
new String[]{"stable","default","v1.0"},
+            "python /var/tf_mnist/mnist_with_summaries.py 
--log_dir=/train/log" + " --learning_rate=0.01 --batch_size=150",
             "apache/submarine:tf-mnist-with-summaries-1.0",
             "ENV_1", "ENV1");
     SendKeys(By.xpath("//input[@id='git-repo']"), MAX_BROWSER_TIMEOUT_SEC, 
"https://github.com/apache/submarine.git";);
diff --git 
a/submarine-test/test-e2e/src/test/java/org/apache/submarine/integration/pages/ExperimentPage.java
 
b/submarine-test/test-e2e/src/test/java/org/apache/submarine/integration/pages/ExperimentPage.java
index fabbdbb..300a071 100644
--- 
a/submarine-test/test-e2e/src/test/java/org/apache/submarine/integration/pages/ExperimentPage.java
+++ 
b/submarine-test/test-e2e/src/test/java/org/apache/submarine/integration/pages/ExperimentPage.java
@@ -18,6 +18,7 @@
 package org.apache.submarine.integration.pages;
 
 import org.junit.Assert;
+import org.openqa.selenium.Keys;
 import org.openqa.selenium.By;
 import org.openqa.selenium.WebDriver;
 import org.openqa.selenium.WebElement;
@@ -63,6 +64,9 @@ public class ExperimentPage {
   @FindBy(name = "description")
   private WebElement description;
 
+  @FindBy(xpath = 
"//*[@id=\"firstStep\"]/div[3]/nz-select/div/div/ul/li/input")
+  private WebElement tags;
+
   @FindBy(id = "namespace")
   private WebElement namespace;
 
@@ -149,12 +153,18 @@ public class ExperimentPage {
   }
 
   // Real actions
-  public void fillExperimentMeta(String name, String description, String 
namespace, String cmd, String image,
+  public void fillExperimentMeta(String name, String description, String 
namespace, String[] tags, String cmd, String image,
               String envKey, String envValue) {
     this.experimentName.clear();
     this.experimentName.sendKeys(name);
     this.description.clear();
     this.description.sendKeys(description);
+    this.tags.click();
+    for(int i = 0; i < tags.length; i++){
+        this.tags.sendKeys(tags[i]);
+        this.tags.sendKeys(Keys.RETURN);
+    }
+    this.tags.sendKeys(Keys.ESCAPE);
     this.cmd.sendKeys(cmd);
     this.envKey.sendKeys(envKey);
     this.envValue.sendKeys(envValue);
diff --git 
a/submarine-workbench/workbench-web/src/app/interfaces/experiment-spec.ts 
b/submarine-workbench/workbench-web/src/app/interfaces/experiment-spec.ts
index dbc7a18..9b2d65c 100644
--- a/submarine-workbench/workbench-web/src/app/interfaces/experiment-spec.ts
+++ b/submarine-workbench/workbench-web/src/app/interfaces/experiment-spec.ts
@@ -25,6 +25,7 @@ export interface ExperimentMeta {
   envVars?: {
     [key: string]: string;
   };
+  tags: string[];
 }
 
 export interface EnvironmentSpec {
diff --git 
a/submarine-workbench/workbench-web/src/app/pages/workbench/experiment/experiment-home/experiment-form/experiment-customized-form/experiment-customized-form.component.html
 
b/submarine-workbench/workbench-web/src/app/pages/workbench/experiment/experiment-home/experiment-form/experiment-customized-form/experiment-customized-form.component.html
index ebd1726..e1ba5fd 100644
--- 
a/submarine-workbench/workbench-web/src/app/pages/workbench/experiment/experiment-home/experiment-form/experiment-customized-form/experiment-customized-form.component.html
+++ 
b/submarine-workbench/workbench-web/src/app/pages/workbench/experiment/experiment-home/experiment-form/experiment-customized-form/experiment-customized-form.component.html
@@ -57,6 +57,20 @@
           ></textarea>
         </div>
         <div class="single-field-group">
+          <label for="tags">
+            Tags
+          </label>
+          <nz-select
+            formControlName="tags"
+            nzMode="tags"
+            name = "tags"
+            [nzTokenSeparators]="[',']"
+            nzPlaceHolder="AutoEncoder"
+          >
+            <nz-option *ngFor="let option of listOfOption" 
[nzLabel]="option.label" [nzValue]="option.value"></nz-option>
+          </nz-select>
+        </div>
+        <div class="single-field-group">
           <label for="cmd">
             <span class="red-star">*</span>
             Command
diff --git 
a/submarine-workbench/workbench-web/src/app/pages/workbench/experiment/experiment-home/experiment-form/experiment-customized-form/experiment-customized-form.component.ts
 
b/submarine-workbench/workbench-web/src/app/pages/workbench/experiment/experiment-home/experiment-form/experiment-customized-form/experiment-customized-form.component.ts
index 67ca65a..f490a63 100644
--- 
a/submarine-workbench/workbench-web/src/app/pages/workbench/experiment/experiment-home/experiment-form/experiment-customized-form/experiment-customized-form.component.ts
+++ 
b/submarine-workbench/workbench-web/src/app/pages/workbench/experiment/experiment-home/experiment-form/experiment-customized-form/experiment-customized-form.component.ts
@@ -46,6 +46,7 @@ export class ExperimentCustomizedFormComponent implements 
OnInit, OnDestroy {
   finalExperimentSpec: ExperimentSpec;
   step: number = 0;
   subscriptions: Subscription[] = [];
+  listOfOption: Array<{ label: string; value: string }> = [];
 
   // TODO: Fetch all images from submarine server
   imageIndex = 0;
@@ -71,6 +72,7 @@ export class ExperimentCustomizedFormComponent implements 
OnInit, OnDestroy {
   framework = 'Tensorflow';
   currentSpecPage = 1;
 
+
   // About update
   @Input() targetId: string = null;
   @Input() targetSpec: ExperimentSpec = null;
@@ -86,6 +88,7 @@ export class ExperimentCustomizedFormComponent implements 
OnInit, OnDestroy {
     this.experiment = new FormGroup({
       experimentName: new FormControl(null, 
[Validators.pattern('[a-zA-Z0-9][a-zA-Z0-9\-]*'), Validators.required]),
       description: new FormControl(null, [Validators.required]),
+      tags: new FormControl([], []),
       cmd: new FormControl('', [Validators.required]),
       image: new FormControl(this.defaultImage, [Validators.required]),
       envs: new FormArray([], 
[this.experimentValidatorService.nameValidatorFactory('key')]),
@@ -128,6 +131,10 @@ export class ExperimentCustomizedFormComponent implements 
OnInit, OnDestroy {
     });
 
     this.subscriptions.push(sub1, sub2);
+
+    //TODO: get tags from server
+    this.listOfOption = []; 
+  
   }
 
   ngOnDestroy() {
@@ -148,6 +155,9 @@ export class ExperimentCustomizedFormComponent implements 
OnInit, OnDestroy {
   get experimentName() {
     return this.experiment.get('experimentName');
   }
+  get tags() {
+    return this.experiment.get('tags');
+  }
   get description() {
     return this.experiment.get('description');
   }
@@ -180,10 +190,11 @@ export class ExperimentCustomizedFormComponent implements 
OnInit, OnDestroy {
   checkStatus() {
     if (this.step === 0) {
       this.experimentFormService.btnStatusChange(
-        this.experimentName.invalid ||
+        this.experimentName.invalid || 
+          this.tags.invalid ||          
           this.cmd.invalid ||
           this.image.invalid ||
-          this.envs.invalid
+          this.envs.invalid 
       );
     } else if (this.step === 1) {
       this.experimentFormService.btnStatusChange(this.specs.invalid);
@@ -314,6 +325,7 @@ export class ExperimentCustomizedFormComponent implements 
OnInit, OnDestroy {
     // Construct the spec
     const meta: ExperimentMeta = {
       name: this.experimentName.value.toLowerCase(),
+      tags: this.tags.value,
       framework: this.framework === 'Standalone' ? 'Tensorflow' : 
this.framework,
       cmd: this.cmd.value,
       envVars: {}
@@ -393,6 +405,7 @@ export class ExperimentCustomizedFormComponent implements 
OnInit, OnDestroy {
   }
 
   cloneExperiment(spec: ExperimentSpec) {
+    this.tags.setValue(spec.meta.tags);
     this.description.setValue(spec.meta.description);
     this.cmd.setValue(spec.meta.cmd);
     this.image.setValue(spec.environment.image);
diff --git 
a/submarine-workbench/workbench-web/src/app/pages/workbench/experiment/experiment-home/experiment-home.component.ts
 
b/submarine-workbench/workbench-web/src/app/pages/workbench/experiment/experiment-home/experiment-home.component.ts
index 4646538..ce4ec24 100644
--- 
a/submarine-workbench/workbench-web/src/app/pages/workbench/experiment/experiment-home/experiment-home.component.ts
+++ 
b/submarine-workbench/workbench-web/src/app/pages/workbench/experiment/experiment-home/experiment-home.component.ts
@@ -138,7 +138,6 @@ export class ExperimentHomeComponent implements OnInit {
   }
 
   onSwitchAutoReload() {
-    console.log(this.switchValue);
     if (this.switchValue) {
       this.reloadSub = this.reloadInterval.subscribe((res) => {
         this.fetchExperimentList(true);
diff --git 
a/submarine-workbench/workbench-web/src/app/pages/workbench/template/template-home/template-form/template-form.component.ts
 
b/submarine-workbench/workbench-web/src/app/pages/workbench/template/template-home/template-form/template-form.component.ts
index 218c50f..c813c16 100644
--- 
a/submarine-workbench/workbench-web/src/app/pages/workbench/template/template-home/template-form/template-form.component.ts
+++ 
b/submarine-workbench/workbench-web/src/app/pages/workbench/template/template-home/template-form/template-form.component.ts
@@ -253,6 +253,7 @@ export class TemplateFormComponent implements OnInit {
           name: this.defaultExperimentName,
           envVars: envVars,
           framework: this.framework,
+          tags: [],
         },
         spec: specs,
         environment: {

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to