-
Notifications
You must be signed in to change notification settings - Fork 59
/
Dockerfile
54 lines (43 loc) · 1.9 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
ARG image_version="nightly"
FROM tensorflow/tensorflow:${image_version}-gpu
ARG image_version
ARG model_garden_branch="master"
ARG tensorflow_text_version="nightly"
# HACKs: Remove this once they are added to the Model Garden requirements
RUN pip3 install tensorflow-recommenders --no-deps
RUN if [ ${image_version} = "nightly" ] \
|| [ ${tensorflow_text_version} = "nightly" ] \
|| [ echo ${tensorflow_text_version} | grep -q "dev" ]; then \
pip3 install tensorflow-text-nightly --no-deps; \
else \
pip3 install tensorflow-text==${tensorflow_text_version} --no-deps; \
fi
# Checkout tensorflow/models at HEAD
WORKDIR /
RUN curl -L https://github.com/tensorflow/models/archive/${model_garden_branch}.tar.gz | tar zx
RUN mv models-${model_garden_branch} garden/
RUN pip3 install cloud-tpu-client
RUN pip3 install "Cython<3.0" "pyyaml<6" --no-build-isolation
RUN pip3 install -r /garden/official/requirements.txt
ENV PYTHONPATH /garden
RUN curl -L https://github.com/tensorflow/benchmarks/archive/master.tar.gz | tar xz
RUN mv benchmarks-master benchmarks/
COPY images/setup.sh /
COPY images/tensorflow/entrypoint.sh /
RUN curl -L https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-289.0.0-linux-x86_64.tar.gz | tar zx
ENV PATH "/google-cloud-sdk/bin/:${PATH}"
WORKDIR /garden
ENTRYPOINT ["/entrypoint.sh"]