From 632b2c2d563146801d218dece4a1b58b9fb26d38 Mon Sep 17 00:00:00 2001 From: Eduardo Apolinario <653394+eapolinario@users.noreply.github.com> Date: Wed, 6 Mar 2024 07:23:02 -0800 Subject: [PATCH] Simpler dev images (#2243) --- Dockerfile.dev | 7 ++++--- Makefile | 8 ++++++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/Dockerfile.dev b/Dockerfile.dev index 63019e5e38..cfc45f4708 100644 --- a/Dockerfile.dev +++ b/Dockerfile.dev @@ -14,7 +14,8 @@ LABEL org.opencontainers.image.source=https://github.com/flyteorg/flytekit WORKDIR /root ENV FLYTE_SDK_RICH_TRACEBACKS 0 -ARG VERSION +# Flytekit version of flytekit to be installed in the image +ARG PSEUDO_VERSION COPY . /flytekit @@ -28,8 +29,8 @@ COPY . /flytekit # 3. Clean up the apt cache to reduce image size. Reference: https://gist.github.com/marvell/7c812736565928e602c4 # 4. Create a non-root user 'flytekit' and set appropriate permissions for directories. RUN apt-get update && apt-get install build-essential vim libmagic1 git -y \ - && pip install "git+https://github.com/flyteorg/flyte.git@master#subdirectory=flyteidl" \ - && pip install --no-cache-dir -U --pre \ + && SETUPTOOLS_SCM_PRETEND_VERSION_FOR_FLYTEKIT=$PSEUDO_VERSION pip install --no-cache-dir -U \ + "git+https://github.com/flyteorg/flyte.git@master#subdirectory=flyteidl" \ -e /flytekit \ -e /flytekit/plugins/flytekit-k8s-pod \ -e /flytekit/plugins/flytekit-deck-standard \ diff --git a/Makefile b/Makefile index fa245479dd..859b0aaf44 100644 --- a/Makefile +++ b/Makefile @@ -104,3 +104,11 @@ requirements: doc-requirements.txt ${MOCK_FLYTE_REPO}/requirements.txt ## Compil coverage: coverage run -m pytest tests/flytekit/unit/core flytekit/types -m "not sandbox_test" coverage report -m --include="flytekit/core/*,flytekit/types/*" + +.PHONY: build-dev +build-dev: export PLATFORM ?= linux/arm64 +build-dev: export REGISTRY ?= localhost:30000 +build-dev: export PYTHON_VERSION ?= 3.12 +build-dev: export PSEUDO_VERSION ?= $(shell python -m setuptools_scm) +build-dev: + docker build --platform ${PLATFORM} --push . -f Dockerfile.dev -t ${REGISTRY}/flytekit:${TAG} --build-arg PYTHON_VERSION=${PYTHON_VERSION} --build-arg PSEUDO_VERSION=${PSEUDO_VERSION}