Skip to content

feat: setup local dev environment for opslevel-runner with kind#302

Open
archf wants to merge 11 commits into
mainfrom
feature/improve-developer-setup
Open

feat: setup local dev environment for opslevel-runner with kind#302
archf wants to merge 11 commits into
mainfrom
feature/improve-developer-setup

Conversation

@archf

@archf archf commented Jun 23, 2026

Copy link
Copy Markdown

Motivation

Prior dev loop required manual cluster bring-up, manual helper image rebuilds, and manual restart on code changes to test opselvel-runner against a kubernetes cluster.

This PR enhances the Taskfile with commands to setup conveniently an easier development environment.

Changes

Taskfile

  • new task run (replaces start-faktory): brings up kind via `setup-kind dep, then launches goreman
  • new tasks build-helper-image, stop-kind
  • install-deps split per OS (darwin/linux); installs redis, watchexec, kind
  • install-faktory upgraded to v1.9.3, fetches asset URL via GitHub API + jq, idempotent via status: check
  • OPSLEVEL_GO_PKG bumped to v2026
  • image-builder — rebuilds helper image on Go/Dockerfile changes, reloads into kind

Added bin/ for utility scripts

  • kind-env.sh — shared sourcing helper: sources .env.local to exports KUBECONFIG or other local overrides, picks podman if available or fallback to docker
  • setup-kind.sh — idempotent cluster create/start with lockfile mutex for concurrent goreman processes (multiple running opslevel-runner instances;- stop-kind.sh — deletes job pods, stops control-plane container
  • build-helper-image.sh — checksums Go sources + Dockerfile

Added tests/ (moved from src/scripts/)

  • enqueue-runner-jobs.sh — N test jobs to runner queue
  • run-runner.sh — manual single-runner launcher (alternative to goreman)
  • enqueue-test-jobs.go

Repository structure modifications

  • src/Dockerfile move to repository root Dockerfile
  • binary built in dist/ not to pollute src/

Notes for reviewers

  • Cluster name defaults to opslevel-runner; override via positional arg to scripts.
  • bin/setup-kind.sh uses a transient lockfile to serialize concurrent cluster creation when goreman starts multiple processes in parallel
  • Default helper image: localhost/opslevel-runner:local
  • Set lower than defaults container CPU/memory requests (50m / 32Mi) so multiple pods/jobs fit on a laptop kind kubernetes cluster for testing.

Testing performed

  • task setup on macOS (podman) → installs Faktory 1.9.3, redis, watchexec, kind
  • task run → cluster created, all goreman processes start, image-builder loads helper into kind
  • tests/enqueue-runner-jobs.sh 3 → jobs enqueued, executed by runner worker
  • Code edits trigger watchexec reloads without restarting Faktory or kind manually
  • task stop-kind → outstanding pods deleted, control-plane stopped

Caveats

Setup on Linux not fully supported at this time.

archf added 11 commits June 17, 2026 09:49
- configure local runner startup to use the same helper image as coding-agent jobs
- improve script readability so run arguments are easier to inspect and maintain
- clarify test job enqueueing purpose by naming it for runner jobs
- add a short sleep command so the test job remains available long
  enough for enqueue behavior to be observed
- lower the default enqueue count to make local test runs faster and less resource-intensive
- pass configurable job pod CPU and memory requests so local runner scripts can match constrained environments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant