abundant-tent-27407
05/15/2024, 8:28 AMmultiprocess
. I build separate pex binaries for dependencies and source files. I then create and combine oci_layer
's to form an image and execute the pex binary as follows. If I install the missing libraries in the global python environment the code will run, which leads me to believe when the process is spawned it doesn't use the pex environment/dependencies. Any clues on what I might be doing wrong? Code in threadabundant-tent-27407
05/15/2024, 8:28 AMpex_binary(
name="deps",
entry_point="run.py",
complete_platforms=["//:platforms"],
layout="packed",
include_sources=False,
include_tools=True,
)
oci_layer(name="deps-layer", packages=[":deps"])
# Create pex layer for python source code
pex_binary(
name="srcs",
entry_point="run.py",
complete_platforms=["//:platforms"],
layout="packed",
include_requirements=False,
include_tools=True,
)
oci_layer(name="srcs-layer", packages=[":srcs"])
oci_image_build(
name="image",
layers=[":deps-layer", ":srcs-layer"],
base=["//:python-bookworm-slim-amd"],
repository=env("REPOSITORY", "") + "datascience/xgboost", # Required to publish
tag=env("GIT_SHA", "latest"), # Required to publish
entrypoint="python3",
args=[dirctory_no_slash + "/srcs.pex"],
env=[
"PEX_PATH=/" + dirctory_no_slash + "/srcs.pex:/" + dirctory_no_slash + "/deps.pex",
],
)
gorgeous-winter-99296
05/15/2024, 9:41 AMfork
or spawn
?abundant-tent-27407
05/15/2024, 9:42 AMabundant-tent-27407
05/15/2024, 9:42 AMgorgeous-winter-99296
05/15/2024, 10:03 AMabundant-tent-27407
05/15/2024, 10:04 AMgorgeous-winter-99296
05/15/2024, 10:05 AMabundant-tent-27407
05/15/2024, 11:03 AMgorgeous-winter-99296
05/15/2024, 11:09 AMgorgeous-winter-99296
05/15/2024, 11:11 AMabundant-tent-27407
05/15/2024, 11:15 AMgorgeous-winter-99296
05/15/2024, 11:41 AMabundant-tent-27407
05/15/2024, 12:16 PM