Commit graph

305 commits

Author SHA1 Message Date
ff940223ec docs: mark P0-2a complete, unblock P0-2b
Update task tracker: P0-2a is done (15 files, 8 TDD tests, 116/116
pass). P0-2b (Go-side ControlHost + allFlag race fix) is now unblocked.
Also fixed pre-existing goto-clean bug in worker_ctrl that leaked
write lock + reference count on HOST_OPEN/HOST_CLOSE no-op paths.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 07:47:30 +00:00
dcb1b4fe25 feat: P0-2a C-side plumbing for host control
Add the full call chain for host control operations from the Go API
server through the C library to the controller:

- schema/controller.capnp: HostControl struct + hostctrlmsg @21
  in Request.body union
- include/typemap.h: xce_hostctrl_t* hostctrlmsg in body union
  (placed after @20 clrpreasonmsg, matching capnp ordinal)
- include/client.h, xceapi.h, request.h: declarations for
  xcecli_hostctrl, xce_hostctrl, xce_hostctrl_req
- lib/client.c: xcecli_hostctrl (validate + delegate to xce_hostctrl)
- lib/xceapi.c: xce_hostctrl (validate ctx state + send + wait reply)
- lib/request.c: xce_hostctrl_req (validate hostname/empty/nil,
  accept only HOST_OPEN/HOST_CLOSE, reject HOST_TAG/UNTAG)
- lib/helper.c: Request_body_hostctrlmsg cases in
  xce_request_body() and xce_request_msg_name()
- controller/cluster.c: OPCode_hostcontrol dispatch
- controller/include/cluster.h: do_hostcontrol_op declaration
- controller/worker.c: do_hostcontrol_op + fix pre-existing
  goto-clean bug in worker_ctrl that leaked write lock and
  reference on HOST_OPEN/HOST_CLOSE no-op paths

TDD: 8 xce_hostctrl_req validation tests (null ep, null ctrl,
null/empty hostname, HOST_DO_NONE no-op, HOST_TAG/UNTAG reject,
negative action reject, HOST_OPEN/CLOSE accept via xce_request).

116/116 xcelib tests pass. CGO_ENABLED=0 Go backend tests pass.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 07:46:41 +00:00
ac7ac99ced refactor: make merge semantics explicit in OnHostConfigUpdated/OnClusterUpdated
Start from existing entry and apply this-source's fields, rather than
starting from incoming and restoring the other-source's fields. The new
pattern makes it immediately clear which fields each push type WRITES,
without having to reason about which fields are being "restored".

OnHostUpdated keeps the merged := *incoming + if ok guard because the
worker push also populates HostModel/HostType from attrs; config-sourced
values must only win when a prior config push has already set them.

All 37 backend unit tests pass.
2026-04-17 06:48:25 +00:00
893812e7aa feat: P0-1e expand handleConfigPush with host config and cluster dispatch
Wires the remaining cluster_config_t data into the notification pipeline:
- dispatchConfigPush() extracted as a pure-Go helper (CGO-free, testable)
  that drives OnQueueUpdated, OnResourceUpdated, OnHostConfigUpdated, and
  OnClusterUpdated from a single config push event
- handleConfigPush() delegates to dispatchConfigPush via the new helper,
  eliminating the previous inline loops
- OnHostConfigUpdated and OnClusterUpdated added to NotificationHandler
  interface and implemented with partial-merge semantics in DefaultHandler
- rawHostConfigData/rawHostConfigToModel and rawClusterData/rawClusterToModel
  added to convert_pure.go with their CGO extraction counterparts in convert.go

Safety fixes from code review:
- OnHostUpdated, OnHostConfigUpdated, OnClusterUpdated now copy *incoming to
  a local merged value before mutation, closing the TOCTOU window between
  store.Get and store.Put under concurrent pushes
- cClusterConfQueues and cClusterConfResources gain nil-pointer guards
  matching the existing guard in cClusterConfHostConfigs
- handleConfigPush gains an explicit gHandler nil check
- cClusterConfToClusterInfo returns nil on empty clustername (prevents phantom
  empty-key write to store.Clusters); handleConfigPush logs a warning when nil
