code wiki / _hdl_build / nx_blue_green.nx

nx_blue_green.nx

buildroot/runtime/_hdl_build/nx_blue_green.nx

4853 B116 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_itoa_lib.nx nx_blue_green.nx

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

main sys_mmap bg_write sys_openat_wr sys_write bg_strlen sys_close bg_flip bg_write ↻ sys_renameat bg_serve sys_mmap ↻ bg_read sys_openat_rd sys_read sys_close ↻ bg_has bg_health sys_mmap ↻ bg_read ↻ bg_has ↻ bg_puts sys_write ↻ bg_putn nxi_out nxi_fd sys_mmap ↻ ccz_cat_num sys_write ↻ sys_munmap

structs

none

consts

11const BG_LIVE: *u8 = "/tmp/nx_bg_live"
12const BG_TMP: *u8 = "/tmp/nx_bg_live_tmp"
13const BG_BLUE: *u8 = "/tmp/nx_bg_blue"
14const BG_GREEN: *u8 = "/tmp/nx_bg_green"

functions

16func 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 }
called by 1: main calls 1: sys_write
21func bg_putn(v: i64) -> i64 { nxi_out(v); return 0 }
called by 1: main calls 1: nxi_out
22func 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
24func bg_write(path: *u8, content: *u8) -> i64
31func bg_read(path: *u8, buf: *u8, cap: i64) -> i64
40func bg_has(buf: *u8, n: i64, needle: *u8) -> i64
called by 2: bg_healthmain
49func bg_flip(slotpath: *u8) -> i64
called by 1: main calls 2: bg_writesys_renameat
54func bg_serve(buf: *u8, cap: i64) -> i64
called by 1: main calls 2: sys_mmapbg_read
62func bg_health(slotpath: *u8) -> i64
called by 1: main calls 3: sys_mmapbg_readbg_has
69func main() -> i64