|
1 | 1 | # Custom Studios Examples |
2 | 2 |
|
3 | | -This repository contains example Dockerfiles and configurations for custom Seqera Studio applications. Each example demonstrates how to create and deploy different types of interactive applications in Seqera Studios. |
| 3 | +Example configurations for deploying custom [Seqera Studio](https://docs.seqera.io/platform-cloud/studios/overview) applications from a Git repository. |
4 | 4 |
|
5 | | -## Available Examples |
| 5 | +> **Do not merge studio configurations into `master`!** Each studio has its own dedicated branch. |
6 | 6 |
|
7 | | -- [Marimo](marimo/README.md) - A reactive Python notebook environment |
8 | | -- [CellxGene](cellxgene/README.md) - Interactive single-cell data visualization |
9 | | -- [Streamlit](streamlit/README.md) - MultiQC visualization using Streamlit |
10 | | -- [Shiny](shiny-simple-example/README.md) - Interactive data visualization with R Shiny |
11 | | -- [TTYD](ttyd/README.md) - Interactive web-based terminal with bioinformatics tools |
| 7 | +## Repository Structure |
12 | 8 |
|
13 | | -## Prerequisites |
| 9 | +This repository uses a **branch-per-studio** model (similar to [nf-core/test-datasets](https://github.com/nf-core/test-datasets)). The `master` branch contains only this documentation. Each studio's configuration lives on its own branch with a `.seqera/` directory containing the `studio-config.yaml` and `Dockerfile` required for [launching Studios from a Git repository](https://docs.seqera.io/platform-cloud/studios/add-studio-git-repo). |
14 | 10 |
|
15 | | -All examples in this repository require: |
16 | | -- [Docker](https://www.docker.com/) installed |
17 | | -- [Wave](https://docs.seqera.io/platform-cloud/wave/) configured in your Seqera Platform workspace |
18 | | -- Access to a container registry (public or Amazon ECR) for pushing your images |
| 11 | +## Available Studios |
19 | 12 |
|
20 | | -## Common Features |
| 13 | +| Branch | Studio | Description | |
| 14 | +|--------|--------|-------------| |
| 15 | +| [`marimo`](https://github.com/seqeralabs/custom-studios-examples/tree/marimo) | Marimo | Reactive Python notebook environment | |
| 16 | +| [`cellxgene`](https://github.com/seqeralabs/custom-studios-examples/tree/cellxgene) | CellxGene | Interactive single-cell data visualization | |
| 17 | +| [`streamlit`](https://github.com/seqeralabs/custom-studios-examples/tree/streamlit) | Streamlit | MultiQC visualization using Streamlit | |
| 18 | +| [`shiny`](https://github.com/seqeralabs/custom-studios-examples/tree/shiny) | R Shiny | Interactive data visualization with R Shiny | |
| 19 | +| [`ttyd`](https://github.com/seqeralabs/custom-studios-examples/tree/ttyd) | TTYD | Web-based terminal with bioinformatics tools | |
21 | 20 |
|
22 | | -All examples in this repository: |
23 | | -- Are compatible with both local Docker testing and Seqera Studios |
24 | | -- Use the required Seqera base image and connect-client |
25 | | -- Include detailed setup and usage instructions |
26 | | -- Support data mounting via datalinks in Studios |
27 | | -- Are built for linux/amd64 platform compatibility |
28 | | -- Use multi-stage builds to include the connect-client |
29 | | -- Follow consistent container best practices |
30 | | - |
31 | | -## Deploying to Seqera Studios |
32 | | - |
33 | | -All examples follow the same deployment process: |
34 | | - |
35 | | -1. Select the **Studios** tab in your workspace |
36 | | -2. Click **Add Studio** |
37 | | -3. In the **General config** section: |
38 | | - - Select **Prebuilt container image** as the container template |
39 | | - - Enter your container image URI (e.g., `cr.seqera.io/scidev/your-example`) |
40 | | - - Set a **Studio name** and optional **Description** |
41 | | -4. Configure compute resources in the **Compute and Data** section: |
42 | | - - Select your compute environment |
43 | | - - Adjust CPU, GPU, and memory allocations as needed |
44 | | - - Mount any required data using the **Mount data** option |
45 | | - - Configure environment variables if the example supports them (see [Environment Variables](#environment-variables) section) |
46 | | -5. Review the configuration in the **Summary** section |
47 | | -6. Click **Add and start** to create and launch the Studio |
| 21 | +## Quick Start: Launch from Git Repository |
48 | 22 |
|
49 | | -## Environment Variables |
| 23 | +1. Navigate to **Studios** > **Add Studio** in your Seqera Platform workspace |
| 24 | +2. Select **Git repository** as the source |
| 25 | +3. Enter the repository URL: `https://github.com/seqeralabs/custom-studios-examples` |
| 26 | +4. Select the branch for the studio you want (e.g., `marimo`, `cellxgene`, `streamlit`, `shiny`, `ttyd`) |
| 27 | +5. Select your compute environment |
| 28 | +6. Click **Add** then **Start** |
| 29 | + |
| 30 | +Each branch contains a `.seqera/` directory with: |
| 31 | +- `studio-config.yaml` — Studio configuration pointing to the Dockerfile |
| 32 | +- `Dockerfile` — Container definition with connect-client integration |
| 33 | +- Any supporting files required by the Dockerfile |
| 34 | + |
| 35 | +## Alternative Deployment: Pre-built Images |
| 36 | + |
| 37 | +Each studio is also available as a pre-built container image: |
| 38 | + |
| 39 | +``` |
| 40 | +ghcr.io/seqeralabs/custom-studios-examples/marimo:latest |
| 41 | +ghcr.io/seqeralabs/custom-studios-examples/cellxgene:latest |
| 42 | +ghcr.io/seqeralabs/custom-studios-examples/streamlit:latest |
| 43 | +ghcr.io/seqeralabs/custom-studios-examples/shiny:latest |
| 44 | +ghcr.io/seqeralabs/custom-studios-examples/ttyd:latest |
| 45 | +``` |
| 46 | + |
| 47 | +To use a pre-built image, select **Prebuilt container image** instead of **Git repository** when adding a Studio. |
| 48 | + |
| 49 | +## Alternative Deployment: Wave CLI |
| 50 | + |
| 51 | +You can also build any studio with the [Wave CLI](https://docs.seqera.io/wave/): |
50 | 52 |
|
51 | | -Some examples support environment variable configuration to customize data paths and application settings without modifying the container image. This makes those examples more flexible and reusable across different datasets and configurations. |
| 53 | +```bash |
| 54 | +# Clone only the branch you need |
| 55 | +git clone https://github.com/seqeralabs/custom-studios-examples.git --single-branch --branch <studio-name> |
52 | 56 |
|
53 | | -### Examples with Environment Variables |
| 57 | +# Build with Wave |
| 58 | +wave -f .seqera/Dockerfile --context .seqera --platform linux/amd64 --await --tower-token "$TOWER_ACCESS_TOKEN" |
| 59 | +``` |
54 | 60 |
|
55 | | -Only the following examples support environment variable configuration: |
56 | | -- **CellxGene**: `DATASET_FILE`, `DATASET_TITLE` - Configure dataset path and display title |
57 | | -- **Shiny**: `DATA_PATH` - Configure data file path with automatic cloud storage path conversion |
| 61 | +## Cloning a Specific Studio |
58 | 62 |
|
59 | | -### Examples without Environment Variables |
| 63 | +Due to the branch-per-studio model, we recommend cloning only the branch you need: |
60 | 64 |
|
61 | | -These examples work with their default configurations and don't require environment variable setup: |
62 | | -- **Marimo**: Interactive Python notebook environment |
63 | | -- **Streamlit**: MultiQC visualization with web-based data loading interface |
64 | | -- **TTYD**: Web-based terminal with pre-installed bioinformatics tools |
| 65 | +```bash |
| 66 | +git clone https://github.com/seqeralabs/custom-studios-examples.git --single-branch --branch <studio-name> |
| 67 | +``` |
65 | 68 |
|
66 | | -### Using Environment Variables in Seqera Studios |
| 69 | +To add another branch later: |
67 | 70 |
|
68 | | -When deploying to Seqera Studios, you can configure environment variables in the **Compute and Data** section: |
69 | | -1. Expand the **Environment variables** section |
70 | | -2. Add key-value pairs for the variables you want to customize |
71 | | -3. The application will use these values instead of the defaults |
| 71 | +```bash |
| 72 | +git remote set-branches --add origin <studio-name> |
| 73 | +git fetch |
| 74 | +``` |
| 75 | + |
| 76 | +## Environment Variables |
| 77 | + |
| 78 | +Some studios support environment variable configuration: |
| 79 | + |
| 80 | +| Studio | Variable | Default | Description | |
| 81 | +|--------|----------|---------|-------------| |
| 82 | +| CellxGene | `DATASET_FILE` | `s3://cellxgene_datasets/pbmc3k.h5ad` | Path to .h5ad dataset | |
| 83 | +| CellxGene | `DATASET_TITLE` | `PBMCs 3k test dataset` | Display title | |
| 84 | +| CellxGene | `USER_DATA_DIR` | `/user-data/cellxgene` | User data storage | |
| 85 | +| CellxGene | `ANNOTATIONS_DIR` | `/user-data/cellxgene` | Annotations storage | |
| 86 | +| Shiny | `DATA_PATH` | `s3://shiny-inputs/data.csv` | Path to CSV data file | |
| 87 | + |
| 88 | +Studios without listed variables (Marimo, Streamlit, TTYD) work with their default configurations. |
| 89 | + |
| 90 | +## Common Features |
| 91 | + |
| 92 | +All studios in this repository: |
| 93 | +- Use the `.seqera/` directory convention for Git-based Studio deployment |
| 94 | +- Include the required Seqera `connect-client` for platform integration |
| 95 | +- Support data mounting via datalinks in Studios |
| 96 | +- Are built for `linux/amd64` platform compatibility |
| 97 | +- Use multi-stage Docker builds with connect-client |
72 | 98 |
|
73 | 99 | ## Documentation |
74 | 100 |
|
75 | | -- [Official documentation on building custom studio environments](https://docs.seqera.io/platform-cloud/studios/custom-envs#custom-containers) |
76 | | -- Each example's README contains specific instructions for: |
77 | | - - Building and testing locally |
78 | | - - Required dependencies and configurations |
79 | | - - Example-specific features and usage |
80 | | - - Data format requirements |
81 | | - - Customization options |
| 101 | +- [Add a Studio from a Git repository](https://docs.seqera.io/platform-cloud/studios/add-studio-git-repo) |
| 102 | +- [Custom studio environments](https://docs.seqera.io/platform-cloud/studios/custom-envs) |
| 103 | +- [Wave CLI](https://docs.seqera.io/wave/) |
| 104 | +- [Deploying custom applications in Seqera Studios](https://seqera.io/blog/deploy-custom-apps-studios/) |
82 | 105 |
|
83 | 106 | ## Contributing |
84 | 107 |
|
85 | | -Feel free to contribute new examples or improvements to existing ones. Each example should: |
86 | | -- Follow the established README structure |
87 | | -- Include comprehensive documentation |
88 | | -- Maintain consistency with common features |
89 | | -- Provide clear prerequisites and deployment instructions |
90 | | -- Include example data or clear data requirements |
| 108 | +To add a new studio: |
91 | 109 |
|
92 | | -<!-- TODO Add a link to the blog post --> |
| 110 | +1. Create a new branch from an empty root (orphan branch): `git checkout --orphan <studio-name>` |
| 111 | +2. Add a `.seqera/` directory with `studio-config.yaml` and `Dockerfile` |
| 112 | +3. Add a `README.md` documenting the studio |
| 113 | +4. Push the branch |
| 114 | +5. Update this README on `master` to list the new studio |
0 commit comments