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 4c6f7f1 SUBMARINE-669. Notebook name contain only lowercase
alphanumeric characters or '-'
4c6f7f1 is described below
commit 4c6f7f1e105a4cd700f4b41c02db2d955de82fc5
Author: Charles <[email protected]>
AuthorDate: Wed Nov 18 16:28:42 2020 +0800
SUBMARINE-669. Notebook name contain only lowercase alphanumeric characters
or '-'
### What is this PR for?
Fix the rule of "Notebook Name" while creating new notebook and add
description in userdocs.
Now notebook name should follow the DNS label standard as defined in RFC
1123.
1. Contain at most 63 characters.
2. Contain only lowercase alphanumeric characters or '-'.
3. Start with an alphanumeric character.
4. End with an alphanumeric character.
### What type of PR is it?
[Bug Fix]
### Todos
* [ ] - Task
### What is the Jira issue?
[SUBMARINE-669](https://issues.apache.org/jira/projects/SUBMARINE/issues/SUBMARINE-669?filter=allopenissues)
### How should this be tested?
[Travis
CI](https://travis-ci.com/github/charlie0220/submarine/builds/199579036)
### Screenshots (if appropriate)

### Questions:
* Does the licenses files need update? No
* Is there breaking changes for older versions? No
* Does this needs documentation? No
Author: Charles <[email protected]>
Closes #451 from charlie0220/SUBMARINE-669 and squashes the following
commits:
a7b2ff7 [Charles] SUBMARINE-674. Update the rules of notebookName.
3723fb2 [Charles] SUBMARINE-669. Notebook name contain only lowercase
alphanumeric characters or '-'
b366879 [Charles] Merge branch 'master' of
https://github.com/apache/submarine
c8d2335 [Charles] SUBMARINE-657. Update user-drawer.component.ts
7d1066b [Charles] SUBMARINE-657. The problem of creating a new user
---
docs/userdocs/k8s/notebook.md | 10 +++++++---
.../src/app/pages/workbench/notebook/notebook.component.ts | 6 +++++-
2 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/docs/userdocs/k8s/notebook.md b/docs/userdocs/k8s/notebook.md
index fa9a614..4c1d1f2 100644
--- a/docs/userdocs/k8s/notebook.md
+++ b/docs/userdocs/k8s/notebook.md
@@ -36,7 +36,11 @@ left-hand panel to manage your notebooks.
To create a new notebook server, click “New Notebook”. You should see a form
for entering \
details of your new notebook server.
-- Notebook Name : Name of the notebook server. It should be unique and include
no spaces.
+- Notebook Name : Name of the notebook server. It should follow the rules
below.
+ 1. Contain at most 63 characters.
+ 2. Contain only lowercase alphanumeric characters or '-'.
+ 3. Start with an alphabetic character.
+ 4. End with an alphanumeric character.
- Environment : It defines a set of libraries and docker image.
- CPU and Memory
- GPU (optional)
@@ -92,6 +96,6 @@ experiment =
submarine_client.create_experiment(experiment_spec=experiment_spec)
```
-You can create a new notebook, paste the above code and run it. Or, you can
find the notebook `submarine_experiment_sdk.ipynb` inside the launched notebook
session. You can open it, try it out.
+You can create a new notebook, paste the above code and run it. Or, you can
find the notebook `submarine_experiment_sdk.ipynb` inside the launched notebook
session. You can open it, try it out.
-After experiment submitted to Submarine server, you can find the experiment
jobs on the UI.
\ No newline at end of file
+After experiment submitted to Submarine server, you can find the experiment
jobs on the UI.
diff --git
a/submarine-workbench/workbench-web/src/app/pages/workbench/notebook/notebook.component.ts
b/submarine-workbench/workbench-web/src/app/pages/workbench/notebook/notebook.component.ts
index 506765c..5c490c3 100644
---
a/submarine-workbench/workbench-web/src/app/pages/workbench/notebook/notebook.component.ts
+++
b/submarine-workbench/workbench-web/src/app/pages/workbench/notebook/notebook.component.ts
@@ -66,7 +66,11 @@ export class NotebookComponent implements OnInit {
});
this.notebookForm = new FormGroup({
- notebookName: new FormControl(null, Validators.required),
+ notebookName: new FormControl('', [
+ Validators.maxLength(63),
+ Validators.pattern('^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$'),
+ Validators.required
+ ]),
envName: new FormControl(null, Validators.required), // Environment
envVars: new FormArray([],
[this.experimentValidatorService.nameValidatorFactory('key')]),
cpus: new FormControl(null, [Validators.min(1), Validators.required]),
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]