Create custom applications

Create custom applications in Verily Workbench

Prior reading: Overview of Cloud Environments

Purpose: This document provides detailed instructions for creating a new custom app definition.



Introduction

Workbench allows users to run their custom applications on GCE instances for GCP-based Workbench workspaces. Visual Studio Code and RStudio are shown as examples to help you get started running your own applications. Workbench uses DevContainer to support app configuration and management. The DevContainer specification for examples in Workbench can be found in the workbench-app-devcontainers repository.

DevContainer

DevContainer stands for development containers. Workbench runs your apps in an isolated container in a VM. To define an app with devcontainer, you create a .devcontainer.json file.

Containerized Apps

.devcontainer.json supports Docker images, Docker files, and docker-compose. To customize your container with Dockerfile or Docker Compose, see Using Images, Dockerfiles, and Docker Compose.

DevContainer Feature

Besides docker, DevContainer Feature is a powerful tool in DevContainers for adding tools and libraries into your containers. Here is a list of available features.

You can clone over the RStudio app example definition from workbench-app-devcontainers and then add your custom features. For example, if you want to add RShiny packages into RStudio, you can install the R packages through devcontainer-features/r-packages feature.

"features": {
        "ghcr.io/rocker-org/devcontainer-features/r-packages:1": {
            "packages": "shiny,shinydashboard",
            "installSystemRequirements": true
        }
    }

Create your own app with devcontainer

If you want to create your own custom applications, the simplest way is to modify the Workbench template. Alternatively, see devcontainer/templates for more devContainer templates. If you choose to use these templates, there are some Workbench specific requirements that you must satisfied.

  1. The app must be running on app-network.
  2. The app port is exposed on localhost.
  3. If you want to sync the workspace bucket files to your working directory, set --cap-add SYS_ADMIN --device /dev/fuse --security-opt apparmor:unconfined to the docker container.

Publish your custom app to Git

You must publish your custom app DevContainer to a public Git repository for Workbench to reference it. For examples of custom app DevContainer, see rstudio DevContainer.

Launching a custom app in Verily Workbench

To launch the app from Verily Workbench UI, see detailed instructions in using cloud environments.

Last Modified: 9 February 2024