Skip to content

Commit ab5f61a

Browse files
Add dbm-example custom Jupyter app template
Creates a new custom app template based on Jupyter base-notebook with integrated Workbench tools (gcsfuse, wb CLI) and cloud CLIs (AWS, GCP). Configured for user rishbahc with Java 17 support. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent d1a9abc commit ab5f61a

5 files changed

Lines changed: 134 additions & 0 deletions

File tree

src/dbm-example/.devcontainer.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"name": "dbm-example",
3+
"dockerComposeFile": "docker-compose.yaml",
4+
"service": "app",
5+
"shutdownAction": "none",
6+
"workspaceFolder": "/workspace",
7+
"postCreateCommand": [
8+
"./startupscript/post-startup.sh",
9+
"rishbahc",
10+
"/home/rishabhc",
11+
"${templateOption:cloud}",
12+
"${templateOption:login}"
13+
],
14+
"postStartCommand": [
15+
"./startupscript/remount-on-restart.sh",
16+
"rishbahc",
17+
"/home/rishabhc",
18+
"${templateOption:cloud}",
19+
"${templateOption:login}"
20+
],
21+
"features": {
22+
"ghcr.io/devcontainers/features/java:1": {
23+
"version": "17"
24+
},
25+
"ghcr.io/devcontainers/features/aws-cli:1": {},
26+
"ghcr.io/dhoeric/features/google-cloud-cli:1": {}
27+
},
28+
"remoteUser": "root"
29+
}

src/dbm-example/README.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# dbm-example
2+
3+
Custom Workbench application based on quay.io/jupyter/base-notebook.
4+
5+
## Configuration
6+
7+
- **Image**: quay.io/jupyter/base-notebook
8+
- **Port**: 8888
9+
- **User**: rishbahc
10+
- **Home Directory**: /home/rishabhc
11+
12+
## Access
13+
14+
Once deployed in Workbench, access your terminal at the app URL (port 8888).
15+
16+
For local testing:
17+
1. Create Docker network: `docker network create app-network`
18+
2. Run the app: `devcontainer up --workspace-folder .`
19+
3. Access at: `http://localhost:8888`
20+
21+
## Customization
22+
23+
Edit the following files to customize your app:
24+
25+
- `.devcontainer.json` - Devcontainer configuration and features
26+
- `docker-compose.yaml` - Docker Compose configuration (change the `command` to customize ttyd options)
27+
- `devcontainer-template.json` - Template options and metadata
28+
29+
## Testing
30+
31+
To test this app template:
32+
33+
```bash
34+
cd test
35+
./test.sh dbm-example
36+
```
37+
38+
## Usage
39+
40+
1. Fork the repository
41+
2. Modify the configuration files as needed
42+
3. In Workbench UI, create a custom app pointing to your forked repository
43+
4. Select this app template (dbm-example)
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"id": "dbm-example",
3+
"version": "1.0.0",
4+
"name": "dbm-example",
5+
"description": "Custom Workbench app: dbm-example (Image: quay.io/jupyter/base-notebook, Port: 8888, User: rishbahc)",
6+
"options": {
7+
"cloud": {
8+
"type": "string",
9+
"enum": ["gcp", "aws"],
10+
"default": "gcp",
11+
"description": "Cloud provider (gcp or aws)"
12+
},
13+
"login": {
14+
"type": "string",
15+
"description": "Whether to log in to workbench CLI",
16+
"proposals": ["true", "false"],
17+
"default": "false"
18+
}
19+
}
20+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
services:
2+
app:
3+
# The container name must be "application-server"
4+
container_name: "application-server"
5+
# This can be either a pre-existing image or built from a Dockerfile
6+
image: "quay.io/jupyter/base-notebook"
7+
# build:
8+
# context: .
9+
restart: always
10+
volumes:
11+
- .:/workspace:cached
12+
- work:/home/rishabhc/work
13+
# The port specified here will be forwarded and accessible from the
14+
# Workbench UI.
15+
ports:
16+
- 8888:8888
17+
# The service must be connected to the "app-network" Docker network
18+
networks:
19+
- app-network
20+
# SYS_ADMIN and fuse are required to mount workspace resources into the
21+
# container.
22+
cap_add:
23+
- SYS_ADMIN
24+
devices:
25+
- /dev/fuse
26+
security_opt:
27+
- apparmor:unconfined
28+
29+
volumes:
30+
work:
31+
32+
networks:
33+
# The Docker network must be named "app-network". This is an external network
34+
# that is created outside of this docker-compose file.
35+
app-network:
36+
external: true

tests/dbm-example.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
set -o errexit
3+
export TEST_USER="jovyan"
4+
export TEST_USER_HOME="/home/jovyan"
5+
6+
bats tests/common/base.bats

0 commit comments

Comments
 (0)