Skip to content

Commit

Permalink
Default to py3 for TF docker images.
Browse files Browse the repository at this point in the history
  • Loading branch information
pavithrasv committed Jul 6, 2020
1 parent 59eca3f commit 9fca004
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
4 changes: 3 additions & 1 deletion tensorflow_cloud/containerize.py
Expand Up @@ -139,6 +139,7 @@ def _create_docker_file(self):
!= machine_config.AcceleratorType.NO_ACCELERATOR
):
self.docker_base_image += "-gpu"
self.docker_base_image += "-py3"

if not self._base_image_exist():
if "dev" in self.docker_base_image:
Expand Down Expand Up @@ -344,7 +345,8 @@ def _get_logs(self, logs_generator, name, image_uri):
if "error" in chunk:
raise RuntimeError(
"Docker image {} failed: {}\nImage URI: {}".format(
name, str(chunk["error"]), image_uri)
name, str(chunk["error"]), image_uri
)
)


Expand Down
10 changes: 5 additions & 5 deletions tests/tensorflow_cloud/containerize_test.py
Expand Up @@ -59,7 +59,7 @@ def test_create_docker_file_defaults(self):
lcb._create_docker_file()

expected_docker_file_lines = [
"FROM tensorflow/tensorflow:{}-gpu\n".format(VERSION),
"FROM tensorflow/tensorflow:{}-gpu-py3\n".format(VERSION),
"WORKDIR /app/\n",
"COPY /app/ /app/\n",
'ENTRYPOINT ["python", "mnist_example_using_fit.py"]',
Expand All @@ -85,7 +85,7 @@ def test_create_docker_with_requirements(self):
lcb._create_docker_file()

expected_docker_file_lines = [
"FROM tensorflow/tensorflow:{}-gpu\n".format(VERSION),
"FROM tensorflow/tensorflow:{}-gpu-py3\n".format(VERSION),
"WORKDIR /app/\n",
"COPY /app/requirements.txt /app/requirements.txt\n",
"RUN if [ -e requirements.txt ]; "
Expand All @@ -112,7 +112,7 @@ def test_create_docker_file_with_destination_dir(self):
lcb._create_docker_file()

expected_docker_file_lines = [
"FROM tensorflow/tensorflow:{}-gpu\n".format(VERSION),
"FROM tensorflow/tensorflow:{}-gpu-py3\n".format(VERSION),
"WORKDIR /my_app/temp/\n",
"COPY /my_app/temp/ /my_app/temp/\n",
'ENTRYPOINT ["python", "mnist_example_using_fit.py"]',
Expand Down Expand Up @@ -199,7 +199,7 @@ def test_create_docker_file_with_cpu_config(self):
lcb._create_docker_file()

expected_docker_file_lines = [
"FROM tensorflow/tensorflow:{}\n".format(VERSION),
"FROM tensorflow/tensorflow:{}-py3\n".format(VERSION),
"WORKDIR /app/\n",
"COPY /app/ /app/\n",
'ENTRYPOINT ["python", "mnist_example_using_fit.py"]',
Expand All @@ -220,7 +220,7 @@ def test_create_docker_file_with_tpu_config(self):
lcb._create_docker_file()

expected_docker_file_lines = [
"FROM tensorflow/tensorflow:{}\n".format(VERSION),
"FROM tensorflow/tensorflow:{}-py3\n".format(VERSION),
"WORKDIR /app/\n",
"RUN pip install cloud-tpu-client\n",
"COPY /app/ /app/\n",
Expand Down

0 comments on commit 9fca004

Please sign in to comment.