|
| 1 | +`rattler-index` is a rattler-based tool which allows you to index your channels. |
| 2 | +It can create `repodata.json`, `repodata.json.zst` as well as sharded repodata ([CEP 16](https://github.com/conda/ceps/blob/main/cep-0016.md)). |
| 3 | +It can index both conda channels on a local file system as well as conda channels on S3. |
| 4 | + |
| 5 | +## Installation |
| 6 | + |
| 7 | +You can install `rattler-index` using pixi: |
| 8 | + |
| 9 | +```bash |
| 10 | +pixi global install rattler-index |
| 11 | +``` |
| 12 | + |
| 13 | +## Usage |
| 14 | + |
| 15 | +`rattler-index` has two subcommands for indexing channels on different storage backends: |
| 16 | + |
| 17 | +### Indexing a local filesystem channel |
| 18 | + |
| 19 | +```bash |
| 20 | +rattler-index fs /path/to/channel |
| 21 | +``` |
| 22 | + |
| 23 | +### Indexing an S3 channel |
| 24 | + |
| 25 | +```bash |
| 26 | +rattler-index s3 s3://my-bucket/my-channel |
| 27 | +``` |
| 28 | + |
| 29 | +For S3 channels, you can provide credentials via command-line options or they will be resolved from the AWS SDK (environment variables, AWS config files, etc.). |
| 30 | + |
| 31 | +## Global Options |
| 32 | + |
| 33 | +| Option | Default | Description | |
| 34 | +|--------|---------|-------------| |
| 35 | +| `--write-zst` | `true` | Write compressed `repodata.json.zst` files | |
| 36 | +| `--write-shards` | `true` | Write sharded repodata ([CEP 16](https://github.com/conda/ceps/blob/main/cep-0016.md)) | |
| 37 | +| `-f, --force` | `false` | Force re-indexing of all packages, creating a new `repodata.json` instead of updating the existing one | |
| 38 | +| `--max-parallel <N>` | 10 | Maximum number of packages to process in-memory simultaneously. Useful for limiting memory usage when indexing large channels | |
| 39 | +| `--target-platform <PLATFORM>` | all | Index only a specific platform (e.g., `linux-64`, `osx-arm64`). By default, all platforms in the channel are indexed | |
| 40 | +| `--repodata-patch <PACKAGE>` | none | Name of a conda package (in the `noarch` subdir) to use for repodata patching. See [repodata patching](https://prefix.dev/blog/repodata_patching) for more information | |
| 41 | +| `--config <PATH>` | none | Path to a config file (uses the same format as [pixi configuration](https://pixi.sh/latest/reference/pixi_configuration)) | |
| 42 | +| `-v, -vv, -vvv` | none | Increase verbosity level | |
| 43 | + |
| 44 | +### S3-specific Options |
| 45 | + |
| 46 | +| Option | Description | |
| 47 | +|--------|-------------| |
| 48 | +| `--disable-precondition-checks` | Disable ETag and timestamp checks during file operations. Use if your S3 backend doesn't fully support conditional requests, or if you're certain no concurrent indexing processes are running. **Warning:** Disabling this removes protection against concurrent modifications | |
| 49 | +| `--region <REGION>` | AWS region for the S3 bucket | |
| 50 | +| `--endpoint-url <URL>` | Custom S3 endpoint URL (for S3-compatible storage like MinIO) | |
| 51 | + |
| 52 | +S3 credentials can also be configured in the config file under the `s3_options` section. |
| 53 | + |
| 54 | +## Examples |
| 55 | + |
| 56 | +Index a local channel with default settings: |
| 57 | +```bash |
| 58 | +rattler-index fs ./my-channel |
| 59 | +``` |
| 60 | + |
| 61 | +Index only the `linux-64` platform: |
| 62 | +```bash |
| 63 | +rattler-index fs ./my-channel --target-platform linux-64 |
| 64 | +``` |
| 65 | + |
| 66 | +Force a full re-index (ignoring existing repodata): |
| 67 | +```bash |
| 68 | +rattler-index fs ./my-channel --force |
| 69 | +``` |
| 70 | + |
| 71 | +Index without sharded repodata: |
| 72 | +```bash |
| 73 | +rattler-index fs ./my-channel --write-shards false |
| 74 | +``` |
| 75 | + |
| 76 | +Index an S3 channel with a custom endpoint (e.g., MinIO): |
| 77 | +```bash |
| 78 | +rattler-index s3 s3://my-bucket/channel --endpoint-url http://localhost:9000 --region us-east-1 |
| 79 | +``` |
| 80 | + |
| 81 | +Apply repodata patches from a package: |
| 82 | +```bash |
| 83 | +rattler-index fs ./my-channel --repodata-patch my-repodata-patches |
| 84 | +``` |
0 commit comments