You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@submarine.apache.org by ka...@apache.org on 2021/07/02 04:13:56 UTC

[submarine] branch master updated: SUBMARINE-886. Underscore character is invalid for experiment name

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

kaihsun 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 874ab6a  SUBMARINE-886. Underscore character is invalid for experiment name
874ab6a is described below

commit 874ab6a6524208fbba27d679888aa02b8e7cf2d1
Author: Kai-Hsun Chen <b0...@ntu.edu.tw>
AuthorDate: Thu Jul 1 18:33:42 2021 +0800

    SUBMARINE-886. Underscore character is invalid for experiment name
    
    ### What is this PR for?
    * Underscore character is invalid for experiment name, and it will cause Kubernetes Java API to throw an exception "io.kubernetes.client.ApiException" with the error message "Unprocessable Entity" as shown in the attachment figure. In addition, no POD related to the experiment will be created, and users cannot get any error notification from the workbench.
    <img width="915" alt="截圖 2021-07-01 下午12 25 43" src="https://user-images.githubusercontent.com/20109646/124086289-7c8b3180-da83-11eb-9932-9cc7bb15bbc4.png">
    
    * In this PR, the valid characters for experiment name only include "a-z", "A-Z", "0-9", and "-". Hence, the ApiException can be avoided.
    
    ### What type of PR is it?
    [Bug Fix]
    
    ### Todos
    
    ### What is the Jira issue?
    https://issues.apache.org/jira/browse/SUBMARINE-886
    
    ### How should this be tested?
    * Workbench -> New Experiment -> Define your experiment -> Enter experiment name
    
    ### Screenshots (if appropriate)
    <img width="997" alt="截圖 2021-07-01 下午3 44 00" src="https://user-images.githubusercontent.com/20109646/124087097-47331380-da84-11eb-96e8-a316edf87285.png">
    <img width="994" alt="截圖 2021-07-01 下午3 44 16" src="https://user-images.githubusercontent.com/20109646/124087103-48fcd700-da84-11eb-9f93-48feda1ca600.png">
    <img width="994" alt="截圖 2021-07-01 下午3 45 04" src="https://user-images.githubusercontent.com/20109646/124087119-4bf7c780-da84-11eb-8a4b-809fc2cd4111.png">
    <img width="986" alt="截圖 2021-07-01 下午3 44 40" src="https://user-images.githubusercontent.com/20109646/124087123-4dc18b00-da84-11eb-8d38-d7abd0e242c5.png">
    
    ### Questions:
    * Do the license files need updating? No
    * Are there breaking changes for older versions? No
    * Does this need new documentation? No
    
    Author: Kai-Hsun Chen <b0...@ntu.edu.tw>
    
    Signed-off-by: Kai-Hsun Chen <ka...@apache.org>
    
    Closes #630 from kevin85421/SUBMARINE-886 and squashes the following commits:
    
    ece4a860 [Kai-Hsun Chen] Clarify the error message
    a5ebef2b [Kai-Hsun Chen] SUBMARINE-886. Underscore character is invalid for experiment name
---
 .../experiment-customized-form.component.html                          | 3 +++
 .../experiment-customized-form/experiment-customized-form.component.ts | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

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 4d7b2ea..3021fda 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
@@ -41,6 +41,9 @@
             formControlName="experimentName"
             placeholder="mnist-example"
           />
+          <div class="alert-message" *ngIf="experiment.get('experimentName').hasError('pattern')">
+            Only letters(a-z), numbers(0-9), and hyphens(-) are allowed.
+          </div>
         </div>
         <div class="single-field-group">
           <label for="description">Description</label>
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 7cde4dd..9372493 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
@@ -88,7 +88,7 @@ export class ExperimentCustomizedFormComponent implements OnInit, OnDestroy {
 
   ngOnInit() {
     this.experiment = new FormGroup({
-      experimentName: new FormControl(null, Validators.required),
+      experimentName: new FormControl(null, [Validators.pattern('[a-zA-Z0-9\-]*'), Validators.required]),
       description: new FormControl(null, [Validators.required]),
       namespace: new FormControl(this.defaultNameSpace, [Validators.required]),
       cmd: new FormControl('', [Validators.required]),

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@submarine.apache.org
For additional commands, e-mail: dev-help@submarine.apache.org