From a0275a3819f7488dc3f791ee3607ae88264e8414 Mon Sep 17 00:00:00 2001 From: Alexey Volkov Date: Wed, 7 Aug 2019 11:30:01 -0700 Subject: [PATCH] SDK - Fixed string comparisons --- sdk/python/kfp/compiler/_component_builder.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sdk/python/kfp/compiler/_component_builder.py b/sdk/python/kfp/compiler/_component_builder.py index 2ab4f0023bd..aad65f98667 100644 --- a/sdk/python/kfp/compiler/_component_builder.py +++ b/sdk/python/kfp/compiler/_component_builder.py @@ -128,18 +128,18 @@ def _generate_dockerfile(filename, base_image, entrypoint_filename, python_versi raise ValueError('python_version has to be either python2 or python3') with open(filename, 'w') as f: f.write('FROM ' + base_image + '\n') - if python_version is 'python3': + if python_version == 'python3': f.write('RUN apt-get update -y && apt-get install --no-install-recommends -y -q python3 python3-pip python3-setuptools\n') else: f.write('RUN apt-get update -y && apt-get install --no-install-recommends -y -q python python-pip python-setuptools\n') if requirement_filename is not None: f.write('ADD ' + requirement_filename + ' /ml/requirements.txt\n') - if python_version is 'python3': + if python_version == 'python3': f.write('RUN pip3 install -r /ml/requirements.txt\n') else: f.write('RUN pip install -r /ml/requirements.txt\n') f.write('ADD ' + entrypoint_filename + ' /ml/main.py\n') - if python_version is 'python3': + if python_version == 'python3': f.write('ENTRYPOINT ["python3", "-u", "/ml/main.py"]') else: f.write('ENTRYPOINT ["python", "-u", "/ml/main.py"]')