Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/cargo-publish.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: Publish to crates.io

on:
release:
types: [published]
workflow_dispatch:
inputs:
dry_run:
Expand Down
7 changes: 0 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,3 @@ jobs:
run: |
VERSION="${{ steps.version.outputs.version }}"
gh workflow run publish-examples.yml --ref "v$VERSION"

- name: Trigger crates.io publish
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
VERSION="${{ steps.version.outputs.version }}"
gh workflow run cargo-publish.yml --ref "v$VERSION" -f dry_run=false
6 changes: 6 additions & 0 deletions .github/workflows/test-examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,9 @@ jobs:
- example: networking-py
args: "--net -- /urllib_get.py"
expect: "SUCCESS: urllib GET worked!"
- example: networking-py
args: "--net -- /urllib_get_no_timeout.py"
expect: "SUCCESS: urllib GET \\(no timeout\\) worked!"
- example: networking-py
args: "--port 8080 -- /echo_server_test.py"
expect: "SUCCESS: bind\\+listen on port 8080 allowed"
Expand Down Expand Up @@ -613,6 +616,9 @@ jobs:
- example: networking-py
args: "--net -- /urllib_get.py"
expect: "SUCCESS: urllib GET worked!"
- example: networking-py
args: "--net -- /urllib_get_no_timeout.py"
expect: "SUCCESS: urllib GET \\(no timeout\\) worked!"
- example: networking-py
args: "--port 8080 -- /echo_server_test.py"
expect: "SUCCESS: bind\\+listen on port 8080 allowed"
Expand Down
1 change: 1 addition & 0 deletions examples/networking-py/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ FROM ${BASE} AS rootfs
COPY http_get.py /http_get.py
COPY echo_server.py /echo_server.py
COPY urllib_get.py /urllib_get.py
COPY urllib_get_no_timeout.py /urllib_get_no_timeout.py
COPY https_test.py /https_test.py
COPY echo_server_test.py /echo_server_test.py

Expand Down
25 changes: 25 additions & 0 deletions examples/networking-py/urllib_get_no_timeout.py
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 busy-polls net_poll with timeout_ms=0 and relies on the host
to detect read-readiness via select().
"""
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)
10 changes: 5 additions & 5 deletions host/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion host/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "hyperlight-unikraft"
version = "0.11.0"
version = "0.11.1"
edition = "2021"
description = "Embedded Hyperlight host for running Unikraft unikernels"
license = "MIT OR Apache-2.0"
Expand Down
Loading
Loading