Skip to content

CmampTask12104_Improve_release_flow_of_prod_image_for_runnable_dir #669

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open
3 changes: 2 additions & 1 deletion devops/docker_build/prod.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
#
ARG VERSION
ARG ECR_BASE_PATH
FROM ${ECR_BASE_PATH}/helpers:dev-${VERSION}
ARG IMAGE_NAME
FROM ${ECR_BASE_PATH}/${IMAGE_NAME}:dev-${VERSION}

RUN ls .
COPY . /app
9 changes: 8 additions & 1 deletion helpers/lib_tasks_docker_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -800,6 +800,12 @@ def docker_build_prod_image( # type: ignore
opts = "--no-cache" if not cache else ""
# Use dev version for building prod image.
dev_version = hlitadoc.to_dev_version(prod_version)
image_name = hrecouti.get_repo_config().get_docker_base_image_name()
hdbg.dassert(
not hgit.is_inside_submodule(),
"The build should be run from a super repo, not a submodule.",
)
git_root_dir = hgit.find_git_root()
cmd = rf"""
DOCKER_BUILDKIT={DOCKER_BUILDKIT} \
time \
Expand All @@ -809,7 +815,8 @@ def docker_build_prod_image( # type: ignore
--file {dockerfile} \
--build-arg VERSION={dev_version} \
--build-arg ECR_BASE_PATH={os.environ["CSFY_ECR_BASE_PATH"]} \
.
--build-arg IMAGE_NAME={image_name} \
{git_root_dir}
"""
hlitauti.run(ctx, cmd)
if candidate:
Expand Down
Loading