-
Notifications
You must be signed in to change notification settings - Fork 4
Replace Redis with Garage S3 and migrate workflow scaling to metrics API #51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
502ab7d
feat: remove redis
igboyes 5a0422b
feat: scale workflows via jobs counts api
igboyes 74ec520
feat: use garage
igboyes f263bd9
fix: update images
igboyes 9efbcd9
docs: add AGENTS.md and symlink CLAUDE.md to it
igboyes 6ea1f21
chore: harden dev scripts and refactor garage init
igboyes 87baa40
feat: replace garage with azurite
igboyes f518c8d
fix: fix azurite configuration
igboyes 8dd0208
fix: fix init and wipe scripts
igboyes File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| # Dev | ||
|
|
||
| This repository manages the local Kubernetes development environment for Virtool using Tilt and Minikube. | ||
|
|
||
| ## Stack | ||
|
|
||
| - **Tilt** — orchestrates the dev cluster; the `Tiltfile` is the main entry point | ||
| - **Minikube** — local Kubernetes cluster | ||
| - **KEDA** — scales workflow jobs via a `metrics-api` trigger pointing at `http://virtool-api-web-service.../jobs/counts` | ||
| - **MongoDB + PostgreSQL** — persisted across `tilt up`/`tilt down` runs via PVCs | ||
| - **Azurite** — Azure Blob Storage emulator; uses the well-known dev account `devstoreaccount1` with key `Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==` and persists blobs at `/data` via a PVC | ||
|
|
||
| ## Layout | ||
|
|
||
| ``` | ||
| manifests/ Kustomize manifests for all cluster resources | ||
| db/ MongoDB, PostgreSQL, Azurite | ||
| ingress.yaml | ||
| migration.yaml | ||
| storage.yaml | ||
| ui/ | ||
| virtool/ | ||
| workflows/ ScaledJob manifests for each workflow | ||
| scripts/ | ||
| init.sh Create/reset the Minikube cluster | ||
| hosts.sh Write cluster IP to /etc/hosts | ||
| pull.sh Update image tags in kustomization + migration manifests | ||
| wipe.sh Nuke PVCs, PVs, and host data | ||
| Tiltfile Tilt configuration (resources, buttons, live-edit flags) | ||
| ``` | ||
|
|
||
| ## Common tasks | ||
|
|
||
| **Start the cluster** | ||
| ```shell | ||
| bash scripts/init.sh # first time or full reset | ||
| tilt up | ||
| ``` | ||
|
|
||
| **Live-edit a service** (repo must be a sibling of this directory) | ||
| ```shell | ||
| tilt up -- --to-edit backend # virtool/virtool | ||
| tilt up -- --to-edit ui # virtool/virtool-ui | ||
| tilt up -- --to-edit <workflow-name> | ||
| ``` | ||
|
|
||
| Workflow names: `build-index`, `create-sample`, `create-subtraction`, `iimi`, `pathoscope`, `nuvs` | ||
|
|
||
| **Update images** | ||
| ```shell | ||
| bash scripts/pull.sh | ||
| ``` | ||
| Or click the **Pull** button in the Tilt UI. | ||
|
|
||
| **Wipe persistent data** | ||
| ```shell | ||
| bash scripts/wipe.sh | ||
| ``` | ||
| Or click the **Wipe** button in the Tilt UI (requires confirmation). | ||
|
|
||
| **Update `/etc/hosts`** (needed once per cluster recreation) | ||
| ```shell | ||
| bash scripts/hosts.sh | ||
| ``` | ||
|
|
||
| ## PR guidelines | ||
|
|
||
| - No test plan section in PR descriptions. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| AGENTS.md |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,114 @@ | ||
| apiVersion: apps/v1 | ||
| kind: StatefulSet | ||
| metadata: | ||
| name: azurite | ||
| labels: | ||
| app: azurite | ||
| spec: | ||
| serviceName: azurite | ||
| replicas: 1 | ||
| selector: | ||
| matchLabels: | ||
| app: azurite | ||
| template: | ||
| metadata: | ||
| labels: | ||
| app: azurite | ||
| spec: | ||
| initContainers: | ||
| - name: azurite-init | ||
| image: mcr.microsoft.com/azure-cli:latest | ||
| restartPolicy: Always | ||
| env: | ||
| - name: AZURE_STORAGE_CONNECTION_STRING | ||
| value: "DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;" | ||
| command: | ||
| - /bin/sh | ||
| - -c | ||
| - | | ||
| set -eu | ||
| until az storage container create --name virtool --output none 2>/dev/null; do sleep 2; done | ||
| touch /tmp/ready | ||
| exec sleep infinity | ||
| resources: | ||
| requests: | ||
| cpu: 50m | ||
| memory: 64Mi | ||
| limits: | ||
| cpu: 200m | ||
| memory: 256Mi | ||
| readinessProbe: | ||
| exec: | ||
| command: ["test", "-f", "/tmp/ready"] | ||
| periodSeconds: 2 | ||
| containers: | ||
| - name: azurite | ||
| image: mcr.microsoft.com/azure-storage/azurite | ||
| args: | ||
| - azurite | ||
| - --blobHost | ||
| - 0.0.0.0 | ||
| - --queueHost | ||
| - 0.0.0.0 | ||
| - --tableHost | ||
| - 0.0.0.0 | ||
| - --location | ||
| - /data | ||
| - --skipApiVersionCheck | ||
| - --disableProductStyleUrl | ||
| ports: | ||
| - containerPort: 10000 | ||
| name: blob | ||
| - containerPort: 10001 | ||
| name: queue | ||
| - containerPort: 10002 | ||
| name: table | ||
| resources: | ||
| requests: | ||
| cpu: 100m | ||
| memory: 128Mi | ||
| limits: | ||
| cpu: 250m | ||
| memory: 256Mi | ||
| readinessProbe: | ||
| tcpSocket: | ||
| port: 10000 | ||
| initialDelaySeconds: 2 | ||
| periodSeconds: 5 | ||
| livenessProbe: | ||
| tcpSocket: | ||
| port: 10000 | ||
| initialDelaySeconds: 10 | ||
| periodSeconds: 10 | ||
| volumeMounts: | ||
| - name: data | ||
| mountPath: /data | ||
| volumeClaimTemplates: | ||
| - metadata: | ||
| name: data | ||
| spec: | ||
| accessModes: ["ReadWriteOnce"] | ||
| resources: | ||
| requests: | ||
| storage: 5Gi | ||
| --- | ||
| apiVersion: v1 | ||
| kind: Service | ||
| metadata: | ||
| name: azurite | ||
| spec: | ||
| selector: | ||
| app: azurite | ||
| ports: | ||
| - name: blob | ||
| protocol: TCP | ||
| port: 10000 | ||
| targetPort: 10000 | ||
| - name: queue | ||
| protocol: TCP | ||
| port: 10001 | ||
| targetPort: 10001 | ||
| - name: table | ||
| protocol: TCP | ||
| port: 10002 | ||
| targetPort: 10002 |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| images: | ||
| - name: ghcr.io/virtool/ui | ||
| newTag: 7.5.2 | ||
| newTag: 7.13.3 | ||
|
|
||
| labels: | ||
| - pairs: | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| images: | ||
| - name: ghcr.io/virtool/virtool | ||
| newTag: 36.0.0 | ||
| newTag: 36.25.3 | ||
|
|
||
| labels: | ||
| - pairs: | ||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.