- 36 unit tests passing (CGO_ENABLED=0)
2026-04-16 11:25:03 +00:00
00c4472d6c Add HostConfig + Cluster fields to models and update docs 2026-04-16 09:24:22 +00:00
960ef62342 fix job array display issue 2026-04-14 18:23:49 +08:00
d9b5c361c2 submit job from xcecli 2026-04-14 15:55:52 +08:00
c1c9f9e736 minor improve 2026-04-14 12:52:40 +08:00
897ca481b6 remove faked builtin data 2026-04-14 12:19:33 +08:00
c9dc8c4676 Merge Go frontend (apiserver + xcecli) into meson build 2026-04-14 11:23:18 +08:00
43dc12a36c save works 2026-03-06 18:20:30 +08:00
47fc32b02c save works 2026-03-05 16:03:37 +08:00
3f74f14687 save works 2026-03-04 18:18:53 +08:00
acfbec875b save works 2026-03-03 16:49:26 +08:00
f4b1ba4cd7 save works 2026-03-02 12:14:30 +08:00
b748e30d20 save works 2026-02-28 17:55:50 +08:00
b1faeb94b6 improve scheduler 2026-02-27 15:15:16 +08:00
638173dec9 improve plugin 2026-02-26 17:06:07 +08:00
598d381379 improve xkvmgr and testsuite for scheduler 2026-02-26 14:39:12 +08:00
2ee87d4ee6 use librtti for worker/queue/resource 2026-02-25 16:56:50 +08:00
532c68e6e1 - add implement job related objs based on librtti
- add lock()/unlock() to job object
2026-02-23 11:18:45 +08:00
f582742e77 add xzarray_t for replacement of zarray_t finally 2026-02-20 11:25:50 +08:00
ce69347581 - implement xstring by librtti 2026-02-14 14:38:52 +08:00
15fac3cda1 introduce kv 2026-02-13 17:05:41 +08:00
48ea4a0205 - introduce bitset
- add hash_block()
2026-02-13 11:01:33 +08:00
2cf636e607 format code 2026-02-12 11:22:27 +08:00
6cf9aa0979 - make new scheduler work for sequence jobs 2026-02-12 11:20:17 +08:00
e7ab1c16db save 2026-02-09 18:11:27 +08:00
12a6010f29 save work status 2026-02-09 11:42:30 +08:00
ff6d4eeccd fix typo of perflag && reformat .peg 2026-02-09 10:58:30 +08:00
12dcc2a60d - save tmp works
- save works
2026-02-06 17:31:02 +08:00
cd4f3953b2 - use librtti
- Fix issue to xce_get() api cause client side crash
- add parse resreq section
- add rusage parser
- parse resreq with basic support alternative & compound, still miss select
2026-02-05 17:21:27 +08:00
e7dc09c604 fix memory leak in controller and use lock protect apiserver data structure 2026-01-26 15:35:45 +08:00
06c561cea4 fix kill worker cause controller die 2026-01-23 18:21:12 +08:00
9e07a1b227 improve api server support 2026-01-23 17:33:10 +08:00
3b728e5135 improve support of api server in controller 2026-01-23 16:05:23 +08:00
44fc5b23e9 push more to api server 2026-01-22 17:23:18 +08:00
00d161aa11 add more helper functions more example code 2026-01-21 16:34:04 +08:00
70970434ca initial work of api server 2026-01-20 18:20:24 +08:00
280c22671f support shared libxce(for api server) 2026-01-19 11:02:49 +08:00
924bc1517b using xvec related api in scheduler 2026-01-16 18:21:37 +08:00
06209930f9 improve 2026-01-15 17:56:53 +08:00
ecf1916d78 support limit 2026-01-12 15:27:54 +08:00
bef32ace38 1st workable scheduler with resource from controller 2025-12-31 15:50:52 +08:00
780e9fb313 scheduling using real slots number 2025-12-30 18:13:15 +08:00
8db4458375 improve res 2025-12-28 14:51:54 +08:00
4769e6845f improve configuration handling 2025-12-26 17:52:43 +08:00
a27c8bfe6e enhance zarray library function 2025-12-26 16:23:04 +08:00
ae658c4a23 working of scheduler to handle configuration 2025-12-26 15:22:21 +08:00
a46ea822c1 working on scheduler and fix issue #17 2025-12-25 16:24:56 +08:00