Skip to content

Commit

Permalink
SDK - Fixed string comparisons (#1756)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ark-kun authored and k8s-ci-robot committed Aug 17, 2019
1 parent 6d5ffa2 commit 1d99704
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sdk/python/kfp/compiler/_component_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]')
Expand Down

0 comments on commit 1d99704

Please sign in to comment.