Repository navigation
Add Container.console, a shell in a notebook cell - #102
Draft
msherman64 wants to merge 1 commit into
Draft
msherman64 wants to merge 1 commit into
msherman64 wants to merge 1 commit into
Conversation
Notebook users had no way to get an interactive shell in a CHI@Edge container from python-chi. The only way was running `openstack appcontainer exec --interactive` in a separate terminal. Container.console() starts the command with stdin and a tty through python-zunclient's execute_interactive(), and shows it in the cell with xterm.js, as an anywidget. A thread in the kernel passes the session's output to the cell, and keys and the terminal size go back through send() and resize(). When the command exits, the cell shows its exit status. It needs a python-zunclient with execute_interactive(), recv(), send() and resize(). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
Container.console(), which opens an interactive shell in a CHI@Edge container inside a notebook cell. Until now the only way to get a shell was to runopenstack appcontainer exec --interactivein a separate terminal.The kernel holds the exec session, through python-zunclient's
execute_interactive(),recv(),send()andresize(). The cell shows the session with xterm.js, as an anywidget. It doesn't use theopenstackCLI or Jupyter's terminals, so it works in JupyterLab and in VS Code notebooks. When the command exits, the cell shows its exit status.Needs a python-zunclient with those methods. They're in mike-personal-org/python-zunclient#20 and aren't in ChameleonCloud/python-zunclient yet. It also needs
anywidgetin the Jupyter image.Note: the shell has a tty, so stderr arrives mixed into stdout, as in a terminal.
Not handled yet, most harmful first:
console()fails with anAttributeError, not a clear message.🤖 Generated with Claude Code