Skip to content

Commit 6624609

Browse files
authored
Set Python version to 3.6 (#461)
1 parent c5bc020 commit 6624609

File tree

11 files changed

+44
-57
lines changed

11 files changed

+44
-57
lines changed

.circleci/config.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ commands:
2626
jobs:
2727
test:
2828
docker:
29-
- image: circleci/python:3.7.2-stretch
29+
- image: circleci/python:3.6
3030
steps:
3131
- checkout
3232
- setup_remote_docker
3333
- install-go
3434
- run: go get -u -v golang.org/x/lint/golint
35-
- run: sudo pip3 install black
35+
- run: sudo pip install black
3636
- run:
3737
name: Lint
3838
command: make lint
@@ -44,23 +44,23 @@ jobs:
4444
command: make test-python
4545
test-release:
4646
docker:
47-
- image: circleci/python:3.7.2-stretch
47+
- image: circleci/python:3.6
4848
steps:
4949
- checkout
5050
- run:
5151
name: Version Test
5252
command: make find-missing-version
5353
build-and-deploy:
5454
docker:
55-
- image: circleci/python:3.7.2-stretch
55+
- image: circleci/python:3.6
5656
steps:
5757
- checkout
5858
- setup_remote_docker
5959
- install-go
6060
- run: make ci-build-images
6161
- run: make ci-build-cli
6262
- return-if-not-deployed-branch
63-
- run: sudo pip3 install awscli
63+
- run: sudo pip install awscli
6464
- run: make ci-push-images
6565
- run: make ci-build-and-upload-cli
6666

build/find-missing-version.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ output=$(cd "$ROOT" && find . -type f \
2323
! -path "./build/find-missing-version.sh" \
2424
! -path "./.git/*" \
2525
! -name ".*" \
26-
-exec grep -R -A 50 -e "CORTEX_VERSION" {} \+)
26+
-exec grep -R -A 50 -e "CORTEX_VERSION" {} \;)
2727

2828
output=$(echo "$output" | grep -e "master")
2929

build/lint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ output=$(cd "$ROOT" && find . -type f \
7070
! -name "*.md" \
7171
! -name ".*" \
7272
! -name "Dockerfile" \
73-
-exec grep -L "Copyright 2019 Cortex Labs, Inc" {} \+)
73+
-exec grep -L "Copyright 2019 Cortex Labs, Inc" {} \;)
7474
if [[ $output ]]; then
7575
echo "File(s) are missing Cortex license:"
7676
echo "$output"

images/downloader/Dockerfile

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,20 @@ FROM ubuntu:18.04
33
ENV PYTHONPATH="/src:${PYTHONPATH}"
44

