feat(backend): scaffold Rust + axum backend #23
No reviewers
Labels
No labels
area:agents
area:backend
area:clinical
area:dashboard
area:deploy
area:design
area:design-review
area:devices
area:docs
area:federation
area:identity
area:infra
area:interop
area:meta
area:security
area:sessions
area:web
area:webhook
area:workdir
type:bug
type:chore
type:epic
type:meta
type:user-story
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
charles/koinos!23
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/backend-scaffold"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #3. Stacked on top of #22 — please merge that first (this PR's base is
feat/compose-skeleton; it will auto-retarget tomainonce #22 lands).Summary
backend/withkoinosbinary crate andkoinos-corelibrary crate, Rust edition 2021, MSRV 1.88 pinned viarust-toolchain.toml.GET /healthz→ 200 JSON{status, version, commit}(commit fed in viaKOINOS_GIT_SHAbuild arg).GET /readyz→ 200 whenSELECT 1succeeds against the Postgres pool, 503 otherwise.tracing-subscriber+KOINOS_LOGenv filter).koinos.yaml→KOINOS__*env vars.cargo-chefcaching; distrolessccruntime image.docker-compose.ymlbuilds the image from./backend; Caddyfile routes/api,/healthz,/readyztokoinos-backend:8080.fmt-check,lint,test,ci-setup,ci-build,ci-packagenow wired to the real crate (cross-compile branch reads$ARCH).backend/crates/koinos/tests/healthz.rsboots the router on a random port and asserts the JSON envelope.Locally verified:
cargo check,cargo test,cargo clippy -- -D warnings,cargo fmt --checkall green.Acceptance criteria
Cargo layout
backend/workspace withkoinosbin +koinos-corelibrust-toolchain.tomlaxum,tokio,tower,tracing,tracing-subscriber,serde,serde_yaml,sqlx(postgres),anyhow,thiserror,configaddedRuntime
/healthzreturns{status:"ok", version, commit}/readyzreturns 200 iff DB reachable, 503 otherwisetracing-subscriberConfiguration
KOINOS__*)Container
Dockerfile(cargo-chef) on distrolessTests
/healthzOut of scope
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.