Skip to content

Commit 1db97ae

Browse files
cailmdaleyclaude
andauthored
Remove conda: CI and docs build from the container (#733)
* ci: run pytest inside the dev image; retire the conda test suite The Docker image (slim Python + apt + uv-frozen wheels) is already the deployment environment; testing a separate conda env in ci-release.yml tested something nothing ships — and that conda path had silently rotted. Move the suite into the artifact: deploy-image.yml now runs `pytest` inside the dev image alongside the existing example-pipeline and binary smokes. Split build/test from publish — pull_request builds and tests without pushing (works for fork PRs too); only pushes to develop/main/ master publish to ghcr. Delete ci-release.yml. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * ci: build API docs in the dev image; drop conda from doc deploy cd.yml built docs via conda + install_shapepipe + `conda install pandoc`. Build them inside the dev image instead (its `doc` extra carries sphinx + myst-parser + the theme). pandoc was vestigial — docs use myst_parser and autodoc, no nbsphinx/notebooks — so it's dropped, along with the old importlib-metadata workaround. Delete doc-tests.yml: a workflow_dispatch-only duplicate of cd.yml's build with no deploy. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * chore: remove conda machinery (install_shapepipe, environment*.yml) Nothing builds from conda anymore: the container uses apt + uv-frozen wheels, CI tests inside that image, and docs build there too. The install_shapepipe script (conda env creation + from-source C builds) and the production/dev environment files served only the retired conda path — including the unsolvable production pin (astropy==5.2 vs python=3.12), which is now moot rather than something to fix. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * docs: document container/uv install; drop conda instructions - installation.md: remove the deprecated conda section and the install_shapepipe-based MPI/uninstall sections; keep container (recommended) + library-only (pip / `.[dev]`) paths. Note the image bundles the astromatic binaries and MPI. - pipeline_tutorial.md: point the quick-start install at installation.md (container), not a conda env + a broken anchor. - CONTRIBUTING.md: cite pyproject.toml / uv.lock for version compat instead of environment.yml. Cluster job scripts under example/pbs/ and scripts/sh/ still reference personal conda envs; those are operational, cluster-specific, and out of scope here — tracked as follow-up. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 4746cee commit 1db97ae

10 files changed

Lines changed: 100 additions & 1016 deletions

File tree

.github/workflows/cd.yml

Lines changed: 29 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,49 @@
11
name: Deploy API Docs
22

3+
# Build the Sphinx API docs inside the dev image (same slim-Python + uv
4+
# environment everything else uses — no conda) and publish to gh-pages.
5+
# autodoc imports shapepipe, so it needs the full runtime; the dev image's
6+
# `doc` extra provides sphinx + myst-parser + the theme on top of that.
37
on:
48
push:
59
branches:
6-
- master
7-
- main
10+
- master
11+
- main
12+
workflow_dispatch:
813

914
jobs:
10-
1115
api:
1216
name: Deploy API Documentation
1317
runs-on: ubuntu-latest
1418

1519
steps:
16-
- uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0
20+
- name: Checkout repository
21+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
1722

18-
- name: Set up conda
19-
uses: conda-incubator/setup-miniconda@9f54435e0e72c53962ee863144e47a4b094bfd35 # v2.3.0
23+
- name: Set up Docker Buildx
24+
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
2025
with:
21-
auto-update-conda: true
22-
python-version: 3.9
23-
auto-activate-base: true
24-
25-
- name: Install dependencies
26-
shell: bash -l {0}
27-
run: |
28-
./install_shapepipe --develop --no-exe --no-mpi
29-
conda activate shapepipe
30-
python -m pip install --upgrade importlib-metadata
31-
conda install -c conda-forge pandoc
26+
driver-opts: network=host
3227

28+
- name: Build dev image
29+
uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6.19.2
30+
with:
31+
context: .
32+
target: dev
33+
load: true
34+
tags: shapepipe-dev:docs
35+
cache-from: type=gha
36+
cache-to: type=gha,mode=max
37+
38+
# Generate API stubs and build the HTML inside the image. docs/ is
39+
# bind-mounted so sphinx-apidoc's generated rst and the _build output
40+
# land back on the runner for the deploy step.
3341
- name: Build API documentation
34-
shell: bash -l {0}
3542
run: |
36-
conda activate shapepipe
37-
sphinx-apidoc -t docs/_templates -feTMo docs/source shapepipe shapepipe/modules/*_runner.py
38-
sphinx-build -E docs/source docs/_build
43+
docker run --rm -v "${GITHUB_WORKSPACE}/docs:/app/docs" shapepipe-dev:docs bash -c "
44+
sphinx-apidoc -t docs/_templates -feTMo docs/source shapepipe shapepipe/modules/*_runner.py &&
45+
sphinx-build -E docs/source docs/_build
46+
"
3947
4048
- name: Deploy API documentation
4149
uses: peaceiris/actions-gh-pages@cf301857435c1f95963b21d58f452a7617770d60 # v3.5.9

.github/workflows/ci-release.yml

Lines changed: 0 additions & 67 deletions
This file was deleted.

.github/workflows/deploy-image.yml

Lines changed: 52 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,31 @@
1-
name: Create and publish a Docker image
2-
on: [push, workflow_dispatch]
1+
name: Docker image — build, test, publish
2+
3+
# Single source of truth for ShapePipe's environment is the Dockerfile
4+
# (slim Python + apt system deps + uv-frozen wheels). This workflow builds
5+
# that image, runs the test suite *inside it* — so CI tests exactly what
6+
# ships — and publishes to ghcr only on pushes to the integration branches.
7+
#
8+
# pull_request → build + test, no publish (also works for fork PRs)
9+
# push → build + test + publish (:develop, :latest, …)
10+
on:
11+
push:
12+
branches:
13+
- develop
14+
- main
15+
- master
16+
pull_request:
17+
branches:
18+
- develop
19+
- main
20+
- master
21+
workflow_dispatch:
22+
323
env:
424
REGISTRY: ghcr.io
525
IMAGE_NAME: ${{ github.repository }}
26+
627
jobs:
7-
build-and-push-image:
28+
build-test-publish:
829
runs-on: ubuntu-latest
930
permissions:
1031
contents: read
@@ -13,13 +34,6 @@ jobs:
1334
- name: Checkout repository
1435
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
1536

16-
- name: Log in to the Container registry
17-
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.0
18-
with:
19-
registry: ${{ env.REGISTRY }}
20-
username: ${{ github.actor }}
21-
password: ${{ secrets.GITHUB_TOKEN }}
22-
2337
- name: Set up Docker Buildx
2438
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
2539
with:
@@ -41,6 +55,10 @@ jobs:
4155
flavor: |
4256
suffix=-runtime,onlatest=true
4357
58+
# ----------------------------------------------------------------
59+
# Build + test (every event)
60+
# ----------------------------------------------------------------
61+
4462
# Build runtime first (smaller, used to smoke-test pipeline binaries)
4563
- name: Build runtime (load)
4664
uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6.19.2
@@ -84,15 +102,35 @@ jobs:
84102
cache-to: type=gha,mode=max
85103

86104
# Verify the dev-only additions are present and runnable.
87-
- name: Test dev — interactive tools and test extras
105+
- name: Test dev — interactive tools
88106
run: |
89107
IMAGE=$(echo "${{ steps.meta-dev.outputs.tags }}" | head -n1)
90108
docker run --rm "$IMAGE" vim --version | head -n1
91109
docker run --rm "$IMAGE" rg --version | head -n1
92-
docker run --rm "$IMAGE" pytest --version
93110
94-
# Push both targets
111+
# The actual test suite, run inside the shipped image — replacing the
112+
# retired conda-based suite. pytest exercises the same wheels, binaries,
113+
# and Python (3.12) that production runs on, not a parallel environment.
114+
# pyproject's addopts add `--cov=shapepipe`; COVERAGE_FILE is set to /tmp
115+
# in the image so it works on read-only filesystems too.
116+
- name: Test dev — pytest suite
117+
run: |
118+
IMAGE=$(echo "${{ steps.meta-dev.outputs.tags }}" | head -n1)
119+
docker run --rm "$IMAGE" pytest
120+
121+
# ----------------------------------------------------------------
122+
# Publish (push events only — never on pull_request, incl. forks)
123+
# ----------------------------------------------------------------
124+
- name: Log in to the Container registry
125+
if: github.event_name == 'push'
126+
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.0
127+
with:
128+
registry: ${{ env.REGISTRY }}
129+
username: ${{ github.actor }}
130+
password: ${{ secrets.GITHUB_TOKEN }}
131+
95132
- name: Push runtime
133+
if: github.event_name == 'push'
96134
uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6.19.2
97135
with:
98136
context: .
@@ -103,6 +141,7 @@ jobs:
103141
cache-from: type=gha
104142

105143
- name: Push dev
144+
if: github.event_name == 'push'
106145
uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6.19.2
107146
with:
108147
context: .

.github/workflows/doc-tests.yml

Lines changed: 0 additions & 41 deletions
This file was deleted.

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ In some cases it may be necessary to modify the unit tests, but this should be c
159159

160160
All contributions should adhere to the following style guides currently implemented in ShapePipe.
161161

162-
1. All code should be compatible with the Python package versions listed in the [Conda environment](https://github.com/CosmoStat/shapepipe/blob/develop/environment.yml).
162+
1. All code should be compatible with the Python package versions declared in [`pyproject.toml`](https://github.com/CosmoStat/shapepipe/blob/develop/pyproject.toml) (pinned exactly in `uv.lock`).
163163

164164
1. All code should adhere to [PEP8](https://www.python.org/dev/peps/pep-0008/) standards.
165165

0 commit comments

Comments
 (0)