[peanut] peanut now supports direct, fmq batched and single step modes#803
[peanut] peanut now supports direct, fmq batched and single step modes#803justonedev1 wants to merge 3 commits intomasterfrom
Conversation
in TUI and CLI modes written using Claude Opus 4.6
knopers8
left a comment
There was a problem hiding this comment.
Thanks, it indeed impressive that all of this was generated code. I have some comments for small interface improvements.
Also, when running a DPL task, I got the following crash for state-stream:
~/alice/Control$ bin/peanut -addr localhost:31004 state-stream
streaming state updates from localhost:31004 (ctrl-c to stop)
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x30 pc=0x8dba6d]
goroutine 1 [running]:
github.com/AliceO2Group/Control/occ/peanut.RunCLI({0xc000020150, 0x3, 0x3})
/home/pkonopka/alice/Control/occ/peanut/cli.go:162 +0x120d
main.main()
/home/pkonopka/alice/Control/cmd/peanut/main.go:58 +0x1b4
That was the task:
OCC_CONTROL_PORT=31004 o2-testworkflows-diamond-workflow --id D_dds%TaskIndex%_%CollectionIndex% --shm-monitor false --log-color false --no-batch --color false --channel-config "name=from_B_to_D,type=pull,method=connect,address=ipc://@localhost189507_22003,transport=shmem,rateLogging=0,rcvBufSize=4,sndBufSize=4" --channel-config "name=from_C_to_D,type=pull,method=connect,address=ipc://@localhost189507_22004,transport=shmem,rateLogging=0,rcvBufSize=4,sndBufSize=4" --aBool --aDouble 3 --aFloat 2 --aString foobar --anInt 1 --aod-file "" --aod-memory-rate-limit 0 --aod-writer-json "" --aod-writer-keep "" --aod-writer-maxfilesize 0 --aod-writer-ntfmerge -1 --aod-writer-resdir "" --aod-writer-resfile "" --aod-writer-resmode RECREATE --bad-alloc-attempt-interval 50 --bad-alloc-max-attempts 1 --clone "" --early-forward-policy never --fairmq-ipc-prefix "@" --fairmq-rate-logging 0 --fairmq-recv-buffer-size 4 --fairmq-send-buffer-size 4 --forwarding-destination drop --forwarding-policy dangling --io-threads 1 --labels "" --pipeline "" --readers 1 --severity info --shm-allocation rbtree_best_fit --shm-metadata-msg-size 0 --shm-mlock-segment false --shm-mlock-segment-on-creation false --shm-no-cleanup false --shm-segment-id 0 --shm-segment-size 2000000000 --shm-throw-bad-alloc true --shm-zero-segment false --signposts "" --spawners 1 --stacktrace-on-signal simple --timeframes-rate-limit 0 --timeframes-rate-limit-ipcid -1 --workflow-suffix "" --session dpl_189507 --control-port 31004 -S $CONTROL_OCCPLUGIN_ROOT/lib/ -P OCClite
|
|
||
| #### `fmq-step <srcFMQState> <fmqEvent> [key=val ...]` | ||
|
|
||
| Low-level: send a single raw FairMQ gRPC Transition call (JSON codec). |
There was a problem hiding this comment.
I don't quite understand how this is more low-level, if the only difference with high-level is that I have to type in an event instead of target state. Could you explain please?
knopers8
left a comment
There was a problem hiding this comment.
After the last commit, the TUI for FMQ mode stopped behaving 100% correctly, it used to work before (i confirmed by reverting by one commit).
In particular, when connecting with this:
OCC_CONTROL_PORT=31004 bin/peanut -addr localhost:31004 -mode fmq
I immediatelly see a window saying "Connection lost, Error:rpc error: code = Unimplemented desc =". I can still send commands and that works, but I am getting the aforementioned errors which I was not getting before.
| return m, nil | ||
| } | ||
|
|
||
| func (c *occClient) StateStream(ctx context.Context, in *pb.StateStreamRequest, opts ...grpc.CallOption) (pb.Occ_StateStreamClient, error) { |
There was a problem hiding this comment.
Is this part used also for controlling tasks by the executor? Have you tried if this still works after the modification?
There was a problem hiding this comment.
this is safe, because it isn't called anywhere outside the peanut. It just added the same logic as event stream. I didn't make sense that one was implemented and one wasn't...
during my quest for kubernetes I had a requirement for tool that can control fmq processes in all modes that exist inside ecs:
peanut now provides TUI and CLI modes for all described modes
added reconnecting
changes done by Claude Sonnet 4.6 without my manual intervention, I just tested if all changes work. I don't deem this tool important enough to understand properly the code.