From 5f874a56de78628403f0756eb423783c0f1144ce Mon Sep 17 00:00:00 2001 From: Tommy Hughes Date: Mon, 3 Mar 2025 09:04:50 -0600 Subject: [PATCH] img size Signed-off-by: Tommy Hughes --- .../operator-e2e-integration-tests.yml | 19 +++++--- Makefile | 6 --- infra/feast-operator/Makefile | 3 +- infra/feast-operator/test/e2e/e2e_test.go | 2 +- .../test/upgrade/upgrade_test.go | 2 +- infra/feast-operator/test/utils/test_util.go | 48 ++++++++++--------- .../feature_servers/multicloud/Dockerfile.dev | 6 ++- 7 files changed, 45 insertions(+), 41 deletions(-) diff --git a/.github/workflows/operator-e2e-integration-tests.yml b/.github/workflows/operator-e2e-integration-tests.yml index 1cb1d4468b4..c23e8095bf7 100644 --- a/.github/workflows/operator-e2e-integration-tests.yml +++ b/.github/workflows/operator-e2e-integration-tests.yml @@ -36,6 +36,17 @@ jobs: - name: Checkout code uses: actions/checkout@v4 + - name: Free Disk Space (Ubuntu) + uses: jlumbroso/free-disk-space@v1.3.1 + with: + android: true + dotnet: true + haskell: true + large-packages: false + docker-images: false + swap-storage: false + tool-cache: false + - name: Set up Go uses: actions/setup-go@v5 with: @@ -49,7 +60,7 @@ jobs: nodes: - role: control-plane extraMounts: - - hostPath: /tmp/kind + - hostPath: /mnt/kind containerPath: /var/lib/containerd EOF @@ -64,12 +75,6 @@ jobs: cd infra/feast-operator/ make test-e2e - - name: Clean up docker images - if: always() - run: | - docker images --format '{{.Repository}}:{{.Tag}}' | grep 'feast' | xargs -r docker rmi -f - docker system prune -a -f - - name: Run Previous version tests run: | # Run the previous version tests diff --git a/Makefile b/Makefile index afc2d34124d..c33685ef2cb 100644 --- a/Makefile +++ b/Makefile @@ -554,12 +554,6 @@ build-feast-operator-docker: # Dev images -build-feature-server-dev-minimal: - docker buildx build \ - -t feastdev/feature-server:dev \ - -f sdk/python/feast/infra/feature_servers/multicloud/Dockerfile \ - --load sdk/python/feast/infra/feature_servers/multicloud - build-feature-server-dev: docker buildx build \ -t feastdev/feature-server:dev \ diff --git a/infra/feast-operator/Makefile b/infra/feast-operator/Makefile index 4080e4cf1aa..cde9f87982a 100644 --- a/infra/feast-operator/Makefile +++ b/infra/feast-operator/Makefile @@ -162,8 +162,7 @@ docker-build: ## Build docker image with the manager. ## Build feast docker image. .PHONY: feast-ci-dev-docker-img feast-ci-dev-docker-img: - cd ./../.. && make build-feature-server-dev-minimal - + cd ./../.. && make build-feature-server-dev .PHONY: docker-push docker-push: ## Push docker image with the manager. diff --git a/infra/feast-operator/test/e2e/e2e_test.go b/infra/feast-operator/test/e2e/e2e_test.go index e0a8bd647dc..d1051900ae5 100644 --- a/infra/feast-operator/test/e2e/e2e_test.go +++ b/infra/feast-operator/test/e2e/e2e_test.go @@ -40,7 +40,7 @@ var _ = Describe("controller", Ordered, func() { featureStoreName, feastResourceName, feastK8sResourceNames) BeforeAll(func() { - utils.DeployOperatorFromCode("/test/e2e") + utils.DeployOperatorFromCode("/test/e2e", false) }) AfterAll(func() { diff --git a/infra/feast-operator/test/upgrade/upgrade_test.go b/infra/feast-operator/test/upgrade/upgrade_test.go index 58b858d1850..313fa41213c 100644 --- a/infra/feast-operator/test/upgrade/upgrade_test.go +++ b/infra/feast-operator/test/upgrade/upgrade_test.go @@ -24,7 +24,7 @@ import ( var _ = Describe("operator upgrade", Ordered, func() { BeforeAll(func() { utils.DeployPreviousVersionOperator() - utils.DeployOperatorFromCode("/test/e2e") + utils.DeployOperatorFromCode("/test/e2e", true) }) AfterAll(func() { diff --git a/infra/feast-operator/test/utils/test_util.go b/infra/feast-operator/test/utils/test_util.go index 069219860a6..b34c4272c46 100644 --- a/infra/feast-operator/test/utils/test_util.go +++ b/infra/feast-operator/test/utils/test_util.go @@ -350,7 +350,7 @@ func fixRemoteFeastK8sResourceNames(feastK8sResourceNames []string, remoteFeastR } // DeployOperatorFromCode - Creates the images for the operator and deploys it -func DeployOperatorFromCode(testDir string) { +func DeployOperatorFromCode(testDir string, skipBuilds bool) { _, isRunOnOpenShiftCI := os.LookupEnv("RUN_ON_OPENSHIFT_CI") if !isRunOnOpenShiftCI { By("creating manager namespace") @@ -361,32 +361,34 @@ func DeployOperatorFromCode(testDir string) { // projectimage stores the name of the image used in the example var projectimage = "localhost/feast-operator:v0.0.1" - By("building the manager(Operator) image") - cmd = exec.Command("make", "docker-build", fmt.Sprintf("IMG=%s", projectimage)) - _, err = Run(cmd, testDir) - ExpectWithOffset(1, err).NotTo(HaveOccurred()) - - By("loading the the manager(Operator) image on Kind") - err = LoadImageToKindClusterWithName(projectimage, testDir) - ExpectWithOffset(1, err).NotTo(HaveOccurred()) - // this image will be built in above make target. var feastImage = "feastdev/feature-server:dev" var feastLocalImage = "localhost/feastdev/feature-server:dev" - By("building the feast image") - cmd = exec.Command("make", "feast-ci-dev-docker-img") - _, err = Run(cmd, testDir) - ExpectWithOffset(1, err).NotTo(HaveOccurred()) - - By("Tag the local feast image for the integration tests") - cmd = exec.Command("docker", "image", "tag", feastImage, feastLocalImage) - _, err = Run(cmd, testDir) - ExpectWithOffset(1, err).NotTo(HaveOccurred()) - - By("loading the the feast image on Kind cluster") - err = LoadImageToKindClusterWithName(feastLocalImage, testDir) - ExpectWithOffset(1, err).NotTo(HaveOccurred()) + if !skipBuilds { + By("building the manager(Operator) image") + cmd = exec.Command("make", "docker-build", fmt.Sprintf("IMG=%s", projectimage)) + _, err = Run(cmd, testDir) + ExpectWithOffset(1, err).NotTo(HaveOccurred()) + + By("loading the the manager(Operator) image on Kind") + err = LoadImageToKindClusterWithName(projectimage, testDir) + ExpectWithOffset(1, err).NotTo(HaveOccurred()) + + By("building the feast image") + cmd = exec.Command("make", "feast-ci-dev-docker-img") + _, err = Run(cmd, testDir) + ExpectWithOffset(1, err).NotTo(HaveOccurred()) + + By("Tag the local feast image for the integration tests") + cmd = exec.Command("docker", "image", "tag", feastImage, feastLocalImage) + _, err = Run(cmd, testDir) + ExpectWithOffset(1, err).NotTo(HaveOccurred()) + + By("loading the the feast image on Kind cluster") + err = LoadImageToKindClusterWithName(feastLocalImage, testDir) + ExpectWithOffset(1, err).NotTo(HaveOccurred()) + } By("installing CRDs") cmd = exec.Command("make", "install") diff --git a/sdk/python/feast/infra/feature_servers/multicloud/Dockerfile.dev b/sdk/python/feast/infra/feature_servers/multicloud/Dockerfile.dev index f5cef2ad9f3..31ac4a6366a 100644 --- a/sdk/python/feast/infra/feature_servers/multicloud/Dockerfile.dev +++ b/sdk/python/feast/infra/feature_servers/multicloud/Dockerfile.dev @@ -4,7 +4,11 @@ USER 0 RUN npm install -g yarn yalc && rm -rf .npm USER default -COPY --chown=default . ${APP_ROOT}/src +COPY --chown=default .git ${APP_ROOT}/src/.git +COPY --chown=default setup.py pyproject.toml README.md Makefile ${APP_ROOT}/src/ +COPY --chown=default protos ${APP_ROOT}/src/protos +COPY --chown=default ui ${APP_ROOT}/src/ui +COPY --chown=default sdk/python ${APP_ROOT}/src/sdk/python WORKDIR ${APP_ROOT}/src/ui RUN npm install && \