55
RUN apt-get update -qq && apt-get install -y -q \
6-
python3 \
7-
python3-dev \
8-
python3-pip \
6+
curl \
7+
python3.6 \
8+
python3.6-distutils \
99
&& apt-get clean -qq && rm -rf /var/lib/apt/lists/* && \
10-
pip3 install --upgrade \
11-
pip \
12-
setuptools \
13-
&& rm -rf /root/.cache/pip*
10+
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \
11+
python3.6 get-pip.py && \
12+
rm -rf /root/.cache/pip*
1413

1514
COPY pkg/workloads/cortex/lib/requirements.txt /src/cortex/lib/requirements.txt
16-
RUN pip3 install -r /src/cortex/lib/requirements.txt && \
15+
RUN pip install -r /src/cortex/lib/requirements.txt && \
1716
rm -rf /root/.cache/pip*
1817

1918
COPY pkg/workloads/cortex/consts.py /src/cortex/
2019
COPY pkg/workloads/cortex/lib /src/cortex/lib
2120
COPY pkg/workloads/cortex/downloader /src/cortex/downloader
2221

23-
ENTRYPOINT ["/usr/bin/python3", "/src/cortex/downloader/download.py"]
22+
ENTRYPOINT ["/usr/bin/python3.6", "/src/cortex/downloader/download.py"]

images/manager/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
FROM python:3.7-alpine3.10
1+
FROM python:3.6-alpine3.10
22

33
WORKDIR /root
44

55
ENV PATH /root/.local/bin:$PATH
66

7-
RUN pip3 install awscli --upgrade --user && \
7+
RUN pip install awscli --upgrade --user && \
88
rm -rf /root/.cache/pip*
99

1010
RUN apk add --no-cache bash curl gettext jq openssl

images/onnx-serve-gpu/Dockerfile

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,6 @@ FROM nvidia/cuda:10.1-cudnn7-devel
22

33
ARG ONNXRUNTIME_VERSION="0.5.0"
44

5-
RUN apt-get update -qq && apt-get install -y -q \
6-
python3 \
7-
python3-dev \
8-
python3-pip \
9-
&& apt-get clean -qq && rm -rf /var/lib/apt/lists/* && \
10-
pip3 install --upgrade \
11-
pip \
12-
setuptools \
13-
&& rm -rf /root/.cache/pip*
14-
155
RUN apt-get update -qq && apt-get install -y -q \
166
build-essential \
177
curl \
@@ -23,16 +13,20 @@ RUN apt-get update -qq && apt-get install -y -q \
2313
software-properties-common \
2414
unzip \
2515
zlib1g-dev \
26-
&& apt-get clean -qq && rm -rf /var/lib/apt/lists/*
27-
16+
python3.6-dev \
17+
python3.6-distutils \
18+
&& apt-get clean -qq && rm -rf /var/lib/apt/lists/* && \
19+
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \
20+
python3.6 get-pip.py && \
21+
rm -rf /root/.cache/pip*
2822

2923
ENV PYTHONPATH "${PYTHONPATH}:/src:/mnt/project"
3024

3125
COPY pkg/workloads/cortex/lib/requirements.txt /src/cortex/lib/requirements.txt
3226
COPY pkg/workloads/cortex/onnx_serve/requirements.txt /src/cortex/onnx_serve/requirements.txt
33-
RUN pip3 install -r /src/cortex/lib/requirements.txt && \
34-
pip3 install -r /src/cortex/onnx_serve/requirements.txt && \
35-
pip3 install onnxruntime-gpu==${ONNXRUNTIME_VERSION} && \
27+
RUN pip install -r /src/cortex/lib/requirements.txt && \
28+
pip install -r /src/cortex/onnx_serve/requirements.txt && \
29+
pip install onnxruntime-gpu==${ONNXRUNTIME_VERSION} && \
3630
rm -rf /root/.cache/pip*
3731

3832
COPY pkg/workloads/cortex/consts.py /src/cortex

images/onnx-serve/Dockerfile

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,6 @@ FROM ubuntu:18.04
22

33
ARG ONNXRUNTIME_VERSION="0.5.0"
44

5-
RUN apt-get update -qq && apt-get install -y -q \
6-
python3 \
7-
python3-dev \
8-
python3-pip \
9-
&& apt-get clean -qq && rm -rf /var/lib/apt/lists/* && \
10-
pip3 install --upgrade \
11-
pip \
12-
setuptools \
13-
&& rm -rf /root/.cache/pip*
14-
155
RUN apt-get update -qq && apt-get install -y -q \
166
build-essential \
177
curl \
@@ -23,16 +13,20 @@ RUN apt-get update -qq && apt-get install -y -q \
2313
software-properties-common \
2414
unzip \
2515
zlib1g-dev \
26-
&& apt-get clean -qq && rm -rf /var/lib/apt/lists/*
27-
16+
python3.6-dev \
17+
python3.6-distutils \
18+
&& apt-get clean -qq && rm -rf /var/lib/apt/lists/* && \
19+
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \
20+
python3.6 get-pip.py && \
21+
rm -rf /root/.cache/pip*
2822

2923
ENV PYTHONPATH "${PYTHONPATH}:/src:/mnt/project"
3024

3125
COPY pkg/workloads/cortex/lib/requirements.txt /src/cortex/lib/requirements.txt
3226
COPY pkg/workloads/cortex/onnx_serve/requirements.txt /src/cortex/onnx_serve/requirements.txt
33-
RUN pip3 install -r /src/cortex/lib/requirements.txt && \
34-
pip3 install -r /src/cortex/onnx_serve/requirements.txt && \
35-
pip3 install onnxruntime==${ONNXRUNTIME_VERSION} && \
27+
RUN pip install -r /src/cortex/lib/requirements.txt && \
28+
pip install -r /src/cortex/onnx_serve/requirements.txt && \
29+
pip install onnxruntime==${ONNXRUNTIME_VERSION} && \
3630
rm -rf /root/.cache/pip*
3731

3832
COPY pkg/workloads/cortex/consts.py /src/cortex

images/test/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
FROM python:3.7
1+
FROM python:3.6
22

33
ENV PYTHONPATH="/src:${PYTHONPATH}"
44

55
COPY pkg/workloads/cortex/lib/requirements.txt /src/cortex/lib/requirements.txt
6-
RUN pip3 install -r /src/cortex/lib/requirements.txt && \
7-
pip3 install pytest mock && \
6+
RUN pip install -r /src/cortex/lib/requirements.txt && \
7+
pip install pytest mock && \
88
rm -rf /root/.cache/pip*
99

1010
COPY pkg/workloads /src

images/tf-api/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ RUN apt-get update -qq && apt-get install -y -q \
1717

1818
COPY pkg/workloads/cortex/lib/requirements.txt /src/cortex/lib/requirements.txt
1919
COPY pkg/workloads/cortex/tf_api/requirements.txt /src/cortex/tf_api/requirements.txt
20-
RUN pip3 install -r /src/cortex/lib/requirements.txt && \
21-
pip3 install -r /src/cortex/tf_api/requirements.txt && \
20+
RUN pip install -r /src/cortex/lib/requirements.txt && \
21+
pip install -r /src/cortex/tf_api/requirements.txt && \
2222
rm -rf /root/.cache/pip*
2323

2424
COPY pkg/workloads/cortex/consts.py /src/cortex/

pkg/workloads/cortex/onnx_serve/run.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@
1616

1717

1818
if [ -f "/mnt/project/requirements.txt" ]; then
19-
pip3 install -r /mnt/project/requirements.txt
19+
pip install -r /mnt/project/requirements.txt
2020
fi
21-
/usr/bin/python3 /src/cortex/onnx_serve/api.py "$@"
21+
/usr/bin/python3.6 /src/cortex/onnx_serve/api.py "$@"

0 commit comments

Comments
 (0)