code wiki / _hdl_build / nx_blue_green.nx
nx_blue_green.nx
buildroot/runtime/_hdl_build/nx_blue_green.nx
about
nx_blue_green.nx -- DEP-002 (CALLOUT-012 deploy-exceed). Sovereign BLUE-GREEN deploy: two slots
(blue/green), a "live" pointer flipped ATOMICALLY between them via sys_renameat (the DEP-001
primitive). Deploy = write the new version to the INACTIVE slot, HEALTH-CHECK it, then atomically
flip live -> new slot. Rollback = atomic flip back (the old slot is untouched = INSTANT). A bad
(unhealthy) new version is NEVER flipped live. k8s/Spinnaker class, no 3rd-party stack.
Self-validating gate (BLUEGREENGATE): initial=v1, deploy=v2, rollback=v1, bad-deploy-blocked.
license_tier: ORIGINAL
dependencies 2 imports · 0 importers
imports: nx_syscalls.nxnx_itoa_lib.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 11 | const BG_LIVE: *u8 = "/tmp/nx_bg_live" |
| 12 | const BG_TMP: *u8 = "/tmp/nx_bg_live_tmp" |
| 13 | const BG_BLUE: *u8 = "/tmp/nx_bg_blue" |
| 14 | const BG_GREEN: *u8 = "/tmp/nx_bg_green" |
functions
| 16 | func bg_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 } |
| 21 | func bg_putn(v: i64) -> i64 { nxi_out(v); return 0 } |
| 22 | func bg_strlen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } called by 1: bg_write |
| 24 | func bg_write(path: *u8, content: *u8) -> i64 |
| 31 | func bg_read(path: *u8, buf: *u8, cap: i64) -> i64 |
| 40 | func bg_has(buf: *u8, n: i64, needle: *u8) -> i64 |
| 49 | func bg_flip(slotpath: *u8) -> i64 |
| 54 | func bg_serve(buf: *u8, cap: i64) -> i64 |
| 62 | func bg_health(slotpath: *u8) -> i64 |
| 69 | func main() -> i64 |