Skip to content

Run container execute and download over exec sessions - #105

Merged
msherman64 merged 1 commit into
masterfrom
feat/container-exec-sessions
Oct 26, 2026
Merged

msherman64 merged 1 commit into
masterfrom
feat/container-exec-sessions

Conversation

@msherman64

@msherman64 msherman64 commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Run execute and download over exec sessions, so long commands return all their output and exit code, and downloads aren't cut off at 60 s.

Note: to preserve backwards compatibility, this merges stdout and stderr.
A new method / not backwards compatible one would look like:

r = mycontainer.execute("make test", check=True)
r.returncode, r.stdout, r.stderr

we would probably also want to call decode() on stdout and stderr, and int() on returncode, so callers don't have to.

but this change still gives the reliability / no timeout benefits without breaking anything.

@msherman64
msherman64 added this pull request to stack #106 October 26, 2026 18:37
Comment thread chi/container.py
return zun().containers.execute(container_ref, command=command, run=True)
result = zun().containers.execute_run(container_ref, command)
output = (result.stdout + result.stderr).decode(errors="replace")
return {"output": output, "exit_code": result.returncode}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We could also add a default param to split stdout and stderr.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Agreed, I think that's easy to do in a followup with some examples.

@msherman64
msherman64 force-pushed the feat/container-exec-sessions branch from 5c214ef to 8cdb068 Compare October 26, 2026 19:06
Base automatically changed from feat/pypi-client-forks to master October 26, 2026 19:36
- execute returned partial output and no exit code for a command that
  ran longer than 5 s.
- download failed after 60 s, and extracted archives without checking
  where files land.

Use chameleon-zunclient's execute_run and copy_from, from 2025.1.2.

A downloaded directory now lands in dest/<name>/, as upload puts it,
instead of its contents landing directly in dest.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@msherman64
msherman64 force-pushed the feat/container-exec-sessions branch from 8cdb068 to 9470c0e Compare October 26, 2026 19:36
@msherman64
msherman64 merged commit 76a1379 into master Oct 26, 2026
6 checks passed
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.

2 participants