Skip to content

feat: add ochami rcs XXX subcommands#96

Open
cjh1 wants to merge 1 commit into
OpenCHAMI:mainfrom
cjh1:rcs
Open

feat: add ochami rcs XXX subcommands#96
cjh1 wants to merge 1 commit into
OpenCHAMI:mainfrom
cjh1:rcs

Conversation

@cjh1

@cjh1 cjh1 commented Jun 3, 2026

Copy link
Copy Markdown
Member

Checklist

  • My code follows the style guidelines of this project
  • I have added/updated comments where needed
  • I have added tests that prove my fix is effective or my feature works
  • I have run make test (or equivalent) locally and all tests pass
  • DCO Sign-off: All commits are signed off (git commit -s) with my real name and email
  • REUSE Compliance:
    • Each new/modified source file has SPDX copyright and license headers
    • Any non-commentable files include a <filename>.license sidecar
    • All referenced licenses are present in the LICENSES/ directory

Description

This adds subcommands to access the remote console service:

ochami rcs service status - Return the status of the service.
ochami rcs console list - List the currently active consoles.
ochami rcs console show <xname> - Show the console output for a particular console.
ochami rcs console connect <xname> - Will connect you to an interactive console session.

The best way to try this out is to use the dev docker-compose env in remote-console, which will setup an environment with a mock console. This can be brought up using:

docker compose -f docker-compose-devel.yaml up

You can then update you config with the folllowing:

        rcs:
            uri: http://localhost:26776/remote-console

Then you should be able run for example:

ochami rcs console connect x0c0s1b0

Fixes #72

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

For more info, see Contributing Guidelines.

@cjh1 cjh1 marked this pull request as draft June 3, 2026 19:56
@cjh1 cjh1 force-pushed the rcs branch 4 times, most recently from 3f6206f to 81316a7 Compare June 3, 2026 20:25
@cjh1 cjh1 marked this pull request as ready for review June 3, 2026 20:30
@cjh1

cjh1 commented Jun 9, 2026

Copy link
Copy Markdown
Member Author

@synackd Do you know what is up with the CI here?

@synackd

synackd commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

Looks like something with Chainguard. I reran the job and it completed fine.

Thanks for this change @cjh1! Got some fixes I'm trying to get in as well as metadata-service stuff for the new release PR, but I will take a look at this when I can.

@synackd synackd self-requested a review June 11, 2026 21:41
@cjh1

cjh1 commented Jun 12, 2026

Copy link
Copy Markdown
Member Author

Looks like something with Chainguard. I reran the job and it completed fine.

Thanks, I figured it was probably something transient, but didn't have the power to rerun the job.

Thanks for this change @cjh1! Got some fixes I'm trying to get in as well as metadata-service stuff for the new release PR, but I will take a look at this when I can.

No rush, thanks

@synackd synackd left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haven't tested just yet, but am requesting some small code/docs changes in the meantime. Also, there have been some features that have been merged in that have modified go.mod. Can you rebase, resolve the conflicts, and go mod tidy?

Comment thread man/ochami-rcs.1.sc Outdated

# SYNOPSIS

ochami rcs [OPTIONS] COMMAND

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With some of the recent changes, we've changed this to be a bit more descriptive by having the generic form at the top, followed by a blank line, followed by the specific command syntax. Can we adapt that form for rcs as well? See:

*ochami boot* [_global-options_] _command_ [_command-options_] [_arguments_]
*ochami boot* (*bmc* | *config* | *node*) *add* [-f _format_] [-d (_data_ | @_path_ | @-)]++
*ochami boot* (*bmc* | *config* | *node*) *delete* [--no-confirm] _uid_...++
*ochami boot* (*bmc* | *config* | *node*) *get* [-F _format_] _uid_++
*ochami boot* (*bmc* | *config* | *node*) *list* [-F _format_]++
*ochami boot* (*bmc* | *config* | *node*) *patch* [-f _format_] [-p _patch_method_] [-d (_data_ | @_path_ | @-)] _uid_++
*ochami boot* (*bmc* | *config* | *node*) *patch* (--add _key_=_val_ | --remove _key_=_index_ | --set _key_=_val_ | --unset _key_)... _uid_++
*ochami boot* (*bmc* | *config* | *node*) *set* [-f _format_] [-d (_data_ | @_path_ | @-)] _uid_++
*ochami boot service status* [-F _format_]

