Skip to content

Commit

Permalink
SUBMARINE-669. Notebook name contain only lowercase alphanumeric char…
Browse files Browse the repository at this point in the history
…acters 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)
![screen-capture](https://user-images.githubusercontent.com/50860453/98776092-4aac5880-2429-11eb-902e-0df98bbc6ac3.gif)

### Questions:
* Does the licenses files need update? No
* Is there breaking changes for older versions? No
* Does this needs documentation? No

Author: Charles <charlie850220@gmail.com>

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
  • Loading branch information
charlie0220 authored and pingsutw committed Nov 26, 2020
1 parent f5b4e53 commit 4c6f7f1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
10 changes: 7 additions & 3 deletions docs/userdocs/k8s/notebook.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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.
After experiment submitted to Submarine server, you can find the experiment jobs on the UI.
Original file line number Diff line number Diff line change
Expand Up @@ -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]),
Expand Down

0 comments on commit 4c6f7f1

Please sign in to comment.