Skip to content

Commit 2cbd038

Browse files
fnajiclaude
andcommitted
Improve template with setup documentation and best practices
- Add setup checklist and ghcr.io visibility documentation to README - Document minimal vs full base image options in Dockerfile - Add Git LFS checkout to CI and release workflows - Add .gitattributes template for Git LFS configuration - Document common system dependencies for R package compilation Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent a5d774f commit 2cbd038

5 files changed

Lines changed: 102 additions & 6 deletions

File tree

.gitattributes

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Git LFS tracking for large files commonly used in operators
2+
# Uncomment the file types you need to track with LFS
3+
# Note: Only use LFS for files that are truly large (>1MB)
4+
5+
# Data files (uncomment as needed)
6+
# *.rds filter=lfs diff=lfs merge=lfs -text
7+
# *.RDS filter=lfs diff=lfs merge=lfs -text
8+
# *.csv filter=lfs diff=lfs merge=lfs -text
9+
# *.tsv filter=lfs diff=lfs merge=lfs -text
10+
11+
# Binary/media files (uncomment as needed)
12+
# *.pdf filter=lfs diff=lfs merge=lfs -text
13+
# *.png filter=lfs diff=lfs merge=lfs -text
14+
# *.jpg filter=lfs diff=lfs merge=lfs -text
15+
# *.jpeg filter=lfs diff=lfs merge=lfs -text
16+
17+
# Example: Track specific large files
18+
# data/large_reference.rds filter=lfs diff=lfs merge=lfs -text

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ jobs:
2222
steps:
2323
- name: Checkout repository
2424
uses: actions/checkout@v4
25+
with:
26+
lfs: true
2527

2628
- name: Log in to the Container registry
2729
uses: docker/login-action@v3.3.0

.github/workflows/release.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ jobs:
2121
steps:
2222
- name: Checkout repository
2323
uses: actions/checkout@v4
24+
with:
25+
lfs: true
2426

2527
- name: Update container in operator.json
2628
run: |

Dockerfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
1+
# =============================================================================
2+
# BASE IMAGE OPTIONS
3+
# =============================================================================
4+
# Option A: Full runtime (default) - larger image, most dependencies included
15
FROM tercen/runtime-r44:4.4.3-8
26

7+
# Option B: Minimal runtime - smaller image, faster pulls
8+
# Uncomment the lines below and comment out Option A above to use minimal image
9+
# FROM tercen/runtime-r44-minimal:4.4.3-2
10+
# RUN apk update && apk add --no-cache \
11+
# gcc g++ musl-dev make gfortran \
12+
# curl-dev openssl-dev git pkgconfig
13+
# # Uncomment if your R packages have Rust dependencies (e.g., stringi, gifski):
14+
# # cargo rust
15+
316
COPY . /operator
417
WORKDIR /operator
518

README.md

Lines changed: 67 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,67 @@ The `Template R Operator` is a template repository for the creation of R operato
1111

1212
Detailed information can be found in the [Tercen developer's guide](https://tercen.github.io/developers_guide/).
1313

14+
## Setup Checklist
15+
16+
After creating your operator from this template, complete the following steps:
17+
18+
- [ ] Update `operator.json`:
19+
- Change `name` and `description`
20+
- Update `authors` to your organization
21+
- Update `container` to match your repo: `ghcr.io/YOUR_ORG/YOUR_REPO:main`
22+
- Update `urls` similarly
23+
- Configure `properties` for your operator's parameters
24+
- [ ] If using minimal base image, uncomment and configure the Dockerfile accordingly
25+
- [ ] Run `renv::init()` locally and commit `renv.lock`
26+
- [ ] Push your changes to trigger the CI workflow
27+
- [ ] **Important**: Make the Docker package publicly accessible (see below)
28+
29+
## GitHub Container Registry Visibility
30+
31+
By default, GitHub Container Registry (ghcr.io) packages inherit the repository's visibility settings. If your repository is **private**, the Docker image will also be private, and Tercen/BioNavigator will fail to pull it with an error like:
32+
33+
```
34+
Error response from daemon: denied
35+
```
36+
37+
**To fix this**, you have two options:
38+
39+
1. **Make the package public** (recommended if repo stays private):
40+
- Go to `https://github.com/orgs/YOUR_ORG/packages`
41+
- Find your operator package
42+
- Click "Package settings"
43+
- Under "Danger Zone", click "Change visibility" and select "Public"
44+
45+
2. **Make the repository public**:
46+
- This automatically makes associated packages public
47+
48+
## Dockerfile Options
49+
50+
This template provides two base image options:
51+
52+
| Option | Base Image | Use Case |
53+
|--------|------------|----------|
54+
| **Full runtime** (default) | `tercen/runtime-r44:4.4.3-8` | Most dependencies included, easier setup |
55+
| **Minimal runtime** | `tercen/runtime-r44-minimal:4.4.3-2` | Smaller image, requires adding build dependencies |
56+
57+
If using the minimal runtime, uncomment the relevant lines in the Dockerfile and add any system dependencies your R packages require. Common dependencies:
58+
59+
- `gcc g++ musl-dev make` - C/C++ compilation (most R packages)
60+
- `gfortran` - Fortran compiler (statistical packages, linear algebra)
61+
- `curl-dev openssl-dev` - HTTP/SSL support
62+
- `cargo rust` - Rust toolchain (some modern R packages)
63+
64+
## Git LFS
65+
66+
This template includes a `.gitattributes` file with commented-out LFS tracking rules for common large file types (`.rds`, `.csv`, `.pdf`, images). If your operator requires large data files:
67+
68+
1. Install Git LFS: `git lfs install`
69+
2. Uncomment the relevant lines in `.gitattributes` for file types you need to track
70+
3. Run `git lfs track` to verify your patterns
71+
4. Commit the updated `.gitattributes` before adding large files
72+
73+
---
74+
1475
Below is the operator README standard structure.
1576

1677
### Description
@@ -21,12 +82,12 @@ The `Template R operator` is a template repository for the creation of R operato
2182

2283
Input|.
2384
---|---
24-
`x-axis` | type, description
25-
`y-axis` | type, description
26-
`row` | type, description
27-
`column` | type, description
28-
`colors` | type, description
29-
`labels` | type, description
85+
`x-axis` | type, description
86+
`y-axis` | type, description
87+
`row` | type, description
88+
`column` | type, description
89+
`colors` | type, description
90+
`labels` | type, description
3091

3192
Settings|.
3293
---|---

0 commit comments

Comments
 (0)