xyops: custom Event Plugin construct (NewPlugin) and plugin-backed pipeline steps #74
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/xyops-plugin"
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?
Problem
Inline Shell Plugin scripts are event parameters: xySat copies every job param into the job environment and drops any variable above 64 KiB (
checkJobEnv), and each event stores its own copy. john/arch has ~22 such scripts (up to 114 KB, several near-identical copies). Upstream recommends custom Event Plugins for this.Change
xyops.NewPlugindeclares onexyops_plugin(provider 0.1.2-dev.9). The satellite writesScriptto<temp>/plugins/<id>and runsCommand <file>with the job as one JSON line on STDIN. The code never enters the job environment (job.script = "(File)").[a-z0-9_]{1,64}, never a stock ID or anything ending inplug(or starting with_); ID claimed inxyops.PluginNamespace. Title is<stack>-<id>.Commandis an absolute path plus fixed single-space words; shell metacharacters, quotes,$, globs,~and control characters are refused, because xySat expands$VARSin arguments. Script must be non-empty and is written as a literal.Killdefaults toall. Notes reject<>.PreventDestroy. Import is supported.params "[]"(no plugin parameters by design),uid/gid""(no run-as override),groups [],format "",icon "",runner false,enabled true,type event. The provider treats an omitted optional attribute as unmanaged, so each one is written.EventProps.Plugin: exactly one ofScriptorPlugin, which must come from the same stack. Plugin events getplugin = <id>andparams "{}", and adddepends_onthe plugin, merged with OnSuccess and sorted. Script events are byte-for-byte unchanged.workflow.PluginTask/Step.Plugin. Plugin steps and a pluginServiceReleaseProps.Intakecount as workers for state and vault grants.xyops.CheckInlineScripts(stack, xyops.MaxInlineScript)(16 KiB) returns the Shell Plugin events whose decoded script is over the limit, for consumer tests.xyops_plugin, checked againsttofu providers schema -jsonfrom the 0.1.2-dev.9 binary. A new test also requires every settable plugin attribute to be written.Plugin code goes to every satellite, so it must hold no secrets; grant secrets to events. Programs must take their role from
job.event, never fromjob.params.No VERSION bump (release-check: "merging releases nothing"); the CHANGELOG is updated under [Unreleased].
Large inline Shell Plugin scripts are copied into the job environment, where xySat drops any variable above 64 KiB, and every event stores its own copy. xyops.NewPlugin declares a custom Event Plugin instead: the satellite runs `Command <script file>` with the job on STDIN. - NewPlugin writes every xyops_plugin attribute (params "[]", empty uid/gid, kill all by default, runner false) and refuses stock-like IDs, relative commands and shell metacharacters. - EventProps.Plugin: exactly one of Script or Plugin; plugin events pass params "{}" and depend on the plugin. Script events are unchanged. - workflow.PluginTask / Step.Plugin; plugin steps and a plugin intake are service-release workers. - Opt-in CheckInlineScripts and MaxInlineScript for consumer tests. - Schema snapshot gains xyops_plugin (checked against the provider binary).