-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #810 from Vafilor/feat/sys.node.pool
fix: select.nodepool validation
- Loading branch information
Showing
12 changed files
with
540 additions
and
129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package migration | ||
|
||
import ( | ||
"database/sql" | ||
"github.com/pressly/goose" | ||
"path/filepath" | ||
) | ||
|
||
func initialize20201229205644() { | ||
if _, ok := initializedMigrations[20201229205644]; !ok { | ||
goose.AddMigration(Up20201229205644, Down20201229205644) | ||
initializedMigrations[20201229205644] = true | ||
} | ||
} | ||
|
||
// Up20201229205644 updates the jupyterlab workspace template | ||
func Up20201229205644(tx *sql.Tx) error { | ||
// This code is executed when the migration is applied. | ||
return updateWorkspaceTemplateManifest( | ||
filepath.Join("workspaces", "jupyterlab", "20201229205644.yaml"), | ||
jupyterLabTemplateName) | ||
} | ||
|
||
// Down20201229205644 rolls back the jupyterab workspace template update | ||
func Down20201229205644(tx *sql.Tx) error { | ||
// This code is executed when the migration is rolled back. | ||
return updateWorkspaceTemplateManifest( | ||
filepath.Join("workspaces", "jupyterlab", "20201214133458.yaml"), | ||
jupyterLabTemplateName) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
# Docker containers that are part of the Workspace | ||
containers: | ||
- name: jupyterlab | ||
image: onepanel/dl:0.17.0 | ||
command: ["/bin/bash", "-c", "pip install onepanel-sdk && start.sh LD_LIBRARY_PATH=/usr/local/nvidia/lib:/usr/local/nvidia/lib64 jupyter lab --LabApp.token='' --LabApp.allow_remote_access=True --LabApp.allow_origin=\"*\" --LabApp.disable_check_xsrf=True --LabApp.trust_xheaders=True --LabApp.base_url=/ --LabApp.tornado_settings='{\"headers\":{\"Content-Security-Policy\":\"frame-ancestors * 'self'\"}}' --notebook-dir='/data' --allow-root"] | ||
workingDir: /data | ||
env: | ||
- name: tornado | ||
value: "'{'headers':{'Content-Security-Policy':\"frame-ancestors\ *\ 'self'\"}}'" | ||
- name: TENSORBOARD_PROXY_URL | ||
value: '//$(ONEPANEL_RESOURCE_UID)--$(ONEPANEL_RESOURCE_NAMESPACE).$(ONEPANEL_DOMAIN)/tensorboard' | ||
ports: | ||
- containerPort: 8888 | ||
name: jupyterlab | ||
- containerPort: 6006 | ||
name: tensorboard | ||
- containerPort: 8080 | ||
name: nni | ||
volumeMounts: | ||
- name: data | ||
mountPath: /data | ||
lifecycle: | ||
postStart: | ||
exec: | ||
command: | ||
- /bin/sh | ||
- -c | ||
- > | ||
condayml="/data/.environment.yml"; | ||
jupytertxt="/data/.jupexported.txt"; | ||
if [ -f "$condayml" ]; then conda env update -f $condayml; fi; | ||
if [ -f "$jupytertxt" ]; then cat $jupytertxt | xargs -n 1 jupyter labextension install --no-build && jupyter lab build --minimize=False; fi; | ||
preStop: | ||
exec: | ||
command: | ||
- /bin/sh | ||
- -c | ||
- > | ||
conda env export > /data/.environment.yml -n base; | ||
jupyter labextension list 1>/dev/null 2> /data/.jup.txt; | ||
cat /data/.jup.txt | sed -n '2,$p' | awk 'sub(/v/,"@", $2){print $1$2}' > /data/.jupexported.txt; | ||
ports: | ||
- name: jupyterlab | ||
port: 80 | ||
protocol: TCP | ||
targetPort: 8888 | ||
- name: tensorboard | ||
port: 6006 | ||
protocol: TCP | ||
targetPort: 6006 | ||
- name: nni | ||
port: 8080 | ||
protocol: TCP | ||
targetPort: 8080 | ||
routes: | ||
- match: | ||
- uri: | ||
prefix: /tensorboard | ||
route: | ||
- destination: | ||
port: | ||
number: 6006 | ||
- match: | ||
- uri: | ||
prefix: /nni | ||
route: | ||
- destination: | ||
port: | ||
number: 8080 | ||
- match: | ||
- uri: | ||
prefix: / #jupyter runs at the default route | ||
route: | ||
- destination: | ||
port: | ||
number: 80 | ||
# DAG Workflow to be executed once a Workspace action completes (optional) | ||
#postExecutionWorkflow: | ||
# entrypoint: main | ||
# templates: | ||
# - name: main | ||
# dag: | ||
# tasks: | ||
# - name: slack-notify | ||
# template: slack-notify | ||
# - name: slack-notify | ||
# container: | ||
# image: technosophos/slack-notify | ||
# args: | ||
# - SLACK_USERNAME=onepanel SLACK_TITLE="Your workspace is ready" SLACK_ICON=https://www.gravatar.com/avatar/5c4478592fe00878f62f0027be59c1bd SLACK_MESSAGE="Your workspace is now running" ./slack-notify | ||
# command: | ||
# - sh | ||
# - -c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.