-
Notifications
You must be signed in to change notification settings - Fork 71
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 #913 from Vafilor/feat/add.deep.learning.desktop
feat: added deep learning desktop workspace
- Loading branch information
Showing
4 changed files
with
171 additions
and
0 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
db/go/20210414165510_add_deep_learning_desktop_workspace.go
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,31 @@ | ||
package migration | ||
|
||
import ( | ||
"database/sql" | ||
"github.com/pressly/goose" | ||
"path/filepath" | ||
) | ||
|
||
var deepLearningDesktopTemplateName = "Deep Learning Desktop" | ||
|
||
func initialize20210414165510() { | ||
if _, ok := initializedMigrations[20210414165510]; !ok { | ||
goose.AddMigration(Up20210414165510, Down20210414165510) | ||
initializedMigrations[20210414165510] = true | ||
} | ||
} | ||
|
||
// Up20210414165510 creates the Deep Learning Desktop Workspace Template | ||
func Up20210414165510(tx *sql.Tx) error { | ||
// This code is executed when the migration is applied. | ||
return createWorkspaceTemplate( | ||
filepath.Join("workspaces", "vnc", "20210414165510.yaml"), | ||
deepLearningDesktopTemplateName, | ||
"Deep learning desktop with VNC") | ||
} | ||
|
||
// Down20210414165510 removes the Deep Learning Desktop Workspace Template | ||
func Down20210414165510(tx *sql.Tx) error { | ||
// This code is executed when the migration is rolled back. | ||
return archiveWorkspaceTemplate(deepLearningDesktopTemplateName) | ||
} |
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
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,57 @@ | ||
arguments: | ||
parameters: | ||
# parameter screen-resolution allows users to select screen resolution | ||
- name: screen-resolution | ||
value: 1680x1050 | ||
type: select.select | ||
displayName: Screen Resolution | ||
options: | ||
- name: 1280x1024 | ||
value: 1280x1024 | ||
- name: 1680x1050 | ||
value: 1680x1050 | ||
- name: 2880x1800 | ||
value: 2880x1800 | ||
containers: | ||
- name: ubuntu | ||
image: onepanel/vnc:dl-vnc | ||
env: | ||
- name: VNC_PASSWORDLESS | ||
value: true | ||
- name: VNC_RESOLUTION | ||
value: '{{workflow.parameters.screen-resolution}}' | ||
ports: | ||
- containerPort: 6901 | ||
name: vnc | ||
volumeMounts: | ||
- name: data | ||
mountPath: /data | ||
ports: | ||
- name: vnc | ||
port: 80 | ||
protocol: TCP | ||
targetPort: 6901 | ||
routes: | ||
- match: | ||
- uri: | ||
prefix: / | ||
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 |