From 1313923a36c879f4c589e76dde57ae0a3a583aef Mon Sep 17 00:00:00 2001 From: Yu Hu Date: Fri, 13 Feb 2026 15:31:21 -0500 Subject: [PATCH] create a dummy app just for faster integration test --- src/test-app/.devcontainer.json | 8 +++++ src/test-app/README.md | 43 +++++++++++++++++++++++++ src/test-app/devcontainer-template.json | 20 ++++++++++++ src/test-app/docker-compose.yaml | 36 +++++++++++++++++++++ 4 files changed, 107 insertions(+) create mode 100644 src/test-app/.devcontainer.json create mode 100644 src/test-app/README.md create mode 100644 src/test-app/devcontainer-template.json create mode 100644 src/test-app/docker-compose.yaml diff --git a/src/test-app/.devcontainer.json b/src/test-app/.devcontainer.json new file mode 100644 index 00000000..d0a145dc --- /dev/null +++ b/src/test-app/.devcontainer.json @@ -0,0 +1,8 @@ +{ + "name": "test-app", + "dockerComposeFile": "docker-compose.yaml", + "service": "app", + "shutdownAction": "none", + "workspaceFolder": "/workspace", + "remoteUser": "root" +} diff --git a/src/test-app/README.md b/src/test-app/README.md new file mode 100644 index 00000000..93f61ebc --- /dev/null +++ b/src/test-app/README.md @@ -0,0 +1,43 @@ +# test-app + +Integration test-only custom Workbench application based on docker/getting-started. + + +## Configuration + +- **Image**: docker/getting-started +- **Port**: 8001 +- **User**: root +- **Home Directory**: /root + +## Access + +Once deployed in Workbench, access your terminal at the app URL (port 80). + +For local testing: +1. Create Docker network: `docker network create app-network` +2. Run the app: `devcontainer up --workspace-folder .` +3. Access at: `http://localhost:8001` + +## Customization + +Edit the following files to customize your app: + +- `.devcontainer.json` - Devcontainer configuration and features +- `docker-compose.yaml` - Docker Compose configuration (change the `command` to customize ttyd options) +- `devcontainer-template.json` - Template options and metadata + +## Testing + +To test this app template: + +```bash +cd test +./test.sh test-app +``` + +## Usage + +1. Create app and select custom +2. Specify https://github.com/verily-src/workbench-app-devcontainers.git and branch `master` and src/test-app + diff --git a/src/test-app/devcontainer-template.json b/src/test-app/devcontainer-template.json new file mode 100644 index 00000000..01b6d66b --- /dev/null +++ b/src/test-app/devcontainer-template.json @@ -0,0 +1,20 @@ +{ + "id": "test-app", + "version": "1.0.0", + "name": "test-app", + "description": "Custom Workbench app: test-app (Image: docker/getting-started, Port: 80, User: root)", + "options": { + "cloud": { + "type": "string", + "enum": ["gcp", "aws"], + "default": "gcp", + "description": "Cloud provider (gcp or aws)" + }, + "login": { + "type": "string", + "description": "Whether to log in to workbench CLI", + "proposals": ["true", "false"], + "default": "false" + } + } +} diff --git a/src/test-app/docker-compose.yaml b/src/test-app/docker-compose.yaml new file mode 100644 index 00000000..5bf9828b --- /dev/null +++ b/src/test-app/docker-compose.yaml @@ -0,0 +1,36 @@ +services: + app: + # The container name must be "application-server" + container_name: "application-server" + # This can be either a pre-existing image or built from a Dockerfile + image: "docker/getting-started" + # build: + # context: . + restart: always + volumes: + - .:/workspace:cached + - work:/root/work + # The port specified here will be forwarded and accessible from the + # Workbench UI. + ports: + - 8001:80 + # The service must be connected to the "app-network" Docker network + networks: + - app-network + # SYS_ADMIN and fuse are required to mount workspace resources into the + # container. + cap_add: + - SYS_ADMIN + devices: + - /dev/fuse + security_opt: + - apparmor:unconfined + +volumes: + work: + +networks: + # The Docker network must be named "app-network". This is an external network + # that is created outside of this docker-compose file. + app-network: + external: true