Commit dee80d18 authored by ishandhanani's avatar ishandhanani Committed by GitHub
Browse files

fix: set env vars before worker spawn (#583)

parent 34be4418
......@@ -73,12 +73,7 @@ def main(
dynamo_context["runner_map"] = runner_map
dynamo_context["worker_id"] = worker_id
# Import service first to check configuration
service = import_service(bento_identifier)
if service_name and service_name != service.name:
service = service.find_dependent_by_name(service_name)
# Handle worker environment if specified
# Ensure environment variables are set before we initialize
if worker_env:
env_list: list[dict[str, t.Any]] = json.loads(worker_env)
if worker_id is not None:
......@@ -90,6 +85,10 @@ def main(
)
os.environ.update(env_list[worker_key])
service = import_service(bento_identifier)
if service_name and service_name != service.name:
service = service.find_dependent_by_name(service_name)
configure_server_logging()
if runner_map:
BentoMLContainer.remote_runner_mapping.set(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment