From eb474483a46ab7a61b0ea4decb8b7d3dd44ea015 Mon Sep 17 00:00:00 2001 From: Matthias Richter Date: Fri, 26 Jan 2024 14:54:48 +0100 Subject: [PATCH 01/13] Enable build of fondant dev base image --- .github/workflows/build.yaml | 2 +- scripts/build_base_image.sh | 26 +++++++++++++++++++++----- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index a8b70043..9990e660 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -55,4 +55,4 @@ jobs: run: ./scripts/build_components.sh --cache -t $GITHUB_SHA -t dev - name: Build base image - run: ./scripts/build_base_image.sh -t $GITHUB_SHA + run: ./scripts/build_base_image.sh -t $GITHUB_SHA -t dev diff --git a/scripts/build_base_image.sh b/scripts/build_base_image.sh index 8ed04fc0..2f74dfb6 100755 --- a/scripts/build_base_image.sh +++ b/scripts/build_base_image.sh @@ -4,30 +4,46 @@ set -e function usage { echo "Usage: $0 [options]" echo "Options:" - echo " -t, --tag Set the tag (default: latest)" + echo " -t, --tag Tag to add to image, repeatable" echo " -h, --help Display this help message" } # Parse the arguments while [[ "$#" -gt 0 ]]; do case $1 in - -t|--tag) tag="$2"; shift;; + -t |--tag) tags+=("$2"); shift;; -h|--help) usage; exit;; *) echo "Unknown parameter passed: $1"; exit 1;; esac; shift; done +# Check for required argument +if [ -z "${tags}" ]; then + echo "Error: tag parameter is required" + usage + exit 1 +fi + # Supported Python versions python_versions=("3.8" "3.9" "3.10" "3.11") for python_version in "${python_versions[@]}"; do BASENAME=fondant - IMAGE_TAG=${tag}-py${python_version} + + image_tags=() + echo "Tagging image with following tags:" + for tag in "${tags[@]}"; do + image_tags+=("${tag}-py${python_version}") + done + full_image_names=() # create repo if not exists aws ecr-public describe-repositories --region us-east-1 --repository-names ${BASENAME} || aws ecr-public create-repository --region us-east-1 --repository-name ${BASENAME} - full_image_names+=("public.ecr.aws/fndnt/${BASENAME}:${IMAGE_TAG}") - full_image_names+=("fndnt/${BASENAME}:${IMAGE_TAG}") + + for image_tag in "${image_tags[@]}"; do + full_image_names+=("public.ecr.aws/fndnt/${BASENAME}:${image_tag}") + full_image_names+=("fndnt/${BASENAME}:${image_tag}") + done # Add argument for each tag for image_name in "${full_image_names[@]}" ; do From 5660192df94d68f038528351b4ca3d725c5ad110 Mon Sep 17 00:00:00 2001 From: Matthias Richter Date: Mon, 29 Jan 2024 16:57:43 +0100 Subject: [PATCH 02/13] Use dev tag instead of 0.1.dev0 --- src/fondant/pipeline/lightweight_component.py | 2 ++ tests/pipeline/test_python_component.py | 3 +++ 2 files changed, 5 insertions(+) diff --git a/src/fondant/pipeline/lightweight_component.py b/src/fondant/pipeline/lightweight_component.py index c45079b8..8d2ffc7a 100644 --- a/src/fondant/pipeline/lightweight_component.py +++ b/src/fondant/pipeline/lightweight_component.py @@ -53,6 +53,8 @@ def resolve_fndnt_base_image(): python_version = f"{MAX_PYTHON_VERSION[0]}.{MAX_PYTHON_VERSION[1]}" fondant_version = version("fondant") + if fondant_version == "0.1.dev0": + fondant_version = "dev" basename = "fndnt/fondant" return f"{basename}:{fondant_version}-py{python_version}" diff --git a/tests/pipeline/test_python_component.py b/tests/pipeline/test_python_component.py index 40b7eb3a..527ac9bb 100644 --- a/tests/pipeline/test_python_component.py +++ b/tests/pipeline/test_python_component.py @@ -18,6 +18,9 @@ def default_fondant_image(): basename = "fndnt/fondant" fondant_version = version("fondant") + if fondant_version == "0.1.dev0": + fondant_version = "dev" + python_version = sys.version_info python_version = f"{python_version.major}.{python_version.minor}" return f"{basename}:{fondant_version}-py{python_version}" From c12afb1d7bfb729189d7e45b5a4130a05eb50f36 Mon Sep 17 00:00:00 2001 From: Matthias Richter Date: Tue, 30 Jan 2024 09:40:49 +0100 Subject: [PATCH 03/13] Use correct fondant version for build --- .github/workflows/build.yaml | 2 +- .github/workflows/prep-release.yaml | 2 +- scripts/build_base_image.sh | 32 ++++++++--------------------- 3 files changed, 11 insertions(+), 25 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 9990e660..59e1fda3 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -55,4 +55,4 @@ jobs: run: ./scripts/build_components.sh --cache -t $GITHUB_SHA -t dev - name: Build base image - run: ./scripts/build_base_image.sh -t $GITHUB_SHA -t dev + run: ./scripts/build_base_image.sh -t $GITHUB_SHA -t dev -v $GITHUB_SHA diff --git a/.github/workflows/prep-release.yaml b/.github/workflows/prep-release.yaml index 1217e142..4ffb6dba 100644 --- a/.github/workflows/prep-release.yaml +++ b/.github/workflows/prep-release.yaml @@ -63,7 +63,7 @@ jobs: run: ./scripts/build_explorer.sh -t $GITHUB_REF_NAME - name: Build base image - run: ./scripts/build_base_image.sh -t $GITHUB_REF_NAME + run: ./scripts/build_base_image.sh -t $GITHUB_REF_NAME -v $GITHUB_SHA - name: Update version in pyproject.toml with tag version run: sed -i "s/^version = .*/version = '${{github.ref_name}}'/" pyproject.toml diff --git a/scripts/build_base_image.sh b/scripts/build_base_image.sh index 2f74dfb6..81073c69 100755 --- a/scripts/build_base_image.sh +++ b/scripts/build_base_image.sh @@ -4,46 +4,32 @@ set -e function usage { echo "Usage: $0 [options]" echo "Options:" - echo " -t, --tag Tag to add to image, repeatable" + echo " -t, --tag Set the tag (default: latest)" + echo " -v, --version Fondant version" echo " -h, --help Display this help message" } # Parse the arguments while [[ "$#" -gt 0 ]]; do case $1 in - -t |--tag) tags+=("$2"); shift;; + -t|--tag) tag="$2"; shift;; + -v|--version) version="$2"; shift;; -h|--help) usage; exit;; *) echo "Unknown parameter passed: $1"; exit 1;; esac; shift; done -# Check for required argument -if [ -z "${tags}" ]; then - echo "Error: tag parameter is required" - usage - exit 1 -fi - # Supported Python versions python_versions=("3.8" "3.9" "3.10" "3.11") for python_version in "${python_versions[@]}"; do BASENAME=fondant - - image_tags=() - echo "Tagging image with following tags:" - for tag in "${tags[@]}"; do - image_tags+=("${tag}-py${python_version}") - done - + IMAGE_TAG=${tag}-py${python_version} full_image_names=() # create repo if not exists aws ecr-public describe-repositories --region us-east-1 --repository-names ${BASENAME} || aws ecr-public create-repository --region us-east-1 --repository-name ${BASENAME} - - for image_tag in "${image_tags[@]}"; do - full_image_names+=("public.ecr.aws/fndnt/${BASENAME}:${image_tag}") - full_image_names+=("fndnt/${BASENAME}:${image_tag}") - done + full_image_names+=("public.ecr.aws/fndnt/${BASENAME}:${IMAGE_TAG}") + full_image_names+=("fndnt/${BASENAME}:${IMAGE_TAG}") # Add argument for each tag for image_name in "${full_image_names[@]}" ; do @@ -57,7 +43,7 @@ for python_version in "${python_versions[@]}"; do # Build docker images and push to docker hub docker build --push "${args[@]}" \ --build-arg="PYTHON_VERSION=${python_version}" \ - --build-arg="FONDANT_VERSION=${tag}" \ + --build-arg="FONDANT_VERSION=${version}" \ -f "images/Dockerfile" \ . -done +done \ No newline at end of file From 24637ab6cb112db3323c606ae0de3b217ad68710 Mon Sep 17 00:00:00 2001 From: Matthias Richter Date: Tue, 30 Jan 2024 09:41:34 +0100 Subject: [PATCH 04/13] Run pipeline --- .github/workflows/build.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 59e1fda3..3becd3de 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -4,6 +4,7 @@ on: push: branches: - main + pull_request: workflow_dispatch: env: From 9de3f0ef2d40656ba4f728dc56ee940fc0db0d8f Mon Sep 17 00:00:00 2001 From: Matthias Richter Date: Tue, 30 Jan 2024 09:45:44 +0100 Subject: [PATCH 05/13] Run pipeline --- .github/workflows/build.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 3becd3de..94c86de6 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -52,8 +52,8 @@ jobs: with: registry-type: public - - name: Build components - run: ./scripts/build_components.sh --cache -t $GITHUB_SHA -t dev + #- name: Build components + # run: ./scripts/build_components.sh --cache -t $GITHUB_SHA -t dev - name: Build base image run: ./scripts/build_base_image.sh -t $GITHUB_SHA -t dev -v $GITHUB_SHA From c8afdc842e4dec8a6e8f59d8caecd0c04db773fb Mon Sep 17 00:00:00 2001 From: Matthias Richter Date: Tue, 30 Jan 2024 10:06:43 +0100 Subject: [PATCH 06/13] Revert pipeline run on pr --- .github/workflows/build.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 94c86de6..59e1fda3 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -4,7 +4,6 @@ on: push: branches: - main - pull_request: workflow_dispatch: env: @@ -52,8 +51,8 @@ jobs: with: registry-type: public - #- name: Build components - # run: ./scripts/build_components.sh --cache -t $GITHUB_SHA -t dev + - name: Build components + run: ./scripts/build_components.sh --cache -t $GITHUB_SHA -t dev - name: Build base image run: ./scripts/build_base_image.sh -t $GITHUB_SHA -t dev -v $GITHUB_SHA From 55939242ec86f179cae9de26d0e11dc78f73b088 Mon Sep 17 00:00:00 2001 From: Matthias Richter Date: Tue, 30 Jan 2024 10:50:39 +0100 Subject: [PATCH 07/13] Fixing tests --- tests/pipeline/test_pipeline.py | 18 ++++++++---------- tests/pipeline/test_python_component.py | 24 +++++------------------- 2 files changed, 13 insertions(+), 29 deletions(-) diff --git a/tests/pipeline/test_pipeline.py b/tests/pipeline/test_pipeline.py index 48abf51e..4a489628 100644 --- a/tests/pipeline/test_pipeline.py +++ b/tests/pipeline/test_pipeline.py @@ -1,7 +1,5 @@ """Fondant pipelines test.""" import copy -import sys -from importlib.metadata import version from pathlib import Path import dask.dataframe as dd @@ -13,7 +11,13 @@ from fondant.core.component_spec import ComponentSpec from fondant.core.exceptions import InvalidPipelineDefinition from fondant.core.schema import Field, Type -from fondant.pipeline import ComponentOp, Pipeline, Resources, lightweight_component +from fondant.pipeline import ( + ComponentOp, + Image, + Pipeline, + Resources, + lightweight_component, +) valid_pipeline_path = Path(__file__).parent / "examples/pipelines/valid_pipeline" invalid_pipeline_path = Path(__file__).parent / "examples/pipelines/invalid_pipeline" @@ -85,16 +89,10 @@ def load(self) -> dd.DataFrame: ) return dd.from_pandas(df, npartitions=1) - basename = "fndnt/fondant" - fondant_version = version("fondant") - python_version = sys.version_info - python_version = f"{python_version.major}.{python_version.minor}" - fondant_image_name = f"{basename}:{fondant_version}-py{python_version}" - component = ComponentOp.from_ref(Foo, produces={"bar": pa.string()}) assert component.component_spec._specification == { "name": "foo", - "image": fondant_image_name, + "image": Image.resolve_fndnt_base_image(), "description": "lightweight component", "consumes": {"additionalProperties": True}, "produces": {"additionalProperties": True}, diff --git a/tests/pipeline/test_python_component.py b/tests/pipeline/test_python_component.py index b55f0974..04862396 100644 --- a/tests/pipeline/test_python_component.py +++ b/tests/pipeline/test_python_component.py @@ -1,8 +1,6 @@ import json import re -import sys import textwrap -from importlib.metadata import version import dask.dataframe as dd import pandas as pd @@ -10,22 +8,10 @@ import pytest from fondant.component import DaskLoadComponent, PandasTransformComponent from fondant.core.exceptions import InvalidLightweightComponent -from fondant.pipeline import Pipeline, lightweight_component +from fondant.pipeline import Image, Pipeline, lightweight_component from fondant.pipeline.compiler import DockerCompiler -@pytest.fixture() -def default_fondant_image(): - basename = "fndnt/fondant" - fondant_version = version("fondant") - if fondant_version == "0.1.dev0": - fondant_version = "dev" - - python_version = sys.version_info - python_version = f"{python_version.major}.{python_version.minor}" - return f"{basename}:{fondant_version}-py{python_version}" - - def test_build_python_script(): @lightweight_component() class CreateData(DaskLoadComponent): @@ -65,7 +51,7 @@ def load(self) -> dd.DataFrame: ) -def test_lightweight_component_sdk(default_fondant_image, caplog): +def test_lightweight_component_sdk(caplog): pipeline = Pipeline( name="dummy-pipeline", base_path="./data", @@ -142,7 +128,7 @@ def transform(self, dataframe: pd.DataFrame) -> pd.DataFrame: assert operation_spec_dict == { "specification": { "name": "addn", - "image": default_fondant_image, + "image": Image.resolve_fndnt_base_image(), "description": "lightweight component", "consumes": {"additionalProperties": True}, "produces": {"additionalProperties": True}, @@ -271,7 +257,7 @@ def load(self) -> int: CreateData(produces={}, consumes={}) -def test_lightweight_component_decorator_without_parentheses(default_fondant_image): +def test_lightweight_component_decorator_without_parentheses(): @lightweight_component class CreateData(DaskLoadComponent): def load(self) -> dd.DataFrame: @@ -293,7 +279,7 @@ def load(self) -> dd.DataFrame: assert operation_spec_without_image == { "specification": { "name": "createdata", - "image": default_fondant_image, + "image": Image.resolve_fndnt_base_image(), "description": "lightweight component", "consumes": {"additionalProperties": True}, "produces": {"additionalProperties": True}, From 7ca8b4f28ee46e24b2ee0999774e01ca5f6d4f85 Mon Sep 17 00:00:00 2001 From: Matthias Richter Date: Tue, 30 Jan 2024 11:37:39 +0100 Subject: [PATCH 08/13] Adding test for fndnt base image resolution --- tests/pipeline/test_python_component.py | 32 +++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/tests/pipeline/test_python_component.py b/tests/pipeline/test_python_component.py index 04862396..2ee8496c 100644 --- a/tests/pipeline/test_python_component.py +++ b/tests/pipeline/test_python_component.py @@ -1,6 +1,9 @@ import json import re +import sys import textwrap +from dataclasses import dataclass +from unittest import mock import dask.dataframe as dd import pandas as pd @@ -287,3 +290,32 @@ def load(self) -> dd.DataFrame: "consumes": {}, "produces": {}, } + + +@dataclass +class MockSysVersionInfo: + major: int + minor: int + micro: int + + def __lt__(self, other): + return (self.major, self.minor, self.micro) <= other + + def __ge__(self, other): + return other < (self.major, self.minor, self.micro) + + +def test_fndnt_base_image_resolution(): + # Base image version is set to python version + with mock.patch.object(sys, "version_info", MockSysVersionInfo(3, 10, 0)): + base_image_name = Image.resolve_fndnt_base_image() + assert base_image_name == "fndnt/fondant:dev-py3.10" + + # Local python version is not supported + with mock.patch.object(sys, "version_info", MockSysVersionInfo(3, 12, 0)): + base_image_name = Image.resolve_fndnt_base_image() + assert base_image_name == "fndnt/fondant:dev-py3.11" + + with mock.patch.object(sys, "version_info", MockSysVersionInfo(3, 7, 0)): + base_image_name = Image.resolve_fndnt_base_image() + assert base_image_name == "fndnt/fondant:dev-py3.11" From 5fc0d706948c581720f7236751b778621a0e0863 Mon Sep 17 00:00:00 2001 From: Matthias Richter Date: Tue, 30 Jan 2024 13:45:43 +0100 Subject: [PATCH 09/13] Addressing comments --- .github/workflows/build.yaml | 7 ++++--- .github/workflows/prep-release.yaml | 2 +- scripts/build_base_image.sh | 13 ++++++------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 59e1fda3..d82e49aa 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -4,6 +4,7 @@ on: push: branches: - main + pull_request: workflow_dispatch: env: @@ -51,8 +52,8 @@ jobs: with: registry-type: public - - name: Build components - run: ./scripts/build_components.sh --cache -t $GITHUB_SHA -t dev + #- name: Build components + # run: ./scripts/build_components.sh --cache -t $GITHUB_SHA -t dev - name: Build base image - run: ./scripts/build_base_image.sh -t $GITHUB_SHA -t dev -v $GITHUB_SHA + run: ./scripts/build_base_image.sh -t $GITHUB_SHA -t dev diff --git a/.github/workflows/prep-release.yaml b/.github/workflows/prep-release.yaml index 4ffb6dba..1217e142 100644 --- a/.github/workflows/prep-release.yaml +++ b/.github/workflows/prep-release.yaml @@ -63,7 +63,7 @@ jobs: run: ./scripts/build_explorer.sh -t $GITHUB_REF_NAME - name: Build base image - run: ./scripts/build_base_image.sh -t $GITHUB_REF_NAME -v $GITHUB_SHA + run: ./scripts/build_base_image.sh -t $GITHUB_REF_NAME - name: Update version in pyproject.toml with tag version run: sed -i "s/^version = .*/version = '${{github.ref_name}}'/" pyproject.toml diff --git a/scripts/build_base_image.sh b/scripts/build_base_image.sh index 81073c69..45c13f2f 100755 --- a/scripts/build_base_image.sh +++ b/scripts/build_base_image.sh @@ -5,14 +5,12 @@ function usage { echo "Usage: $0 [options]" echo "Options:" echo " -t, --tag Set the tag (default: latest)" - echo " -v, --version Fondant version" echo " -h, --help Display this help message" } # Parse the arguments while [[ "$#" -gt 0 ]]; do case $1 in - -t|--tag) tag="$2"; shift;; - -v|--version) version="$2"; shift;; + -t|--tag) tags+=("$2"); shift;; -h|--help) usage; exit;; *) echo "Unknown parameter passed: $1"; exit 1;; esac; shift; done @@ -20,8 +18,8 @@ esac; shift; done # Supported Python versions python_versions=("3.8" "3.9" "3.10" "3.11") - -for python_version in "${python_versions[@]}"; do +for tag in "${tags[@]}"; do + for python_version in "${python_versions[@]}"; do BASENAME=fondant IMAGE_TAG=${tag}-py${python_version} full_image_names=() @@ -43,7 +41,8 @@ for python_version in "${python_versions[@]}"; do # Build docker images and push to docker hub docker build --push "${args[@]}" \ --build-arg="PYTHON_VERSION=${python_version}" \ - --build-arg="FONDANT_VERSION=${version}" \ + --build-arg="FONDANT_VERSION=${tags[0]}" \ -f "images/Dockerfile" \ . -done \ No newline at end of file + done +done From 08bf0ecfd83dac35193c4b65de751e582a994515 Mon Sep 17 00:00:00 2001 From: Matthias Richter Date: Tue, 30 Jan 2024 14:08:13 +0100 Subject: [PATCH 10/13] Add tests for python version --- src/fondant/pipeline/lightweight_component.py | 4 ++-- tests/pipeline/test_python_component.py | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/fondant/pipeline/lightweight_component.py b/src/fondant/pipeline/lightweight_component.py index 959e2e0b..15798da3 100644 --- a/src/fondant/pipeline/lightweight_component.py +++ b/src/fondant/pipeline/lightweight_component.py @@ -6,7 +6,7 @@ import typing as t from dataclasses import asdict, dataclass from functools import wraps -from importlib.metadata import version +from importlib import metadata from fondant.component import BaseComponent, Component @@ -52,7 +52,7 @@ def resolve_fndnt_base_image(): else: python_version = f"{MAX_PYTHON_VERSION[0]}.{MAX_PYTHON_VERSION[1]}" - fondant_version = version("fondant") + fondant_version = metadata.version("fondant") if fondant_version == "0.1.dev0": fondant_version = "dev" basename = "fndnt/fondant" diff --git a/tests/pipeline/test_python_component.py b/tests/pipeline/test_python_component.py index 2ee8496c..2ac62edb 100644 --- a/tests/pipeline/test_python_component.py +++ b/tests/pipeline/test_python_component.py @@ -319,3 +319,12 @@ def test_fndnt_base_image_resolution(): with mock.patch.object(sys, "version_info", MockSysVersionInfo(3, 7, 0)): base_image_name = Image.resolve_fndnt_base_image() assert base_image_name == "fndnt/fondant:dev-py3.11" + + with mock.patch.object( + sys, + "version_info", + MockSysVersionInfo(3, 9, 0), + ), mock.patch("importlib.metadata.version") as mock_call: + mock_call.return_value = "0.9" + base_image_name = Image.resolve_fndnt_base_image() + assert base_image_name == "fndnt/fondant:0.9-py3.9" From 43352d42ea759da16557029a1bd0df5c0262fc30 Mon Sep 17 00:00:00 2001 From: Matthias Richter Date: Tue, 30 Jan 2024 14:10:01 +0100 Subject: [PATCH 11/13] Revert pipeline --- .github/workflows/build.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index d82e49aa..9990e660 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -4,7 +4,6 @@ on: push: branches: - main - pull_request: workflow_dispatch: env: @@ -52,8 +51,8 @@ jobs: with: registry-type: public - #- name: Build components - # run: ./scripts/build_components.sh --cache -t $GITHUB_SHA -t dev + - name: Build components + run: ./scripts/build_components.sh --cache -t $GITHUB_SHA -t dev - name: Build base image run: ./scripts/build_base_image.sh -t $GITHUB_SHA -t dev From 297201bef078d1ee47c7c681955a37043e96bdb6 Mon Sep 17 00:00:00 2001 From: Matthias Richter Date: Tue, 30 Jan 2024 14:45:38 +0100 Subject: [PATCH 12/13] Update build script argument help --- scripts/build_base_image.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/build_base_image.sh b/scripts/build_base_image.sh index 45c13f2f..fa15f16f 100755 --- a/scripts/build_base_image.sh +++ b/scripts/build_base_image.sh @@ -4,7 +4,8 @@ set -e function usage { echo "Usage: $0 [options]" echo "Options:" - echo " -t, --tag Set the tag (default: latest)" + echo " -t, --tag Tag to add to image, repeatable + The first tag defines the fondant version to install" echo " -h, --help Display this help message" } From 450ee8f4be10ea9af1af9dc453d6ce83ad68d409 Mon Sep 17 00:00:00 2001 From: Matthias Richter Date: Tue, 30 Jan 2024 16:43:24 +0100 Subject: [PATCH 13/13] Fix tests --- tests/pipeline/test_pipeline.py | 2 +- tests/pipeline/test_python_component.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/pipeline/test_pipeline.py b/tests/pipeline/test_pipeline.py index 4a489628..f42d0115 100644 --- a/tests/pipeline/test_pipeline.py +++ b/tests/pipeline/test_pipeline.py @@ -91,7 +91,7 @@ def load(self) -> dd.DataFrame: component = ComponentOp.from_ref(Foo, produces={"bar": pa.string()}) assert component.component_spec._specification == { - "name": "foo", + "name": "Foo", "image": Image.resolve_fndnt_base_image(), "description": "lightweight component", "consumes": {"additionalProperties": True}, diff --git a/tests/pipeline/test_python_component.py b/tests/pipeline/test_python_component.py index 52f0d909..93fb0b07 100644 --- a/tests/pipeline/test_python_component.py +++ b/tests/pipeline/test_python_component.py @@ -130,7 +130,7 @@ def transform(self, dataframe: pd.DataFrame) -> pd.DataFrame: operation_spec_dict = pipeline._graph["addn"]["operation"].operation_spec.to_dict() assert operation_spec_dict == { "specification": { - "name": "addn", + "name": "AddN", "image": Image.resolve_fndnt_base_image(), "description": "lightweight component", "consumes": {"additionalProperties": True}, @@ -281,7 +281,7 @@ def load(self) -> dd.DataFrame: assert operation_spec_without_image == { "specification": { - "name": "createdata", + "name": "CreateData", "image": Image.resolve_fndnt_base_image(), "description": "lightweight component", "consumes": {"additionalProperties": True},