Repository navigation
feat: add docker-dev image and update-cu-base script for container-use support - #1097
Conversation
|
This change is part of the following stack: Change managed by git-spice. |
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the developer experience by introducing a robust, reproducible container-based development environment. It streamlines the setup and maintenance of development tools and dependencies, ensuring consistency across different environments and facilitating easier onboarding for new contributors. The changes aim to improve the reliability of agent execution and simplify the management of development infrastructure. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
|
Related Documentation 1 document(s) may need updating based on files changed in this PR: kalbasit's Space S3-Compatible Storage BackendView Suggested Changes@@ -211,6 +211,20 @@
The script auto-restarts on code changes and configures MinIO for local development. The S3 backend will use the MinIO instance at `localhost:9000` with default credentials (`minioadmin`/`minioadmin`). [Source](https://github.com/kalbasit/ncps/blob/b7653d4303670bb88fd34b8bf82ed3aade09885d/README.md#L46-L782)
+#### Container-Use Development Environment
+
+> **Note:** When using the container-use development workflow (e.g., with Claude Code agents), the docker-dev image comes pre-configured with S3 test environment variables.
+
+The `docker-dev` image (set up via `nix run .#update-cu-base`) includes these pre-configured S3 test environment variables:
+
+- `NCPS_TEST_S3_BUCKET=test-bucket`
+- `NCPS_TEST_S3_ENDPOINT=http://host.docker.internal:9000`
+- `NCPS_TEST_S3_REGION=us-east-1`
+- `NCPS_TEST_S3_ACCESS_KEY_ID=test-access-key`
+- `NCPS_TEST_S3_SECRET_ACCESS_KEY=test-secret-key`
+
+When using container-use environments, developers don't need to manually export these variables—they're already configured to work with `nix run .#deps` running on the Docker host. The `host.docker.internal` hostname resolves to the Docker host, allowing the container to access MinIO and other services (PostgreSQL, MariaDB, Redis) running via `nix run .#deps`.
+
### Kubernetes Development Environment (Kind)
You can also develop and test with MinIO running inside a local Kubernetes cluster using [Kind](https://kind.sigs.k8s.io/) and the provided setup script:
Note: You must be authenticated to accept/decline updates. |
There was a problem hiding this comment.
Code Review
This pull request introduces a new Nix-built Docker image for development (docker-dev) and a helper script (update-cu-base) to manage it, which is a great addition for creating a reproducible development environment. The changes also include refactoring shared packages to avoid duplication and updating documentation.
My review includes a high-severity security suggestion to remove the --insecure-policy flag from skopeo commands to ensure secure communication with Docker Hub, and a medium-severity suggestion to improve the robustness of the update script by ensuring temporary files are cleaned up.
…e support Add a Nix-built Docker image (docker-dev) for use as the container-use base image, enabling Claude Code agents to run in a fully reproducible dev environment with all required tools (go, golangci-lint, sqlc, sqlfluff, dbmate, delve, mariadb, minio, postgres, redis, skopeo, etc.) and pre-configured integration test environment variables. Extract shared dev packages into dev-packages.nix to avoid duplication between the devShell and the docker-dev image. Add the update-cu-base script that builds the image, pushes it to Docker Hub if not already present, and updates .container-use/environment.json atomically. Also add CLAUDE.md documentation for the container-use workflow and gitignore .container-use/environment.json (auto-generated, local state).
2abc3c2 to
d3ac1b1
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1097 +/- ##
=====================================
Coverage 5.04% 5.04%
=====================================
Files 6 6
Lines 436 436
=====================================
Hits 22 22
Misses 410 410
Partials 4 4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
## Summary The `[Unreleased]` section was populated in #1309 but skewed toward the recent CDC-drain, in-flight-staging, and Ent-migration work, omitting several user-facing features and fixes that also landed since v0.9.4. This backfills the missing notable changes, each cross-referenced by PR. **Added** - `ncps fsck` command + Helm fsck CronJob (#975, #996, #998, #999, #1000, #1004, #1006, #1176) - Closure pinning HTTP endpoints `POST`/`DELETE /pin/{hash}.narinfo`, `GET /pins` (#1108) - pprof server via `--pprof-addr` (#1063) - CDC lazy chunking as a feature + `--cache-cdc-lazy-cleanup-schedule` + recovery cron (#1082, #1083, #1089, #1096) - Helm: auto `GOMEMLIMIT` (#1061), configurable temp volume / `volumeClaimTemplate` (#1074, #1077), SQLite `Recreate` strategy (#1012) - Startup storage reporting + deprecated-narinfo warning (#959, #961) - `docker-dev` image (#1097) **Fixed** - `store/tmp` no longer wiped on startup (#1313) - `nix-hash` NAR verification (#1101) - Prometheus counters primed at startup (#1337, #1343) - 404 on un-reassemblable chunked NARs (#1319), purged narinfo no longer 500 (#1318), fail-fast tmp validation (#1086) - Further CDC/cache reliability fixes (#1317, #1346, #1341, #1342, #1331, #1347) **Changed** - CDC config now persisted in the DB config table (#971) Dependency bumps, CI/test-only changes, and the internal Ent-conversion PRs are intentionally excluded; the existing Ent-migration entry already covers that work. ## Test plan - [x] `nix fmt` reports no changes (docs-only edit) - [x] CHANGELOG section structure intact (Added/Fixed/Changed/Removed/Migration/CI)
Add a Nix-built Docker image (docker-dev) for use as the container-use
base image, enabling Claude Code agents to run in a fully reproducible
dev environment with all required tools (go, golangci-lint, sqlc,
sqlfluff, dbmate, delve, mariadb, minio, postgres, redis, skopeo, etc.)
and pre-configured integration test environment variables.
Extract shared dev packages into dev-packages.nix to avoid duplication
between the devShell and the docker-dev image. Add the update-cu-base
script that builds the image, pushes it to Docker Hub if not already
present, and updates .container-use/environment.json atomically.
Also add CLAUDE.md documentation for the container-use workflow and
gitignore .container-use/environment.json (auto-generated, local state).