Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
ECR_AWS_PROFILE: str = os.getenv("ECR_READ_AWS_PROFILE", "default") # type: ignore
GIT_TAG: str = os.getenv("GIT_TAG") # type: ignore
ENV: str = os.getenv("DD_ENV") # type: ignore
WORKSPACE_PATH = os.getenv("WORKSPACE", ".")

INITIAL_K8S_CACHE_TTL_SECONDS: int = 60
MAX_IMAGE_TAG_LEN = 128
Expand Down Expand Up @@ -494,15 +495,14 @@ def get_base_image_params(

# The context should be whatever WORKDIR is in the container running the build app itself.
inference_folder = "model-engine/model_engine_server/inference"
base_path: str = os.getenv("WORKSPACE") # type: ignore

logger_adapter.info(f"inference_folder: {inference_folder}")
logger_adapter.info(f"dockerfile: {inference_folder}/{dockerfile}")
return BuildImageRequest(
repo=hmi_config.user_inference_base_repository,
image_tag=resulting_image_tag[:MAX_IMAGE_TAG_LEN],
aws_profile=ECR_AWS_PROFILE, # type: ignore
base_path=base_path,
base_path=WORKSPACE_PATH,
dockerfile=f"{inference_folder}/{dockerfile}",
base_image=base_image,
requirements_folder=None,
Expand Down Expand Up @@ -557,9 +557,7 @@ def _get_user_image_params(

# The context should be whatever WORKDIR is in the container running the build app itself.
inference_folder = "model-engine/model_engine_server/inference"
base_path: str = os.getenv("WORKSPACE") # type: ignore

requirements_folder = os.path.join(base_path, f"requirements_{requirements_hash}")
requirements_folder = os.path.join(WORKSPACE_PATH, f"requirements_{requirements_hash}")
try:
os.mkdir(requirements_folder)
except FileExistsError:
Expand All @@ -577,7 +575,7 @@ def _get_user_image_params(
repo=ecr_repo,
image_tag=service_image_tag[:MAX_IMAGE_TAG_LEN],
aws_profile=ECR_AWS_PROFILE,
base_path=base_path,
base_path=WORKSPACE_PATH,
dockerfile=f"{inference_folder}/{dockerfile}",
base_image=base_image,
requirements_folder=requirements_folder,
Expand Down Expand Up @@ -609,9 +607,7 @@ def _get_inject_bundle_image_params(
# The context should be whatever WORKDIR is in the container running the build app itself.
dockerfile = "inject_bundle.Dockerfile"
inference_folder = "model-engine/model_engine_server/inference"
base_path: str = os.getenv("WORKSPACE") # type: ignore

bundle_folder = os.path.join(base_path, f"bundle_{service_image_hash}")
bundle_folder = os.path.join(WORKSPACE_PATH, f"bundle_{service_image_hash}")
try:
os.mkdir(bundle_folder)
except FileExistsError:
Expand All @@ -635,7 +631,7 @@ def _get_inject_bundle_image_params(
repo=ecr_repo,
image_tag=service_image_tag[:MAX_IMAGE_TAG_LEN],
aws_profile=ECR_AWS_PROFILE,
base_path=base_path,
base_path=WORKSPACE_PATH,
dockerfile=f"{inference_folder}/{dockerfile}",
base_image=base_image,
requirements_folder=bundle_folder,
Expand Down
4 changes: 2 additions & 2 deletions model-engine/requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ azure-storage-blob~=12.19.0
boto3-stubs[essential]~=1.26.67
boto3~=1.21
botocore~=1.24
build==0.8.0
build~=1.0.3
celery[redis,sqs,tblib]~=5.3.6
click~=8.1
cloudpickle==2.1.0
Expand All @@ -37,7 +37,7 @@ protobuf~=3.20
psycopg2-binary==2.9.3
py-xid==0.3.0
pycurl~=7.44 # For celery[sqs]
pydantic~=1.10.11
pydantic==1.10.14
python-multipart~=0.0.7
quart==0.18.3
requests-auth-aws-sigv4~=0.7
Expand Down
Loading