*ochami metadata* [_global-options_] _command_ [_command-options_] [_arguments_]
*ochami metadata* (*defaults* | *group* | *instance* | *peer*) *add* [-f _format_] [-d (_data_ | @_path_)]++
*ochami metadata* (*defaults* | *group* | *instance* | *peer*) *delete* [--no-confirm] _uid_...++
*ochami metadata* (*defaults* | *group* | *instance* | *peer*) *get* [-F _format_] _uid_++
*ochami metadata* (*defaults* | *group* | *instance* | *peer*) *list* [-F _format_]++
*ochami metadata* (*defaults* | *group* | *instance* | *peer*) *patch* [-f _format_] [-p _patch_method_] [-d (_data_ | @_path_ | @-)] _uid_++
*ochami metadata* (*defaults* | *group* | *instance* | *peer*) *patch* (--add _key_=_val_ | --remove _key_=_val_ | --set _key_=_val_ | --unset _key_)... _uid_++
*ochami metadata* (*defaults* | *group* | *instance* | *peer*) *set* [-f _format_] [-d (_data_ | @_path_)] _uid_++
*ochami metadata service status* [-F _format_]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E.g:

*ochami rcs* [_global-options_] _command_ [_command-options_] [_arguments_]

*ochami rcs console list* [-F _format_]++
*ochami rcs console show* [-F _format_] [--follow] [--lines _n_] _nodeID_++
*ochami rcs console connect* _nodeID_++
*ochami rcs service status* [-F _format_]

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, done

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops, my bad... I put list before connect in my comment above. Can you reorder so it's:

*ochami rcs* [_global-options_] _command_ [_command-options_] [_arguments_]

*ochami rcs console connect* _nodeID_++
*ochami rcs console list* [-F _format_]++
*ochami rcs console show* [-F _format_] [--follow] [--lines _n_] _nodeID_++
*ochami rcs service status* [-F _format_]

Comment thread man/ochami-rcs.1.sc Outdated
Comment thread pkg/client/rcs/rcs.go
Comment thread pkg/client/rcs/rcs.go
Comment thread internal/cli/rcs/rcs.go
Comment thread cmd/root.go
Comment thread cmd/rcs/console/console.go Outdated
@cjh1 cjh1 force-pushed the rcs branch 3 times, most recently from a932d40 to a8a5d3a Compare June 23, 2026 18:40
Signed-off-by: Chris Harris <cjh@lbl.gov>

@synackd synackd left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tested this using the development docker-compose file and it appears to work fine. Just have a couple small comments to resolve and we can merge this.

Comment thread man/ochami-rcs.1.sc
Comment on lines +71 to +96
*show* [-F _format_] [--follow] [--lines _n_] _nodeID_
Show console output for the specified node.

This command accepts the following options:

*-F, --format-output* _format_
Output response data in specified _format_. Supported values are:

- _json_ (default)
- _json-pretty_
- _yaml_

*-f, --follow*
Follow the console output in real-time.

*--lines* _n_
Number of lines to show from history. Defaults to 100.

*nodeID*
Node ID of the console to show.

*connect* _nodeID_
Start an interactive session with the console of the specified node.

*nodeID*
Node ID of the console to connect to.

@synackd synackd Jun 30, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there might have been confusion from my comment. These two commands, (connect and show), should be under the console command, in that order.

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.

[FEATURE] Add 'ochami console' command

2 participants