Skip to content

Commit 857aa51

Browse files
committed
fix: tarball URL and download fallback for process injection
- Fix tarball URL from runpod/flash-worker to runpod-workers/flash (matching the actual GitHub repo path) - Add python3 urllib.request fallback in download chain for base images without curl or wget (e.g. pytorch/pytorch runtime images) - Update test assertions for URL and fallback chain
1 parent c1f28b8 commit 857aa51

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

src/runpod_flash/core/resources/constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def _endpoint_domain_from_base_url(base_url: str) -> str:
4040
FLASH_WORKER_VERSION = os.environ.get("FLASH_WORKER_VERSION", "1.1.1")
4141
FLASH_WORKER_TARBALL_URL_TEMPLATE = os.environ.get(
4242
"FLASH_WORKER_TARBALL_URL",
43-
"https://github.com/runpod/flash-worker/releases/download/"
43+
"https://github.com/runpod-workers/flash/releases/download/"
4444
"v{version}/flash-worker-v{version}-py3.11-linux-x86_64.tar.gz",
4545
)
4646

src/runpod_flash/core/resources/injection.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,12 @@ def build_injection_cmd(
3939
"else "
4040
"mkdir -p $FW_DIR; "
4141
f'DL_URL="{tarball_url}"; '
42-
'(command -v curl >/dev/null 2>&1 && curl -sSL "$DL_URL" || wget -qO- "$DL_URL") '
42+
"dl() { "
43+
'(command -v curl >/dev/null 2>&1 && curl -sSL "$1" || '
44+
'command -v wget >/dev/null 2>&1 && wget -qO- "$1" || '
45+
'python3 -c "import urllib.request,sys;sys.stdout.buffer.write(urllib.request.urlopen(sys.argv[1]).read())" "$1"); '
46+
"}; "
47+
'dl "$DL_URL" '
4348
"| tar xz -C $FW_DIR --strip-components=1; "
4449
# Cache to network volume if available
4550
"if [ -d /runpod-volume ]; then "

tests/unit/resources/test_injection.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def test_default_remote_url(self):
1212

1313
assert cmd.startswith("bash -c '")
1414
assert "FW_VER=1.1.1" in cmd
15-
assert "flash-worker/releases/download/v1.1.1/" in cmd
15+
assert "runpod-workers/flash/releases/download/v1.1.1/" in cmd
1616
assert "bootstrap.sh'" in cmd
1717

1818
def test_custom_tarball_url(self):
@@ -50,12 +50,13 @@ def test_network_volume_caching(self):
5050
assert "/runpod-volume/.flash-worker/" in cmd
5151
assert "NV_CACHE" in cmd
5252

53-
def test_curl_wget_fallback(self):
54-
"""Test curl/wget fallback logic."""
53+
def test_curl_wget_python_fallback(self):
54+
"""Test curl/wget/python3 fallback chain."""
5555
cmd = build_injection_cmd(worker_version="1.0.0")
5656

5757
assert "curl -sSL" in cmd
5858
assert "wget -qO-" in cmd
59+
assert "urllib.request" in cmd
5960

6061
def test_default_uses_constants(self):
6162
"""Test that calling with no args uses module-level constants."""

0 commit comments

Comments
 (0)