Skip to content

Commit 4be3f27

Browse files
mhotanclaude
andcommitted
fix(app): materialize delayed parameters on the pod_template path
_get_k8s_pod / _serialized_pod_spec built the serve container command from the raw, unmaterialized parameters, so an app that combines a pod_template with a delayed parameter (e.g. model_path=RunOutput(run_name=...)) shipped the unresolved getter to the serve entrypoint, which then couldn't download it (storage.get: "Unable to load data"). The container path (get_proto_container) already passed the materialized parameters; thread them through _get_k8s_pod -> _serialized_pod_spec -> container_cmd so the pod path resolves them too. Delayed values (RunOutput/ArtifactValue) now serialize to their resolved File/Dir URI. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent d8d2e22 commit 4be3f27

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

src/flyte/app/_runtime/app_serde.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ def _serialized_pod_spec(
8888
app_env: AppEnvironment,
8989
pod_template: flyte.PodTemplate,
9090
serialization_context: SerializationContext,
91+
parameter_overrides: list[Parameter] | None = None,
9192
) -> dict:
9293
"""
9394
Convert pod spec into a dict for serialization.
@@ -144,7 +145,12 @@ def _serialized_pod_spec(
144145

145146
if container.name == pod_template.primary_container_name:
146147
container.args = app_env.container_args(serialization_context)
147-
container.command = app_env.container_cmd(serialization_context)
148+
# Pass the materialized parameters (delayed values like RunOutput already
149+
# resolved to their File/Dir URI) so the serve container command carries the
150+
# resolved value — matching the container path (get_proto_container). Without
151+
# this the pod path serializes the raw, unresolved parameter and the serve
152+
# entrypoint can't download it.
153+
container.command = app_env.container_cmd(serialization_context, parameter_overrides)
148154

149155
limits, requests = {}, {}
150156
resources = get_proto_resources(app_env.resources)
@@ -184,6 +190,7 @@ def _get_k8s_pod(
184190
app_env: AppEnvironment,
185191
pod_template: flyte.PodTemplate,
186192
serialization_context: SerializationContext,
193+
parameter_overrides: list[Parameter] | None = None,
187194
) -> tasks_pb2.K8sPod:
188195
"""
189196
Convert pod_template into a K8sPod IDL.
@@ -201,7 +208,7 @@ def _get_k8s_pod(
201208
from google.protobuf.json_format import Parse
202209
from google.protobuf.struct_pb2 import Struct
203210

204-
pod_spec_dict = _serialized_pod_spec(app_env, pod_template, serialization_context)
211+
pod_spec_dict = _serialized_pod_spec(app_env, pod_template, serialization_context, parameter_overrides)
205212
pod_spec_idl = Parse(json.dumps(pod_spec_dict), Struct())
206213

207214
metadata = tasks_pb2.K8sObjectMetadata(
@@ -396,6 +403,7 @@ async def translate_app_env_to_idl(
396403
app_env,
397404
app_env.pod_template,
398405
serialization_context,
406+
parameter_overrides=parameters,
399407
)
400408
elif app_env.image:
401409
container = get_proto_container(

0 commit comments

Comments
 (0)