Skip to content

feat(cli): add experiment lifecycle trigger command - #379

Merged
cmulk merged 1 commit into
sandialabs:mainfrom
GhostofGoes:feat-exp-trigger-lifecycle
Sep 16, 2026
Merged

cmulk merged 1 commit into
sandialabs:mainfrom
GhostofGoes:feat-exp-trigger-lifecycle

Conversation

@GhostofGoes

@GhostofGoes GhostofGoes commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

Description

Add phenix exp trigger for invoking configure, pre-start, post-start, running, or cleanup app lifecycles, including documented shorthands and validation. Deprecate trigger-running in favor of trigger running.

Not sure if this is a feature we want to add, opening this PR to trigger discussion.

Documentation

See sceptre-phenix-docs#68 for comprehensive documentation of the new command.

Related Issue

N/A

Type of Change

  • Bugfix
  • New feature
  • Documentation update
  • Other (please describe):

Checklist

  • This PR conforms to the process detailed in the Contributing Guide.
  • I have included no proprietary/sensitive information in my code.
  • I have performed a self-review of my code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.
  • I have tested my code.

Additional Notes

Tested with triggering stages of various apps on a running experiment, plus Go tests.

Trigger examples

$ phenix exp trigger pre-start helloworld serial
2026-09-15 18:57:56.302 INF [✓] 'serial' default app (pre-start) type=PHENIX-APP
2026-09-15 18:57:56.302 DBG Skipping 'tap' experiment app (pre-start) type=PHENIX-APP
2026-09-15 18:57:56.303 DBG Skipping 'scorch' experiment app (pre-start) type=PHENIX-APP
2026-09-15 18:57:56.303 DBG Skipping 'soh' experiment app (pre-start) type=PHENIX-APP
2026-09-15 18:57:56.305 INF pre-start stage triggered for apps type=SYSTEM exp=helloworld
$ phenix exp trigger running helloworld soh
2026-09-15 19:00:03.002 DBG Skipping 'tap' experiment app (running) type=PHENIX-APP
2026-09-15 19:00:03.002 DBG Skipping 'scorch' experiment app (running) type=PHENIX-APP
2026-09-15 19:00:03.004 INF starting SOH checks type=SOH
2026-09-15 19:00:03.004 DBG skipping host per config type=SOH host=router
...

Tab completion

$ phenix exp trigger configure helloworld
ntp        scorch     serial     soh        startup    tap        vrouter

$ phenix exp trigger running helloworld
scorch     soh        tap

@GhostofGoes GhostofGoes changed the title cli: add experiment lifecycle trigger command feat(cli): add experiment lifecycle trigger command Aug 25, 2026
@GhostofGoes
GhostofGoes force-pushed the feat-exp-trigger-lifecycle branch from 68359a5 to 939d657 Compare August 25, 2026 21:34
@GhostofGoes
GhostofGoes marked this pull request as ready for review August 25, 2026 21:35
@GhostofGoes
GhostofGoes force-pushed the feat-exp-trigger-lifecycle branch 2 times, most recently from 740edf8 to 870f7b2 Compare August 26, 2026 16:54
@cmulk

cmulk commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

I like this idea, i know it would be nice to at least manually trigger the tap app. I think it would be nice if triggering any of the other stages would also automatically queue the cleanup stage to run on experiment stop

@GhostofGoes

Copy link
Copy Markdown
Contributor Author

Addressed in ba3530f. Lifecycle triggers now persist a cleanup queue, and experiment stop runs cleanup for queued apps, including disabled apps.

@GhostofGoes
GhostofGoes force-pushed the feat-exp-trigger-lifecycle branch from ba3530f to 18fd766 Compare September 1, 2026 01:05
@GhostofGoes
GhostofGoes marked this pull request as draft September 1, 2026 01:05
Comment thread src/go/cmd/experiment.go
@GhostofGoes
GhostofGoes force-pushed the feat-exp-trigger-lifecycle branch 2 times, most recently from 4a51cda to 0821d09 Compare September 11, 2026 18:13
@GhostofGoes
GhostofGoes force-pushed the feat-exp-trigger-lifecycle branch 3 times, most recently from c002ab6 to 76aec3b Compare September 15, 2026 22:03
Add phenix exp trigger for invoking configure, pre-start, post-start, running, or
cleanup app lifecycles, including documented shorthands and validation. Deprecate
trigger-running in favor of trigger running.

Changes:
- Add ParseAction(), Actions(), and Valid() functions for lifecycle stage parsing
- Add Shorthand() method for action shorthand generation
- Implement app filtering and cleanup queuing for triggered stages
- Preserve app status during triggered pre-start (differs from normal deployment)
- Queue cleanup for apps when other stages are triggered (pre-start, post-start, configure)
- Implement phenix exp trigger command with lifecycle argument
- Deprecate phenix exp trigger-running with migration path
- Error when a triggered app isn't part of the experiment or the stage isn't
  applicable to it (e.g. triggering the running stage for a default app)
- Restrict trigger command shell completion to apps applicable to the given
  experiment and lifecycle stage
- Add comprehensive tests for filtering, cleanup queueing, failure handling,
  and the new app/stage validation
- Document Trigger() function behavior and limitations
- Update CHANGELOG with feature and deprecation notice

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@GhostofGoes
GhostofGoes force-pushed the feat-exp-trigger-lifecycle branch from 76aec3b to 9a1530d Compare September 15, 2026 23:35
@GhostofGoes
GhostofGoes marked this pull request as ready for review September 16, 2026 00:58
@GhostofGoes
GhostofGoes requested a review from nblair2 September 16, 2026 01:00
@GhostofGoes

Copy link
Copy Markdown
Contributor Author

Ready for a final review @nblair2 @cmulk

@cmulk
cmulk merged commit 218c66b into sandialabs:main Sep 16, 2026
7 checks passed
@GhostofGoes
GhostofGoes deleted the feat-exp-trigger-lifecycle branch September 16, 2026 16:22
cmulk pushed a commit that referenced this pull request Sep 29, 2026
…running

Document the `phenix exp trigger` command for manually invoking app
lifecycle stages, compare `trigger configure` with `reconfigure`, and
mark `trigger-running` as deprecated.

Migrated from sandialabs/sceptre-phenix-docs#68.

Refs: #379

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants