Repository navigation
feat(deps): replace MinIO with Garage for dev/test S3 - #1240
Conversation
📝 WalkthroughSummary by CodeRabbitRelease Notes
WalkthroughThis pull request replaces MinIO with Garage as the S3-compatible backend across development, Nix/process-compose, Kubernetes integration tests, container/test credentials, startup/init scripts for Garage, and documentation/examples. ChangesMinIO to Garage S3 Backend Migration
Estimated Code Review Effort🎯 3 (Moderate) | ⏱️ ~25 minutes Suggested labels
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
Comment |
There was a problem hiding this comment.
Code Review
This pull request replaces MinIO with Garage as the S3-compatible storage backend for development and testing. The changes include updating Nix configurations, replacing MinIO-specific scripts with Garage equivalents, and adopting backend-neutral environment variables. Documentation and example configurations have been updated to reflect this transition. Feedback suggests moving Garage data and marker files from global "/tmp" directories to project-relative paths to prevent potential collisions on multi-user systems.
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
Related Knowledge 3 documents with suggested updates are ready for review. kalbasit's Space Cache and Storage Configuration FlagsView Suggested Changes@@ -94,7 +94,7 @@
**Note:** On some systems, the default `/tmp` directory may have limited space or be stored in memory (e.g., tmpfs on NixOS). In these cases, setting a custom temporary directory with sufficient disk space is recommended.
### S3 Storage
-Configure S3 storage using flags prefixed with `--cache-storage-s3-` (CLI) or under `cache.storage.s3` (YAML). Required options include the bucket name, endpoint (must include scheme, e.g., `https://s3.amazonaws.com` or `http://localhost:9000`), access key ID, and secret access key. The `force-path-style` option is required for MinIO and other S3-compatible services, and optional for AWS S3.
+Configure S3 storage using flags prefixed with `--cache-storage-s3-` (CLI) or under `cache.storage.s3` (YAML). Required options include the bucket name, endpoint (must include scheme, e.g., `https://s3.amazonaws.com` or `http://localhost:9000`), access key ID, and secret access key. The `force-path-style` option is required for Garage and other S3-compatible services, and optional for AWS S3.
**CLI Example:**
```
@@ -106,13 +106,13 @@
--cache-storage-s3-region us-east-1
```
-**MinIO Example:**
+**Garage Example:**
```
ncps serve \
--cache-storage-s3-bucket ncps-cache \
- --cache-storage-s3-endpoint http://minio.example.com:9000 \
- --cache-storage-s3-access-key-id minioadmin \
- --cache-storage-s3-secret-access-key minioadmin \
+ --cache-storage-s3-endpoint http://garage.example.com:3900 \
+ --cache-storage-s3-access-key-id GK1234567890abcdef1234567890abcdef1234567890abcdef \
+ --cache-storage-s3-secret-access-key 1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef \
--cache-storage-s3-force-path-style
```
@@ -129,15 +129,15 @@
force-path-style: false
```
-For MinIO and other S3-compatible services:
+For Garage and other S3-compatible services:
```yaml
cache:
storage:
s3:
bucket: "ncps-cache"
- endpoint: "http://minio.example.com:9000"
- access-key-id: "minioadmin"
- secret-access-key: "minioadmin"
+ endpoint: "http://garage.example.com:3900"
+ access-key-id: "GK1234567890abcdef1234567890abcdef1234567890abcdef"
+ secret-access-key: "1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"
force-path-style: true
```
@@ -478,7 +478,7 @@
** Required for S3 storage.
- The S3 endpoint must include a scheme (`http://` or `https://`).
-- Use `force-path-style` for MinIO and other S3-compatible services.
+- Use `force-path-style` for Garage and other S3-compatible services.
## Deprecation Warning Example
If you use the deprecated flag, you will see a warning similar to:✅ Accepted Development Environment with Garagerenamed from "Development Environment with MinIO"View Suggested Changes@@ -1,14 +1,17 @@
## Prerequisites
Ensure you have Nix and process-compose installed. The development environment uses Nix to manage dependencies and process orchestration.
-## MinIO Setup with process-compose
-MinIO is configured as a process in the process-compose module. It runs with an ephemeral data directory and exposes the S3 API on port 9000 and the console UI on port 9001. The configuration sets the following environment variables:
+## Garage Setup with process-compose
+Garage is configured as a process in the process-compose module. It runs with ephemeral data and metadata directories and exposes the S3 API on port 9000 and the admin API on port 3903. The configuration sets the following environment variables:
-- `MINIO_ROOT_USER=admin`
-- `MINIO_ROOT_PASSWORD=password`
-- `MINIO_REGION=us-east-1`
+- `NCPS_TEST_S3_ENDPOINT=http://127.0.0.1:9000`
+- `NCPS_TEST_S3_REGION=us-east-1`
+- `NCPS_TEST_S3_ACCESS_KEY_ID=GK1234567890abcdef12345678`
+- `NCPS_TEST_S3_SECRET_ACCESS_KEY=0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef`
+- `GARAGE_RPC_PORT=3901`
+- `GARAGE_ADMIN_PORT=3903`
-A readiness probe checks for the existence of a marker file (`/tmp/ncps-minio-ready`) before running dependent processes. This ensures that MinIO has been fully initialized by the setup script before other services start. Once MinIO is running, a dependent process executes an initialization script to set up buckets and credentials.
+A readiness probe checks for the existence of a marker file (`/tmp/ncps-garage-ready`) before running dependent processes. This ensures that Garage has been fully initialized by the setup script before other services start. Once Garage is running, a dependent process executes an initialization script to set up buckets and credentials.
[See process-compose configuration](https://github.com/kalbasit/ncps/blob/dc243d6/nix/process-compose/flake-module.nix)
The readiness probe is configured with:
@@ -16,15 +19,16 @@
- A check period of 1 second
- An exec command that tests for the marker file
-This approach improves reliability by ensuring services only start after MinIO is fully initialized.
+This approach improves reliability by ensuring services only start after Garage is fully initialized.
## Initialization Script and Test Bucket Creation
-The `init-minio.sh` script automates MinIO setup for local development. It performs the following actions:
+The `init-garage.sh` script automates Garage setup for local development. It performs the following actions:
-- Removes any stale marker file (`/tmp/ncps-minio-ready`) from previous runs at startup
-- Configures a MinIO client alias (`mc alias set local http://127.0.0.1:9000 admin password`)
+- Removes any stale marker file (`/tmp/ncps-garage-ready`) from previous runs at startup
+- Assigns a single-node layout (1GB capacity, zone `dc1`)
- Creates a test bucket named `test-bucket`
-- Adds a service account user `svcacct` with access key `test-access-key` and secret key `test-secret-key`
+- Imports the test access key (`GK1234567890abcdef12345678`) with its corresponding secret key
+- Grants the key read+write permissions on the test bucket
- Uploads a test file (`message.txt`) with the content `This is secret data!` to the test bucket
The script also runs verification checks:
@@ -33,9 +37,9 @@
- Verifies that public (anonymous) access is denied (expects HTTP 403)
- Generates a signed URL for the test file and verifies its content
-After successful initialization, the script creates the marker file (`/tmp/ncps-minio-ready`) to signal readiness for process-compose health checks.
+After successful initialization, the script creates the marker file (`/tmp/ncps-garage-ready`) to signal readiness for process-compose health checks.
-[See initialization script](https://github.com/kalbasit/ncps/blob/cf8e19f/nix/process-compose/init-minio.sh)
+[See initialization script](https://github.com/kalbasit/ncps/blob/cf8e19f/nix/process-compose/init-garage.sh)
# Database Migration Transaction Handling
**IMPORTANT:** Do NOT manually add `BEGIN`/`COMMIT` blocks to your migration files. The `goose` tool automatically wraps each migration in a transaction for atomicity. Adding manual transaction blocks will cause errors such as "cannot start a transaction within a transaction."
@@ -56,21 +60,14 @@
Letting goose manage transactions ensures that if any part of a migration fails, the entire migration is rolled back, preventing partial or inconsistent database states.
-## Running MinIO and Initialization
-Start MinIO and run the initialization process using:
+## Running Garage and Initialization
+Start Garage and run the initialization process using:
```sh
nix run .#deps
```
-This command launches MinIO and runs the initialization script automatically. Wait for the readiness probe to pass and the script to complete before starting services that depend on S3 storage.
-
-## Accessing the MinIO Console UI
-The MinIO web console is available at [http://127.0.0.1:9001](http://127.0.0.1:9001).
-Login credentials:
-
-- Username: `admin`
-- Password: `password`
+This command launches Garage and runs the initialization script automatically. Wait for the readiness probe to pass and the script to complete before starting services that depend on S3 storage.
## S3-Compatible Credentials and Endpoint
Use the following configuration for local S3 storage:
@@ -78,46 +75,48 @@
- Endpoint: `http://127.0.0.1:9000`
- Region: `us-east-1`
- Bucket: `test-bucket`
-- Access Key: `test-access-key`
-- Secret Key: `test-secret-key`
+- Access Key: `GK1234567890abcdef12345678`
+- Secret Key: `0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef`
- SSL: Disabled (`--cache-storage-s3-use-ssl=false`)
+The access key follows Garage's required format: it must start with `GK` followed by 24 hexadecimal characters. The secret key must be 64 hexadecimal characters.
+
## Verification Steps
-To verify your MinIO setup:
+To verify your Garage setup:
-1. Check MinIO health:
- Visit [http://127.0.0.1:9000/minio/health/live](http://127.0.0.1:9000/minio/health/live) (should return HTTP 200).
-2. List buckets and files using the MinIO client or AWS CLI with the provided credentials. For example:
+1. Check Garage health:
+ Visit [http://127.0.0.1:3903/health](http://127.0.0.1:3903/health) (should return HTTP 200).
+2. List buckets and files using the Garage CLI or AWS CLI with the provided credentials. For example:
```sh
- nix develop --command mc ls local/test-bucket
+ nix develop --command garage -c /tmp/ncps-garage.toml bucket list
```
3. Confirm the test file exists in `test-bucket` and contains the expected content.
4. Attempt anonymous access to the test file URL (should return HTTP 403).
5. Generate and use a signed URL to access the test file and verify its content.
-## Using MinIO for S3 Storage Testing
-To run the development server against MinIO, first ensure MinIO is running as described above. Then, use the provided script:
+## Using Garage for S3 Storage Testing
+To run the development server against Garage, first ensure Garage is running as described above. Then, use the provided script:
```sh
./dev-scripts/run.sh s3
```
-This command starts the server with S3-compatible storage, pointing to your local MinIO instance. The script passes all required credentials and endpoint information automatically, including the `--log-level` flag to control application logging. Temporary files are stored in `var/ncps/temp` (relative to the repository root) to avoid issues with small `/tmp` partitions that can occur on some systems.
+This command starts the server with S3-compatible storage, pointing to your local Garage instance. The script passes all required credentials and endpoint information automatically, including the `--log-level` flag to control application logging. Temporary files are stored in `var/ncps/temp` (relative to the repository root) to avoid issues with small `/tmp` partitions that can occur on some systems.
[See run script details](https://github.com/kalbasit/ncps/blob/b7653d4303670bb88fd34b8bf82ed3aade09885d/dev-scripts/run.sh#L6-L110)
## Troubleshooting Tips
- If you see database initialization errors, ensure the database migration step has completed and directory permissions are correct.
-- If MinIO is not reachable, confirm it is running and healthy at [http://127.0.0.1:9000/minio/health/live](http://127.0.0.1:9000/minio/health/live).
+- If Garage is not reachable, confirm it is running and healthy at [http://127.0.0.1:3903/health](http://127.0.0.1:3903/health).
- If you receive permission errors, verify that the access key and secret key match those configured in the initialization script.
- If the server exits immediately, check that all required parameters (bucket, endpoint, credentials, database URL) are provided.
- For anonymous access issues, ensure bucket policies are not set to public unless explicitly required.
## How This Supports S3 Storage Testing
-This setup allows you to test S3 storage functionality locally, using MinIO as a drop-in replacement for AWS S3. It enables rapid development and debugging of S3 integration, including credential handling, bucket operations, and signed URL workflows, without incurring cloud costs or requiring network access to AWS.
+This setup allows you to test S3 storage functionality locally, using Garage as a drop-in replacement for AWS S3. It enables rapid development and debugging of S3 integration, including credential handling, bucket operations, and signed URL workflows, without incurring cloud costs or requiring network access to AWS. Production behavior is unchanged - ncps continues to use the minio-go client library, which is a generic S3 client (the "minio" prefix refers to the maintainer, not a MinIO server dependency).
[See README S3 storage section](https://github.com/kalbasit/ncps/blob/b7653d4303670bb88fd34b8bf82ed3aade09885d/README.md#L46-L768)
# Integration Tests and Helper Commands
-Integration tests for S3 (MinIO), PostgreSQL, and MySQL/MariaDB are available and **disabled by default**. You can enable them using shell helper commands provided in the development environment. These helpers set the required environment variables for each backend, allowing you to run integration tests easily and consistently.
+Integration tests for S3 (Garage), PostgreSQL, and MySQL/MariaDB are available and **disabled by default**. You can enable them using shell helper commands provided in the development environment. These helpers set the required environment variables for each backend, allowing you to run integration tests easily and consistently.
**Enabling Integration Tests:**
@@ -134,7 +133,7 @@
eval "$(enable-all-integration-tests)"
# Or enable only specific tests:
-eval "$(enable-s3-tests)" # S3/MinIO only
+eval "$(enable-s3-tests)" # S3/Garage only
eval "$(enable-postgres-tests)" # PostgreSQL only
eval "$(enable-mysql-tests)" # MySQL/MariaDB only
@@ -166,7 +165,7 @@
**Helper Commands:**
-- `eval "$(enable-s3-tests)"` – Sets S3/MinIO test environment variables
+- `eval "$(enable-s3-tests)"` – Sets S3/Garage test environment variables
- `eval "$(enable-postgres-tests)"` – Sets PostgreSQL test environment variable
- `eval "$(enable-mysql-tests)"` – Sets MySQL/MariaDB test environment variable
- `eval "$(enable-all-integration-tests)"` – Enables all integration tests
@@ -176,6 +175,6 @@
**CI and Nix Builds:**
-When building with Nix or running CI, all integration test dependencies (MinIO, PostgreSQL, MariaDB) are started automatically, and the environment variables are set for you. This ensures comprehensive backend testing in all environments.
+When building with Nix or running CI, all integration test dependencies (Garage, PostgreSQL, MariaDB) are started automatically, and the environment variables are set for you. This ensures comprehensive backend testing in all environments.
For more details, see the project's CONTRIBUTING.md and CLAUDE.md.✅ Accepted S3-Compatible Storage BackendView Suggested Changes@@ -1,5 +1,5 @@
## S3-Compatible Storage Backend: Design & Implementation
-The S3-compatible storage backend for ncps provides a scalable, cloud-native alternative to local filesystem storage. It is implemented in the `pkg/storage/s3` package and is a drop-in replacement for local storage, supporting AWS S3, MinIO, and other S3-compatible services. The backend implements the same storage interface, allowing seamless integration and migration between storage types. [Source](https://github.com/kalbasit/ncps/blob/b7653d4303670bb88fd34b8bf82ed3aade09885d/pkg/storage/s3/README.md#L3-L183)
+The S3-compatible storage backend for ncps provides a scalable, cloud-native alternative to local filesystem storage. It is implemented in the `pkg/storage/s3` package and is a drop-in replacement for local storage, supporting AWS S3, Garage, and other S3-compatible services. The backend implements the same storage interface, allowing seamless integration and migration between storage types. [Source](https://github.com/kalbasit/ncps/blob/b7653d4303670bb88fd34b8bf82ed3aade09885d/pkg/storage/s3/README.md#L3-L183)
### ⚠️ File-Based Narinfo Storage Deprecation
@@ -32,7 +32,7 @@
| `--cache-storage-s3-endpoint` | `CACHE_STORAGE_S3_ENDPOINT` | Yes | S3 endpoint URL (e.g., `s3.amazonaws.com`, `localhost:9000`) |
| `--cache-storage-s3-access-key-id` | `CACHE_STORAGE_S3_ACCESS_KEY_ID` | Yes | S3 access key ID |
| `--cache-storage-s3-secret-access-key` | `CACHE_STORAGE_S3_SECRET_ACCESS_KEY` | Yes | S3 secret access key |
-| `--cache-storage-s3-region` | `CACHE_STORAGE_S3_REGION` | No | S3 region (required for AWS, optional for MinIO) |
+| `--cache-storage-s3-region` | `CACHE_STORAGE_S3_REGION` | No | S3 region (required for AWS, optional for self-hosted servers) |
| `--cache-storage-s3-use-ssl` | `CACHE_STORAGE_S3_USE_SSL` | No | Use SSL/TLS for S3 connection (`true`/`false`) |
| `--cache-storage-s3-prefix` | `CACHE_STORAGE_S3_PREFIX` | No | Object key prefix for data isolation (e.g., `test-environment-1/`) |
@@ -54,25 +54,27 @@
--upstream-public-key=cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
```
-#### Example: MinIO
+#### Example: Garage for Development
```bash
ncps serve \
--cache-hostname=ncps.example.com \
--cache-storage-s3-bucket=ncps-cache \
- --cache-storage-s3-endpoint=http://localhost:9000 \
- --cache-storage-s3-access-key-id=minioadmin \
- --cache-storage-s3-secret-access-key=minioadmin \
+ --cache-storage-s3-endpoint=http://localhost:3900 \
+ --cache-storage-s3-access-key-id=GK1234567890abcdef12345678 \
+ --cache-storage-s3-secret-access-key=0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef \
--cache-storage-s3-use-ssl=false \
--cache-database-url=sqlite:/var/lib/ncps/db.sqlite \
--upstream-cache=https://cache.nixos.org \
--upstream-public-key=cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
```
+> **Note:** ncps uses the `minio-go` client library for S3 operations, which is a generic S3 client library. The "minio" prefix refers to the library maintainer, not a dependency on MinIO server. Ncps has migrated its development and testing stack from MinIO to Garage (an AGPL-licensed, Rust-based S3-compatible server) after MinIO discontinued its FOSS community edition in favor of the commercial AIStor product.
+
### Supported Providers
-The backend supports AWS S3, MinIO, and any S3-compatible service (such as Ceph). Provider-specific notes:
+The backend supports AWS S3, Garage, and any S3-compatible service (such as Ceph). Provider-specific notes:
- **AWS S3**: Requires region and SSL; endpoint is typically `s3.<region>.amazonaws.com`.
-- **MinIO**: Region is optional; endpoint is usually `localhost:9000` for local development; SSL is optional.
+- **Garage**: Region is optional; endpoint is usually `localhost:3900` for local development; SSL is optional.
- **Other S3-Compatible**: Use the appropriate endpoint and credentials for your provider.
### Integration with the Storage Interface
@@ -87,9 +89,9 @@
ctx := context.Background()
cfg := s3.Config{
Bucket: "my-nix-cache",
- Endpoint: "localhost:9000",
- AccessKeyID: "minioadmin",
- SecretAccessKey: "minioadmin",
+ Endpoint: "localhost:3900",
+ AccessKeyID: "GK1234567890abcdef12345678",
+ SecretAccessKey: "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
UseSSL: false,
}
store, err := s3.New(ctx, cfg)
@@ -131,7 +133,7 @@
### Migration from Local Storage
To migrate from local storage to S3:
-1. Create an S3 bucket or MinIO instance.
+1. Create an S3 bucket or self-hosted S3 server instance (e.g., Garage).
2. Configure the S3 backend with credentials and endpoint.
3. Replace local storage initialization with S3 storage in your code or configuration.
4. The rest of your application code remains unchanged.
@@ -168,13 +170,13 @@
store, err := s3.New(ctx, cfg)
```
-#### MinIO (Go)
+#### Garage (Go)
```go
cfg := s3.Config{
Bucket: "my-nix-cache",
- Endpoint: "localhost:9000",
- AccessKeyID: "minioadmin",
- SecretAccessKey: "minioadmin",
+ Endpoint: "localhost:3900",
+ AccessKeyID: "GK1234567890abcdef12345678",
+ SecretAccessKey: "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
UseSSL: false,
}
store, err := s3.New(ctx, cfg)
@@ -194,13 +196,13 @@
```
[Source](https://github.com/kalbasit/ncps/blob/b7653d4303670bb88fd34b8bf82ed3aade09885d/pkg/storage/s3/example.go#L16-L81)
-### Development Setup with MinIO
-To develop and test with MinIO:
-
-1. Start MinIO locally (the dev script manages this for you):
-
- ```bash
- nix run .#deps # Starts MinIO with self-validation
+### Development Setup with Garage
+To develop and test with Garage:
+
+1. Start Garage locally (the dev script manages this for you):
+
+ ```bash
+ nix run .#deps # Starts Garage with self-validation
```
2. Run the development server with the S3 backend:
@@ -209,7 +211,7 @@
./dev-scripts/run.sh s3
```
-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)
+The script auto-restarts on code changes and configures Garage for local development. The S3 backend will use the Garage instance at `localhost:9000` (S3 API port) with test credentials (`GK1234567890abcdef12345678` / 64-character hex secret key). Garage also runs an admin API on port 3903. [Source](https://github.com/kalbasit/ncps/blob/b7653d4303670bb88fd34b8bf82ed3aade09885d/README.md#L46-L782)
#### Container-Use Development Environment
@@ -220,13 +222,13 @@
- `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`.
+- `NCPS_TEST_S3_ACCESS_KEY_ID=GK1234567890abcdef12345678`
+- `NCPS_TEST_S3_SECRET_ACCESS_KEY=0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef`
+
+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 Garage 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:
+You can also develop and test with Garage running inside a local Kubernetes cluster using [Kind](https://kind.sigs.k8s.io/) and the provided setup script:
1. Start the Kubernetes development environment:
@@ -236,24 +238,24 @@
This script will:
- Create a Kind cluster (if not already running)
- - Deploy MinIO with a pre-created bucket (`ncps-bucket`) and access keys
+ - Deploy Garage with a pre-created bucket (`ncps-bucket`) and access keys
- Deploy PostgreSQL, MariaDB, and Redis instances
- Output connection details for all services
-2. To access MinIO from your host, port-forward the service:
-
- ```bash
- kubectl port-forward -n minio svc/minio 9000:9000
+2. To access Garage from your host, port-forward the service:
+
+ ```bash
+ kubectl port-forward -n garage svc/garage 3900:3900
```
3. Use the following credentials and endpoint for your S3 backend configuration:
| Option | Value |
|--------------|-------------------|
- | Endpoint | http://localhost:9000 |
+ | Endpoint | http://localhost:3900 |
| Bucket | ncps-bucket |
- | Access Key | ncps-access-key |
- | Secret Key | ncps-secret-key |
+ | Access Key | GK1234567890abcdef12345678 |
+ | Secret Key | 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef |
| Use SSL | false |
Example CLI usage:
@@ -261,13 +263,13 @@
```bash
ncps serve \
--cache-storage-s3-bucket=ncps-bucket \
- --cache-storage-s3-endpoint=http://localhost:9000 \
- --cache-storage-s3-access-key-id=ncps-access-key \
- --cache-storage-s3-secret-access-key=ncps-secret-key \
+ --cache-storage-s3-endpoint=http://localhost:3900 \
+ --cache-storage-s3-access-key-id=GK1234567890abcdef12345678 \
+ --cache-storage-s3-secret-access-key=0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef \
--cache-storage-s3-use-ssl=false
```
-The script ensures MinIO is ready and pre-configured for development, so you do not need to manually create buckets or credentials. This environment is ideal for testing NCPS against S3-compatible storage and database backends in a reproducible local cluster.
+The script ensures Garage is ready and pre-configured for development, so you do not need to manually create buckets or credentials. This environment is ideal for testing NCPS against S3-compatible storage and database backends in a reproducible local cluster.
### Security Considerations
Store credentials securely (prefer environment variables or IAM roles for AWS). Use SSL/TLS in production. For AWS, restrict access with IAM policies and consider temporary credentials. Enable bucket versioning and set appropriate bucket policies for access control. [Source](https://github.com/kalbasit/ncps/blob/b7653d4303670bb88fd34b8bf82ed3aade09885d/pkg/storage/s3/README.md#L3-L183)✅ Accepted |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1240 +/- ##
=====================================
Coverage 5.68% 5.68%
=====================================
Files 6 6
Lines 387 387
=====================================
Hits 22 22
Misses 361 361
Partials 4 4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 6
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/docs/Developer` Guide.md:
- Line 59: Update the documented Garage S3 API port to match the migration
context by replacing the snippet "**Garage** (S3 API on port 9000)" with the
standardized port used in the migration (e.g., "**Garage** (S3 API on port
3900)" or the 3900/3903 variant used by your local setup), ensuring the
Developer Guide's Garage S3 API port matches the migration configuration
references.
In `@docs/docs/Developer` Guide/Architecture/Storage Backends/S3 Storage
Implementation.md:
- Line 51: The example S3 endpoint line currently uses "http://localhost:9000"
which is inconsistent with Garage's documented S3 API port; update the literal
Endpoint value to "http://localhost:3900" (keeping the scheme) in the S3 Storage
Implementation example so it matches the Garage dev/test port; locate the line
containing the string "Endpoint:" or the exact snippet 'Endpoint:
"http://localhost:9000"' and replace the port number to 3900.
In `@docs/docs/User` Guide/Configuration/Reference.md:
- Around line 116-118: Update the S3 credential placeholder in the docs so the
secret key flag --cache-storage-s3-secret-access-key uses a secret-key
placeholder (e.g., "your-secret-key") instead of duplicating the access key;
edit the example lines containing --cache-storage-s3-access-key-id and
--cache-storage-s3-secret-access-key to ensure the latter is clearly a secret
value and matches the intended placeholders for self-hosted S3.
In `@docs/docs/User` Guide/Configuration/Storage/S3-Compatible Storage.md:
- Around line 54-61: The markdown fenced code blocks that show the ncps serve
command and the Garage CLI commands are missing language identifiers and trigger
markdownlint MD040; update both fences surrounding the "ncps serve \ ..." block
and the subsequent "garage ..." block to include a language tag (e.g., bash) so
they read ```bash and ```bash respectively, leaving the code inside unchanged to
satisfy the linter.
In `@docs/docs/User` Guide/Deployment/High Availability.md:
- Around line 152-171: The fenced shell snippet in the High Availability doc is
missing a language tag and triggers markdownlint MD040; update the opening fence
from ``` to ```bash for the block containing the garage docker and docker exec
commands so the block is recognized as bash/sh (modify the fenced block around
the Start Garage / Bootstrap layout lines in High Availability.md).
In `@nix/packages/docker-dev.nix`:
- Around line 84-85: The NCPS_TEST_S3_ENDPOINT env var in docker-dev.nix still
points to the old MinIO port (host.docker.internal:9000); update
NCPS_TEST_S3_ENDPOINT to the Garage S3 port (host.docker.internal:3900) so it
matches the new Garage credentials (see the nearby NCPS_TEST_S3_ACCESS_KEY_ID
and NCPS_TEST_S3_SECRET_ACCESS_KEY entries). Keep the existing URL format
(include http:// if present) and ensure the change is made alongside those env
vars so the container targets the correct Garage S3 endpoint.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 95a018fc-ca8f-4aa8-b714-c76a1bc2ce87
📒 Files selected for processing (59)
.agent/skills/ncps/SKILL.md.claude/settings.jsonCLAUDE.mdREADME.mdcharts/ncps/tests/configmap_test.yamlcharts/ncps/values.yamlconfig.example.yamldev-scripts/run.pydev-scripts/verify-data.pydocs/docs/Developer Guide.mddocs/docs/Developer Guide/Architecture/Storage Backends.mddocs/docs/Developer Guide/Architecture/Storage Backends/S3 Storage Implementation.mddocs/docs/Developer Guide/Contributing.mddocs/docs/Developer Guide/Testing.mddocs/docs/User Guide/Configuration.mddocs/docs/User Guide/Configuration/Reference.mddocs/docs/User Guide/Configuration/Storage.mddocs/docs/User Guide/Configuration/Storage/S3-Compatible Storage.mddocs/docs/User Guide/Deployment.mddocs/docs/User Guide/Deployment/Distributed Locking.mddocs/docs/User Guide/Deployment/High Availability.mddocs/docs/User Guide/Deployment/Single Instance.mddocs/docs/User Guide/Getting Started/Concepts.mddocs/docs/User Guide/Installation.mddocs/docs/User Guide/Installation/Docker Compose.mddocs/docs/User Guide/Installation/Docker.mddocs/docs/User Guide/Installation/Helm Chart.mddocs/docs/User Guide/Installation/Helm Chart/Chart Reference.mddocs/docs/User Guide/Installation/Kubernetes.mdnix/dev-packages.nixnix/devshells/flake-module.nixnix/k8s-tests/README.mdnix/k8s-tests/src/k8s_tests.pynix/k8s-tests/src/k8s_tests_tester.pynix/packages/docker-dev.nixnix/packages/ncps/default.nixnix/packages/ncps/post-check-garage.shnix/packages/ncps/post-check-minio.shnix/packages/ncps/pre-check-garage.shnix/packages/ncps/pre-check-minio.shnix/process-compose/flake-module.nixnix/process-compose/init-garage.shnix/process-compose/init-minio.shnix/process-compose/start-garage.shnix/process-compose/start-minio.shopenspec/changes/archive/2026-05-22-swap-minio-with-garage/.openspec.yamlopenspec/changes/archive/2026-05-22-swap-minio-with-garage/design.mdopenspec/changes/archive/2026-05-22-swap-minio-with-garage/proposal.mdopenspec/changes/archive/2026-05-22-swap-minio-with-garage/specs/dev-s3-backend/spec.mdopenspec/changes/archive/2026-05-22-swap-minio-with-garage/tasks.mdopenspec/specs/dev-s3-backend/spec.mdpkg/ncps/serve.gopkg/s3/config.gopkg/storage/chunk/export_test.gopkg/storage/chunk/s3.gopkg/storage/s3/example.gopkg/storage/s3/export_test.gopkg/storage/s3/s3.gopkg/storage/s3/s3_test.go
💤 Files with no reviewable changes (4)
- nix/process-compose/start-minio.sh
- nix/packages/ncps/post-check-minio.sh
- nix/packages/ncps/pre-check-minio.sh
- nix/process-compose/init-minio.sh
MinIO has gutted its FOSS community edition in favor of the commercial AIStor product, breaking long-standing dev workflows. Replace the entire dev/test S3 stack with Garage (AGPL, Rust, single-binary, no separate console). Production behavior is unchanged - ncps still talks generic S3 v4 via the minio-go client library, which is kept as it is a generic S3 client whose minio prefix refers to the maintainer, not a MinIO server dependency. Process-compose: new start-garage.sh / init-garage.sh boot a single-node layout, create bucket + access key, run a put/get/presign smoke test, and assert anonymous access is blocked. Env vars renamed from MINIO_TEST_S3_* to backend-neutral NCPS_TEST_S3_* (Go tests already read these names). Test creds switched to Garage required GK<24-hex> AKID + 64-hex secret format. Nix package preCheck/postCheck rewritten for Garage; dev shell drops pkgs.minio / pkgs.minio-client in favor of pkgs.garage + pkgs.awscli2. K8s integration tests deploy Garage via raw manifests (no first-party Helm chart needed). Bootstrap runs as individual kubectl exec /garage <cmd> calls because the dxflrs/garage image is distroless. StatefulSet sets command: [/garage] explicitly since the image has CMD but no ENTRYPOINT. Switched the readiness wait from kubectl wait to kubectl rollout status to avoid the controller-pod-creation race. Docs swept: CLAUDE.md, README, all User/Developer Guide pages, charts/ncps/values.yaml, config.example.yaml, and the SKILL.md now reference Garage. Docker Compose + Helm chart + HA examples rewritten to use Garage (image dxflrs/garage:v1.0.1, ports 3900/3903). Dev container image rebuilt and pushed; .container-use/environment.json updated to kalbasit/ncps-dev:5q2vmh0s2hpxvskcjks6yid4lwy3im86. OpenSpec change swap-minio-with-garage archived. New capability spec dev-s3-backend added under openspec/specs/. Co-Authored-By: Claude Opus 4.7 <[email protected]>
Hardcoded /tmp/ncps-garage-{data,meta,config,ready} paths collide
between users sharing a host: the first user to start the dev deps
owns the dirs and subsequent users hit permission errors.
Switch to the same pattern start-postgres.sh / start-mysql.sh /
start-redis.sh use: mktemp -d per run, removed on shutdown via an EXIT
trap. The Garage-specific twist is that init-garage runs as a separate
process and needs the same config file path the server is using, so
start-garage writes the workdir path to a per-UID pointer file
(${TMPDIR}/ncps-garage-<uid>.workdir) that init-garage reads. Both the
workdir and the pointer file are removed on shutdown.
The ready marker also moves to a per-UID path
(${TMPDIR}/ncps-garage-<uid>.ready) and is cleaned up on shutdown.
pre-check-garage.sh drops its now-unused GARAGE_{META,DATA,CONFIG}_*
exports — the build sandbox already isolates /tmp per build, but the
script can rely on start-garage.sh 's mktemp behavior either way.
Addresses gemini-code-assist review threads PRRT_kwDONV6tZs6ERVD3 and
PRRT_kwDONV6tZs6ERVD4.
Co-Authored-By: Claude Opus 4.7 <[email protected]>
The Garage / self-hosted S3 example in Configuration/Reference.md set --cache-storage-s3-secret-access-key to the access-key placeholder (your-access-key) instead of the secret-key placeholder (your-secret-key) — leftover from a bulk sed pass. Anyone copy/pasting the example would have hit S3 auth failures. Addresses coderabbitai review thread PRRT_kwDONV6tZs6ERW2L. Co-Authored-By: Claude Opus 4.7 <[email protected]>
The Garage / self-hosted S3 example fences in Configuration/Storage/S3-Compatible Storage.md (AWS example, Garage example, Garage bucket-setup) and the Garage docker-run snippet in Deployment/High Availability.md were emitted as bare \`\`\` blocks, which fails markdownlint MD040 (fenced-code-language). Tag each one \`\`\`bash so docs lint cleanly without changing behavior. Addresses coderabbitai review threads PRRT_kwDONV6tZs6ERW2M and PRRT_kwDONV6tZs6ERW2N. Co-Authored-By: Claude Opus 4.7 <[email protected]>
The user-facing S3 storage example in the Storage Backends architecture doc used http://localhost:9000 (MinIO's historical default and the port our dev process-compose keeps for test-contract reasons). For a generic user-facing example, Garage's natural default port 3900 is clearer — readers following Garage's own docs to set up a server will land on 3900 by default. Addresses coderabbitai review thread PRRT_kwDONV6tZs6ERW2K. Co-Authored-By: Claude Opus 4.7 <[email protected]>
Reviewers flagged port 9000 in the Developer Guide as inconsistent with Garage's upstream default of 3900 (which the k8s tests + Docker Compose examples use). The dev process-compose intentionally keeps 9000 to preserve the existing test-contract endpoint inherited from MinIO. Note that next to the port so future readers don't bounce on the same confusion. Co-Authored-By: Claude Opus 4.7 <[email protected]>
3a012f0 to
b9995ac
Compare
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (2)
nix/packages/ncps/pre-check-garage.sh (1)
27-27: ⚡ Quick winHarden script-path invocation with explicit
srcvalidation and quoting.Both calls rely on
$srcimplicitly and unquoted; add an upfront required-var check and quote path expansions for safer execution.Proposed patch
+# Ensure Nix-provided source root is available. +: "${src:?expected Nix variable 'src' to be set}" + # Start Garage server in background. -bash $src/nix/process-compose/start-garage.sh >"$NIX_BUILD_TOP/garage.log" 2>&1 & +bash "$src/nix/process-compose/start-garage.sh" >"$NIX_BUILD_TOP/garage.log" 2>&1 & export GARAGE_PID=$! @@ # Bootstrap layout, bucket, key, and run the smoke test. -bash $src/nix/process-compose/init-garage.sh +bash "$src/nix/process-compose/init-garage.sh"Also applies to: 47-47
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@nix/packages/ncps/pre-check-garage.sh` at line 27, Ensure the script validates and quotes the source path before invoking the helper: add an upfront check that the variable src is set and non-empty (e.g., fail with a clear error message if not) and then quote expansions when calling start-garage.sh and any other helper (replace unquoted $src/nix/process-compose/start-garage.sh with a quoted "$src/nix/process-compose/start-garage.sh"); apply the same validation/quoting for the second invocation referenced at the other occurrence so both calls are hardened.nix/packages/ncps/post-check-garage.sh (1)
3-3: ⚡ Quick winQuote PID expansions in
killcalls for shell safety.Use quoted expansions consistently to avoid accidental word-splitting/globbing hazards.
Proposed patch
- kill $GARAGE_PID 2>/dev/null || true + kill "$GARAGE_PID" 2>/dev/null || true @@ - if ! kill -0 $GARAGE_PID 2>/dev/null; then + if ! kill -0 "$GARAGE_PID" 2>/dev/null; then @@ - if kill -0 $GARAGE_PID 2>/dev/null; then + if kill -0 "$GARAGE_PID" 2>/dev/null; then @@ - kill -9 $GARAGE_PID 2>/dev/null || true + kill -9 "$GARAGE_PID" 2>/dev/null || trueAlso applies to: 6-6, 13-13, 15-15
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@nix/packages/ncps/post-check-garage.sh` at line 3, The kill invocations use unquoted PID expansions which can lead to word-splitting or globbing; update every kill that references GARAGE_PID (and any other PID variables on lines noted) to use a quoted expansion (i.e., quote the variable in the kill calls) and preserve the redirection and fallback (2>/dev/null || true) so the behavior stays the same while preventing shell-safety issues.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/docs/User` Guide/Installation/Docker Compose.md:
- Line 145: The healthcheck for the garage service uses a literal test array
calling wget (the `test: ["CMD", "wget", "-qO-",
"http://localhost:3903/health"]`) which fails if wget is missing and blocks
garage-bootstrap; replace it with a shell-based healthcheck that tries a
portable client fallback (e.g. use `CMD-SHELL` to try curl then wget and exit 1
if neither succeeds) so the garage service can become healthy regardless of
which tool is present; update the garage service healthcheck entry accordingly
and keep garage-bootstrap's dependency on service_healthy intact.
In `@nix/process-compose/flake-module.nix`:
- Around line 87-89: The startup sequence currently runs mkdir -p
"$GARAGE_DATA_DIR" "$GARAGE_META_DIR" before those variables are derived in
garageEnvironment (they’re created by start-garage.sh / init-garage.sh), which
risks dereferencing unset vars; remove that pre-step from the block that calls
exec ${startGarage}/bin/start-garage, or alternatively derive sensible defaults
for GARAGE_DATA_DIR and GARAGE_META_DIR inside this module (set the variables in
garageEnvironment) so the mkdir does not reference undefined names; ensure the
code uses ${startGarage}/bin/start-garage and lets start-garage.sh /
init-garage.sh create the directories if you opt to remove the mkdir.
In `@nix/process-compose/init-garage.sh`:
- Around line 131-136: The script currently prints the S3 secret in plaintext
(echo " Secret Key: $NCPS_TEST_S3_SECRET_ACCESS_KEY"); replace that line so
the secret is not logged—either omit the variable entirely or print a
redacted/masked placeholder (e.g. "Secret Key: [REDACTED]" or mask all but last
4 chars) and keep the other echo lines unchanged; update the line referencing
NCPS_TEST_S3_SECRET_ACCESS_KEY in init-garage.sh accordingly and ensure no other
echo/printf in the script prints that environment variable.
In `@openspec/changes/archive/2026-05-22-swap-minio-with-garage/design.md`:
- Around line 70-73: Update section D6 to reflect the actual Garage credential
format used by the implementation: replace the stale literals `test-access-key`
/ `test-secret-key` with the Garage-compatible key ID and secret string format
that your code generates/accepts (the values created during key-creation), and
ensure the note about `test-bucket` and the env var rename matches the
implemented names; specifically edit the D6 paragraph that currently references
`test-access-key` / `test-secret-key`, so it documents the real key ID/secret
pattern and any example values or env var names used by the Garage integration.
---
Nitpick comments:
In `@nix/packages/ncps/post-check-garage.sh`:
- Line 3: The kill invocations use unquoted PID expansions which can lead to
word-splitting or globbing; update every kill that references GARAGE_PID (and
any other PID variables on lines noted) to use a quoted expansion (i.e., quote
the variable in the kill calls) and preserve the redirection and fallback
(2>/dev/null || true) so the behavior stays the same while preventing
shell-safety issues.
In `@nix/packages/ncps/pre-check-garage.sh`:
- Line 27: Ensure the script validates and quotes the source path before
invoking the helper: add an upfront check that the variable src is set and
non-empty (e.g., fail with a clear error message if not) and then quote
expansions when calling start-garage.sh and any other helper (replace unquoted
$src/nix/process-compose/start-garage.sh with a quoted
"$src/nix/process-compose/start-garage.sh"); apply the same validation/quoting
for the second invocation referenced at the other occurrence so both calls are
hardened.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 8b916653-10b3-480b-b500-f0d399d9a314
📒 Files selected for processing (59)
.agent/skills/ncps/SKILL.md.claude/settings.jsonCLAUDE.mdREADME.mdcharts/ncps/tests/configmap_test.yamlcharts/ncps/values.yamlconfig.example.yamldev-scripts/run.pydev-scripts/verify-data.pydocs/docs/Developer Guide.mddocs/docs/Developer Guide/Architecture/Storage Backends.mddocs/docs/Developer Guide/Architecture/Storage Backends/S3 Storage Implementation.mddocs/docs/Developer Guide/Contributing.mddocs/docs/Developer Guide/Testing.mddocs/docs/User Guide/Configuration.mddocs/docs/User Guide/Configuration/Reference.mddocs/docs/User Guide/Configuration/Storage.mddocs/docs/User Guide/Configuration/Storage/S3-Compatible Storage.mddocs/docs/User Guide/Deployment.mddocs/docs/User Guide/Deployment/Distributed Locking.mddocs/docs/User Guide/Deployment/High Availability.mddocs/docs/User Guide/Deployment/Single Instance.mddocs/docs/User Guide/Getting Started/Concepts.mddocs/docs/User Guide/Installation.mddocs/docs/User Guide/Installation/Docker Compose.mddocs/docs/User Guide/Installation/Docker.mddocs/docs/User Guide/Installation/Helm Chart.mddocs/docs/User Guide/Installation/Helm Chart/Chart Reference.mddocs/docs/User Guide/Installation/Kubernetes.mdnix/dev-packages.nixnix/devshells/flake-module.nixnix/k8s-tests/README.mdnix/k8s-tests/src/k8s_tests.pynix/k8s-tests/src/k8s_tests_tester.pynix/packages/docker-dev.nixnix/packages/ncps/default.nixnix/packages/ncps/post-check-garage.shnix/packages/ncps/post-check-minio.shnix/packages/ncps/pre-check-garage.shnix/packages/ncps/pre-check-minio.shnix/process-compose/flake-module.nixnix/process-compose/init-garage.shnix/process-compose/init-minio.shnix/process-compose/start-garage.shnix/process-compose/start-minio.shopenspec/changes/archive/2026-05-22-swap-minio-with-garage/.openspec.yamlopenspec/changes/archive/2026-05-22-swap-minio-with-garage/design.mdopenspec/changes/archive/2026-05-22-swap-minio-with-garage/proposal.mdopenspec/changes/archive/2026-05-22-swap-minio-with-garage/specs/dev-s3-backend/spec.mdopenspec/changes/archive/2026-05-22-swap-minio-with-garage/tasks.mdopenspec/specs/dev-s3-backend/spec.mdpkg/ncps/serve.gopkg/s3/config.gopkg/storage/chunk/export_test.gopkg/storage/chunk/s3.gopkg/storage/s3/example.gopkg/storage/s3/export_test.gopkg/storage/s3/s3.gopkg/storage/s3/s3_test.go
💤 Files with no reviewable changes (4)
- nix/packages/ncps/post-check-minio.sh
- nix/packages/ncps/pre-check-minio.sh
- nix/process-compose/start-minio.sh
- nix/process-compose/init-minio.sh
✅ Files skipped from review due to trivial changes (26)
- pkg/storage/s3/export_test.go
- openspec/changes/archive/2026-05-22-swap-minio-with-garage/.openspec.yaml
- docs/docs/User Guide/Deployment.md
- pkg/storage/s3/s3_test.go
- docs/docs/User Guide/Getting Started/Concepts.md
- docs/docs/User Guide/Configuration.md
- docs/docs/User Guide/Installation.md
- docs/docs/User Guide/Deployment/Distributed Locking.md
- docs/docs/User Guide/Configuration/Storage.md
- docs/docs/User Guide/Installation/Helm Chart.md
- charts/ncps/values.yaml
- pkg/s3/config.go
- .claude/settings.json
- pkg/storage/chunk/export_test.go
- config.example.yaml
- docs/docs/User Guide/Configuration/Reference.md
- docs/docs/Developer Guide/Testing.md
- docs/docs/User Guide/Installation/Docker.md
- dev-scripts/verify-data.py
- docs/docs/Developer Guide/Architecture/Storage Backends.md
- pkg/ncps/serve.go
- docs/docs/User Guide/Installation/Kubernetes.md
- docs/docs/Developer Guide/Contributing.md
- docs/docs/User Guide/Deployment/High Availability.md
- pkg/storage/s3/s3.go
- openspec/changes/archive/2026-05-22-swap-minio-with-garage/tasks.md
Printing NCPS_TEST_S3_SECRET_ACCESS_KEY in plaintext leaks the credential into process-compose logs and any CI output capture. Replace with [redacted] — the value is already exported into the environment for tools that need it. Addresses PR #1240 (PRRT_kwDONV6tZs6ERepp). Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
- Remove release-* from ci.yml triggers (PR #1235 PRRT_kwDONV6tZs6EVXg7): CLAUDE.md mandates main-only CI to keep stacked-PR workflows efficient. - Pin stefanzweifel/git-auto-commit-action to commit SHA 04702edda… (v7) (PR #1223 PRRT_kwDONV6tZs6EUFjb): prevents supply-chain mutation via mutable tag. - Add go.mod/go.sum to ent paths-filter (PR #1235 PRRT_kwDONV6tZs6EVXhI): Ent version bumps also require codegen re-run. - Update tasks.md 13.6 (PR #1223 PRRT_kwDONV6tZs6EUFjd): remove stale "no edits expected" note. - Replace wget healthcheck with /garage status (PR #1240 PRRT_kwDONV6tZs6EReph): wget absent in distroless image. - Remove mkdir -p with undefined vars (PR #1240 PRRT_kwDONV6tZs6ERepn): start-garage.sh already creates the dirs after deriving GARAGE_DATA_DIR/META_DIR. - Update D6 credential format (PR #1240 PRRT_kwDONV6tZs6ERepq): reflect actual GK-prefix key ID and 64-char hex secret used in implementation. - Fix profile-tests.sh to .py in design.md (PR #1246 PRRT_kwDONV6tZs6EViwJ): profiler is Python, not shell. - Remove redundant "when run locally" in spec.md (PR #1246 PRRT_kwDONV6tZs6EViwK): scenario heading already scopes to local execution. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
MinIO has gutted its FOSS community edition in favor of the commercial
AIStor product, breaking long-standing dev workflows. Replace the entire
dev/test S3 stack with Garage (AGPL, Rust, single-binary, no separate
console). Production behavior is unchanged - ncps still talks generic
S3 v4 via the minio-go client library, which is kept as it is a
generic S3 client whose minio prefix refers to the maintainer, not a
MinIO server dependency.
Process-compose: new start-garage.sh / init-garage.sh boot a
single-node layout, create bucket + access key, run a put/get/presign
smoke test, and assert anonymous access is blocked. Env vars renamed
from MINIO_TEST_S3_* to backend-neutral NCPS_TEST_S3_* (Go tests
already read these names). Test creds switched to Garage required
GK<24-hex> AKID + 64-hex secret format.
Nix package preCheck/postCheck rewritten for Garage; dev shell drops
pkgs.minio / pkgs.minio-client in favor of pkgs.garage + pkgs.awscli2.
K8s integration tests deploy Garage via raw manifests (no first-party
Helm chart needed). Bootstrap runs as individual kubectl exec
/garage calls because the dxflrs/garage image is distroless.
StatefulSet sets command: [/garage] explicitly since the image has
CMD but no ENTRYPOINT. Switched the readiness wait from kubectl wait
to kubectl rollout status to avoid the controller-pod-creation race.
Docs swept: CLAUDE.md, README, all User/Developer Guide pages,
charts/ncps/values.yaml, config.example.yaml, and the SKILL.md now
reference Garage. Docker Compose + Helm chart + HA examples rewritten
to use Garage (image dxflrs/garage:v1.0.1, ports 3900/3903).
Dev container image rebuilt and pushed; .container-use/environment.json
updated to kalbasit/ncps-dev:5q2vmh0s2hpxvskcjks6yid4lwy3im86.
OpenSpec change swap-minio-with-garage archived. New capability spec
dev-s3-backend added under openspec/specs/.