Skip to content
This repository was archived by the owner on Jul 7, 2023. It is now read-only.

Commit 3b12e6c

Browse files
Ryan SepassiCopybara-Service
authored andcommitted
Re-enable serving tests in Travis using Docker
PiperOrigin-RevId: 209087220
1 parent fb16924 commit 3b12e6c

File tree

1 file changed

+13
-16
lines changed

1 file changed

+13
-16
lines changed

.travis.yml

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1+
sudo: required
12
language: python
3+
git:
4+
depth: 3
5+
services:
6+
- docker
27
python:
38
- "2.7"
49
- "3.6"
@@ -24,13 +29,8 @@ matrix:
2429
- python: "3.6"
2530
env: TF_VERSION="tf-nightly"
2631
before_install:
27-
# Disabled TensorFlow Serving install until bug fixed. See "Export and query"
28-
# section below.
29-
# - echo "deb [arch=amd64] http://storage.googleapis.com/tensorflow-serving-apt stable tensorflow-model-server tensorflow-model-server-universal" | sudo tee /etc/apt/sources.list.d/tensorflow-serving.list
30-
# - curl https://storage.googleapis.com/tensorflow-serving-apt/tensorflow-serving.release.pub.gpg | sudo apt-key add -
3132
- sudo apt-get update -qq
3233
- sudo apt-get install -qq libhdf5-dev
33-
# - sudo apt-get install -qq tensorflow-model-server
3434
install:
3535
- if [[ "$TF_VERSION" == "tf-nightly" ]];
3636
then
@@ -111,14 +111,11 @@ script:
111111
jupyter nbconvert --ExecutePreprocessor.timeout=600 --to notebook --execute tensor2tensor/notebooks/t2t_problem.ipynb;
112112
fi
113113

114-
# Export and query (on Python 2 only)
115-
# Bug: https://github.com/tensorflow/serving/issues/819
116-
#- if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]] && [[ "$TF_VERSION" == "1.6.*" ]]; then
117-
# t2t-exporter --problem=$T2T_PROBLEM --data_dir=$T2T_DATA_DIR --model=transformer --hparams_set=transformer_tiny --output_dir=$T2T_TRAIN_DIR;
118-
# pip install tensorflow-serving-api;
119-
# tensorflow_model_server --port=9000 --model_name=my_model --model_base_path=$T2T_TRAIN_DIR/export/Servo &
120-
# sleep 10;
121-
# t2t-query-server --problem=$T2T_PROBLEM --server=localhost:9000 --servable_name=my_model --data_dir=$T2T_DATA_DIR --inputs_once='1 0 1 0 1 0';
122-
# fi
123-
git:
124-
depth: 3
114+
# Export and query
115+
- if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]] && [[ "$TF_VERSION" == "$TF_LATEST" ]]; then
116+
t2t-exporter --problem=$T2T_PROBLEM --data_dir=$T2T_DATA_DIR --model=transformer --hparams_set=transformer_tiny --output_dir=$T2T_TRAIN_DIR;
117+
pip install tensorflow-serving-api;
118+
docker run -d -p 8500:8500 --mount type=bind,source=$T2T_TRAIN_DIR/export/Servo,target=/models/my_model -e MODEL_NAME=my_model -t tensorflow/serving;
119+
sleep 10;
120+
t2t-query-server --problem=$T2T_PROBLEM --server=localhost:8500 --servable_name=my_model --data_dir=$T2T_DATA_DIR --inputs_once='1 0 1 0 1 0';
121+
fi

0 commit comments

Comments
 (0)