-
Notifications
You must be signed in to change notification settings - Fork 4
feat: subprocess support, networking idle-poll fix, and CI improvements #108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
937840a
feat(kernel): point examples at danbugs/unikraft fork
danbugs 62f6666
feat(host): increase heap to 2.5 GiB for subprocess support
danbugs bb258c1
fix(pydriver): replace strtoul with inline parse_hex
danbugs 0159b3e
feat(python-agent-driver): add subprocess demos and rootfs
danbugs cb1a907
ci: add subprocess demo tests to regression gate
danbugs 89c6afb
fix(python-agent-driver): build base images automatically in just rootfs
danbugs c930ae6
test: add urllib GET without timeout CI test
danbugs 2a8de19
ci: add per-test timeout to Windows runtime tests
danbugs 5cca497
fix(kernel): point kraft.yaml at upstream plat-hyperlight
danbugs cce29e0
fix(python-agent-driver): remove pre-bundled wheel, use toml for pip …
danbugs a7f453d
fix(python-agent-driver): remove stale COPY of deleted /wheels dir
danbugs c7637fa
fix(kernel): revert kraft.yaml to fork branches until upstream PRs merge
danbugs ba7e738
fix(kernel): point all examples at upstream plat-hyperlight
danbugs 1da206d
ci: retrigger after upstream signal guard fix
danbugs 454309c
ci: retrigger CI
danbugs d7c963a
fix(kernel): point kraft.yaml at epoll bypass fix branch
danbugs 11340a0
fix(ci): capture stderr in Windows Invoke-WithTimeout
danbugs 8084df2
fix(kernel): point kraft.yaml at upstream plat-hyperlight
danbugs File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| """HTTP GET using urllib WITHOUT an explicit timeout. | ||
|
|
||
| Same as urllib_get.py but omits the timeout= argument to urlopen(). | ||
| This exercises the code path used by mxc, where the Unikraft guest | ||
| kernel relies on the idle thread's halt_irq callback to poll sockets | ||
| via __hl_sleep rather than an explicit timeout-driven poll cycle. | ||
| """ | ||
| import urllib.request | ||
| import sys | ||
|
|
||
| URL = "http://example.com/" | ||
|
|
||
| print(f"Fetching {URL} (no timeout) ...") | ||
| try: | ||
| with urllib.request.urlopen(URL) as resp: | ||
| body = resp.read().decode("utf-8", errors="replace") | ||
| print(f"Status: {resp.status}") | ||
| print(f"Body length: {len(body)} bytes") | ||
| if "Example Domain" in body: | ||
| print("SUCCESS: urllib GET (no timeout) worked!") | ||
| else: | ||
| print("WARNING: unexpected body content") | ||
| except Exception as e: | ||
| print(f"FAILED: {e}") | ||
| sys.exit(1) |
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| import subprocess | ||
|
|
||
| cmds = [ | ||
| (["echo", "hello from hyperlight guest"], None), | ||
| (["uname", "-a"], None), | ||
| (["ls", "/bin"], None), | ||
| (["grep", "nameserver", "/etc/resolv.conf"], None), | ||
| (["find", "/etc", "-name", "*.conf"], None), | ||
| (["wc", "-l", "/etc/resolv.conf"], None), | ||
| (["sh", "-c", "echo hello from sh"], None), | ||
| ] | ||
|
|
||
| for cmd, stdin in cmds: | ||
| label = " ".join(cmd) | ||
| print(f"\n$ {label}") | ||
| r = subprocess.run(cmd, capture_output=True, text=True, input=stdin) | ||
| if r.stdout: | ||
| print(r.stdout.rstrip()) | ||
| if r.stderr: | ||
| print(f"stderr: {r.stderr.rstrip()}") | ||
| if r.returncode != 0: | ||
| print(f"exit code: {r.returncode}") |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| import subprocess, sys, os | ||
|
|
||
| target = "/tmp/pypackages" | ||
| os.makedirs(target, exist_ok=True) | ||
|
|
||
| result = subprocess.run( | ||
| [sys.executable, "-m", "pip", "install", "--target", target, "six"], | ||
| capture_output=True, text=True, | ||
| ) | ||
|
danbugs marked this conversation as resolved.
|
||
| print(result.stdout) | ||
| if result.returncode != 0: | ||
| print(result.stderr) | ||
| sys.exit(result.returncode) | ||
|
|
||
| sys.path.insert(0, target) | ||
| import six | ||
| print(f"Installed and imported six {six.__version__}") | ||
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
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.