This repository was archived by the owner on May 8, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Align docker-runner with architecture #14
Merged
Merged
Changes from all commits
Commits
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
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,65 +1,38 @@ | ||
| # docker-runner | ||
| # Docker Runner | ||
|
|
||
| Standalone Docker runner service extracted from the agynio/platform monorepo. | ||
| Docker Engine-backed runner service that executes workloads over gRPC. | ||
|
|
||
| ## Prerequisites | ||
| Architecture: [Runner](https://github.com/agynio/architecture/blob/main/architecture/runner.md) | ||
|
|
||
| Access to an agynio Kubernetes cluster (kubeconfig configured) and: | ||
| ## Local Development | ||
|
|
||
| | Tool | Version | Purpose | | ||
| | --- | --- | --- | | ||
| | kubectl | Compatible with cluster | Manage Kubernetes resources. | | ||
| | devspace | Latest | Run the in-cluster DevSpace workflow. | | ||
| | Docker Engine | Latest | Runs the k3d cluster used by bootstrap. | | ||
| | k3d | v5.x | Local Kubernetes cluster for bootstrap. | | ||
| | Terraform | >= 1.5.0 | Provision the bootstrap infrastructure. | | ||
| Full setup: [Local Development](https://github.com/agynio/architecture/blob/main/architecture/operations/local-development.md) | ||
|
|
||
| No local Node.js or pnpm required; the dev container in the cluster runs the toolchain. | ||
| ### Prepare environment | ||
|
|
||
| ## Cluster Setup | ||
|
|
||
| ```sh | ||
| gh repo clone agynio/bootstrap_v2 | ||
| cd bootstrap_v2 | ||
| ```bash | ||
| git clone https://github.com/agynio/bootstrap.git | ||
| cd bootstrap | ||
| chmod +x apply.sh | ||
| ./apply.sh -y | ||
| kubectl get deployment docker-runner -n platform | ||
| ``` | ||
|
|
||
| ## Development (DevSpace) | ||
| See [bootstrap](https://github.com/agynio/bootstrap) for details. | ||
|
|
||
| ```sh | ||
| cd /path/to/docker-runner | ||
| devspace dev | ||
| ``` | ||
| ### Run from sources | ||
|
|
||
| DevSpace syncs the repo into the cluster dev container, runs `pnpm install` and | ||
| `pnpm proto:generate`, then starts `tsx watch src/service/main.ts` for hot reload. | ||
| It also forwards gRPC on port `50051` to your local machine. | ||
| ```bash | ||
| # Deploy once (exit when healthy) | ||
| devspace dev | ||
|
|
||
| ## Running Tests | ||
| # Watch mode (streams logs, re-syncs on changes) | ||
| devspace dev -w | ||
| ``` | ||
|
|
||
| Keep `devspace dev` running in another terminal, then use: | ||
| ### Run tests | ||
|
|
||
| ```sh | ||
| devspace run test | ||
| ```bash | ||
| devspace run test:e2e | ||
| devspace run enter | ||
| ``` | ||
|
|
||
| `devspace run test` runs unit + integration tests; the integration suite | ||
| requires Docker, provided by the DinD sidecar in the dev pod. `devspace run | ||
| test:e2e` runs the e2e suite, with `DOCKER_RUNNER_SHARED_SECRET` already | ||
| provided by the Helm deployment. `devspace run enter` opens an interactive shell | ||
| in the dev container. | ||
|
|
||
| ## Troubleshooting | ||
|
|
||
| - **Sync timeout**: if the dev container logs `ERROR: sync timeout`, restart | ||
| `devspace dev` and confirm the repo sync completed before the process starts. | ||
| - **ArgoCD reverting changes**: DevSpace disables auto-sync for the | ||
| `docker-runner` ArgoCD app. If it keeps reverting, manually disable | ||
| auto-sync or re-run `devspace dev` to apply the patch again. | ||
| - **Docker socket missing**: if `/var/run/docker.sock` is missing in the pod, | ||
| ensure the cluster nodes expose the Docker socket and the deployment mounts it. | ||
| - **Port forwarding**: if `50051` is unavailable, confirm `devspace dev` is | ||
| still running and restart it to re-establish the port forward. | ||
| See [E2E Testing](https://github.com/agynio/architecture/blob/main/architecture/operations/e2e-testing.md). |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,20 @@ version: v2beta1 | |
|
|
||
| vars: | ||
| DOCKER_RUNNER_NAMESPACE: platform | ||
| E2E_IMAGE: ghcr.io/agynio/devcontainer-node:1 | ||
|
|
||
| deployments: | ||
| e2e-runner: | ||
| namespace: ${DOCKER_RUNNER_NAMESPACE} | ||
| helm: | ||
| chart: | ||
| name: component-chart | ||
| repo: https://charts.devspace.sh | ||
| values: | ||
| containers: | ||
| - image: ${E2E_IMAGE} | ||
| labels: | ||
| app.kubernetes.io/name: docker-runner-e2e | ||
|
|
||
| commands: | ||
| test: |- | ||
|
|
@@ -11,11 +25,7 @@ commands: | |
| -n ${DOCKER_RUNNER_NAMESPACE} \ | ||
| -- pnpm test | ||
| test:e2e: |- | ||
| exec_container \ | ||
| --label-selector "app.kubernetes.io/name=docker-runner,app.kubernetes.io/instance=docker-runner" \ | ||
| --container docker-runner \ | ||
| -n ${DOCKER_RUNNER_NAMESPACE} \ | ||
| -- pnpm test:e2e | ||
| devspace run-pipeline test:e2e $@ | ||
| enter: |- | ||
| exec_container \ | ||
| --label-selector "app.kubernetes.io/name=docker-runner,app.kubernetes.io/instance=docker-runner" \ | ||
|
|
@@ -85,6 +95,20 @@ pipelines: | |
| )" | ||
| start_dev --disable-pod-replace docker-runner | ||
|
|
||
| test:e2e: | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [nit] The |
||
| run: |- | ||
| create_deployments e2e-runner | ||
| start_dev e2e-runner & | ||
| sleep 5 | ||
| exec_container \ | ||
| --label-selector "app.kubernetes.io/name=docker-runner-e2e" \ | ||
| -n ${DOCKER_RUNNER_NAMESPACE} \ | ||
| -- bash -c 'cd /opt/app/data && pnpm install --frozen-lockfile && pnpm proto:generate && pnpm test:e2e' | ||
| EXIT_CODE=$? | ||
| stop_dev e2e-runner | ||
| purge_deployments e2e-runner | ||
| exit $EXIT_CODE | ||
|
|
||
| hooks: | ||
| - name: restore-argocd-auto-sync | ||
| events: | ||
|
|
@@ -119,3 +143,16 @@ dev: | |
| - .devspace/ | ||
| ports: | ||
| - port: "50051" | ||
|
|
||
| e2e-runner: | ||
| namespace: ${DOCKER_RUNNER_NAMESPACE} | ||
| labelSelector: | ||
| app.kubernetes.io/name: docker-runner-e2e | ||
| command: ["sleep", "infinity"] | ||
| workingDir: /opt/app/data | ||
| sync: | ||
| - path: ./:/opt/app/data | ||
| excludePaths: | ||
| - .git/ | ||
| - .devspace/ | ||
| - node_modules/ | ||
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[minor]
workflow_dispatch: {}is still a trigger, but both jobs now gate onstartsWith(github.ref, 'refs/tags/v'). A manual dispatch from a branch silently skips every job with no feedback. Either removeworkflow_dispatchentirely (since releases are tag-driven) or add aninputs.tagparameter that the jobs can reference, so manual runs are explicitly scoped to a tag.