|
1 | | -# Indy sidecar |
| 1 | +# Indy Sidecar |
2 | 2 |
|
| 3 | +A Quarkus-based sidecar service that optimizes build performance by pre-downloading and caching dependency artifacts from previous builds. Deployed within builder pods, it proxies download/upload requests to remote repositories while serving cached artifacts locally to accelerate builds. |
3 | 4 |
|
4 | | -## build image |
| 5 | +## Architecture |
5 | 6 |
|
6 | | -**JVM image** |
| 7 | +- **Proxy Service**: Routes HTTP requests (GET/POST/PUT/DELETE/HEAD) to configured remote services |
| 8 | +- **Archive Retrieval**: Downloads artifact zip files from the external Archive Service for each build config |
| 9 | +- **Tracking Service**: External service that records artifact information sent by the sidecar |
7 | 10 |
|
8 | | -```shell |
9 | | -./mvnw clean package -Dquarkus.container-image.build=true |
10 | | -``` |
| 11 | +## Workflow |
| 12 | + |
| 13 | +1. **Archive Generation**: After a build completes, users trigger artifact zip file generation via REST API to the Archive Service |
| 14 | +2. **Zip Download**: The sidecar downloads the latest artifact zip file for the current build from the Archive Service |
| 15 | +3. **Local Caching**: Downloaded artifacts are cached locally and served directly to current build |
| 16 | +4. **Proxy Fallback**: For artifacts not in cache (new dependencies), requests are proxied to remote repositories |
| 17 | +5. **Records Collection**: All download/upload operations are sent to the external Tracking Service for recording and observability |
11 | 18 |
|
12 | | -use `src/main/resources/application.properties` to control image build plugin, by default, indy-sidecar use docker as builder. |
| 19 | +## Configuration |
13 | 20 |
|
14 | | ---- |
| 21 | +Configure via `application.yaml`: |
15 | 22 |
|
16 | | -**Native executable** |
| 23 | +```yaml |
| 24 | +sidecar: |
| 25 | + archive-api: http://localhost:8081/api/archive |
| 26 | + local-repository: ${user.home}/preSeedRepo |
| 27 | + |
| 28 | +proxy: |
| 29 | + read-timeout: 30m |
| 30 | + retry: |
| 31 | + count: 3 |
| 32 | + interval: 3000 |
| 33 | + services: |
| 34 | + - host: your-repo-host |
| 35 | + port: 80 |
| 36 | + path-pattern: /api/.+ |
| 37 | +``` |
17 | 38 |
|
| 39 | +## Build & Deploy |
18 | 40 |
|
19 | | -```shell |
| 41 | +**JVM Image:** |
| 42 | +```bash |
| 43 | +./mvnw clean package -Dquarkus.container-image.build=true |
| 44 | +``` |
| 45 | + |
| 46 | +**Native Executable:** |
| 47 | +```bash |
20 | 48 | ./mvnw package -Pnative -Dquarkus.native.container-build=true |
21 | 49 | docker build -f src/main/docker/Dockerfile.native -t indy-sidecar:native . |
22 | 50 | ``` |
23 | 51 |
|
24 | | - |
25 | | -Our build: `quay.io/kaine/indy-sidecar` tag:`latest` `native-latest` |
| 52 | +**Pre-built Images:** |
| 53 | +- `quay.io/kaine/indy-sidecar:latest` (JVM) |
| 54 | +- `quay.io/kaine/indy-sidecar:native-latest` (Native) |
0 commit comments