Skip to content

[codex] Use uploaded cache endpoint for Runner packages#482

Merged
k82cn merged 1 commit into
xflops:release-0.6from
k82cn:codex/runner-cache-endpoint-release-0.6
May 31, 2026
Merged

[codex] Use uploaded cache endpoint for Runner packages#482
k82cn merged 1 commit into
xflops:release-0.6from
k82cn:codex/runner-cache-endpoint-release-0.6

Conversation

@k82cn
Copy link
Copy Markdown
Contributor

@k82cn k82cn commented May 31, 2026

Summary

  • Preserve the object-cache endpoint returned by package upload when Runner builds package URLs.
  • Normalize grpc+tls:// endpoints to grpcs:// for executor-manager downloads.
  • Add Runner storage tests for returned pod endpoints and TLS endpoint normalization.

Root Cause

Runner uploaded packages through object-cache, but rebuilt the package URL from the configured cache service endpoint instead of the returned ObjectRef endpoint. With multiple object-cache pods behind one ClusterIP service, executor-manager could download from a different cache pod and fail to find the package.

Verification

  • uv run -n pytest tests/test_runner.py -q
  • python3 -m py_compile sdk/python/src/flamepy/runner/storage.py sdk/python/tests/test_runner.py
  • git diff --check

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a helper method _package_url_from_ref in CacheStorage to dynamically resolve and normalize the package URL from the uploaded object's reference, specifically handling the translation of grpc+tls:// to grpcs://. It also adds corresponding unit tests. The feedback suggests a cleaner and safer way to replace the protocol prefix using str.replace instead of manual string slicing.

Comment on lines +324 to +325
if endpoint.startswith("grpc+tls://"):
endpoint = f"grpcs://{endpoint[len('grpc+tls://'):]}"
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.

medium

Using manual string slicing with a hardcoded length calculation like endpoint[len('grpc+tls://'):] is more error-prone and less readable than using str.replace with a limit of 1. If the prefix string is ever updated in the future, having to update both the startswith check and the slice length calculation can easily lead to bugs.

Using endpoint.replace("grpc+tls://", "grpcs://", 1) is cleaner and safer.

Suggested change
if endpoint.startswith("grpc+tls://"):
endpoint = f"grpcs://{endpoint[len('grpc+tls://'):]}"
if endpoint.startswith("grpc+tls://"):
endpoint = endpoint.replace("grpc+tls://", "grpcs://", 1)

@k82cn k82cn marked this pull request as ready for review May 31, 2026 02:04
@k82cn k82cn force-pushed the codex/runner-cache-endpoint-release-0.6 branch from 02eabc5 to 065524f Compare May 31, 2026 02:06
@k82cn k82cn merged commit 572dd3f into xflops:release-0.6 May 31, 2026
8 checks passed
@k82cn k82cn deleted the codex/runner-cache-endpoint-release-0.6 branch May 31, 2026 02:28
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.

1 participant