Skip to content

Commit

Permalink
fix bug for the component build with requirements (#320)
Browse files Browse the repository at this point in the history
* fix bug for the component build with requirements

* fix unit test failure
  • Loading branch information
gaoning777 authored and k8s-ci-robot committed Nov 20, 2018
1 parent 32013a1 commit 5908496
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion sdk/python/kfp/compiler/_component_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,8 @@ def _generate_dockerfile_with_py(self, target_file, base_image, python_filepath,
f.write('RUN apt-get update -y && apt-get install --no-install-recommends -y -q python3 python3-pip python3-setuptools\n')
f.write('RUN pip3 install fire\n')
if has_requirement_file:
f.write('RUN pip3 install -r ' + self._ARC_REQUIREMENT_FILE + '\n')
f.write('ADD ' + self._ARC_REQUIREMENT_FILE + ' /ml/\n')
f.write('RUN pip3 install -r /ml/' + self._ARC_REQUIREMENT_FILE + '\n')
f.write('ADD ' + python_filepath + " /ml/" + '\n')
f.write('ENTRYPOINT ["python3", "/ml/' + python_filepath + '"]')

Expand Down
3 changes: 2 additions & 1 deletion sdk/python/tests/compiler/component_builder_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,8 @@ def test_generate_dockerfile(self):
FROM gcr.io/ngao-mlpipeline-testing/tensorflow:1.10.0
RUN apt-get update -y && apt-get install --no-install-recommends -y -q python3 python3-pip python3-setuptools
RUN pip3 install fire
RUN pip3 install -r requirements.txt
ADD requirements.txt /ml/
RUN pip3 install -r /ml/requirements.txt
ADD main.py /ml/
ENTRYPOINT ["python3", "/ml/main.py"]'''

Expand Down

0 comments on commit 5908496

Please sign in to comment.