Skip to content

Set Python version to 3.6 #461

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Sep 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ commands:
jobs:
test:
docker:
- image: circleci/python:3.7.2-stretch
- image: circleci/python:3.6
steps:
- checkout
- setup_remote_docker
- install-go
- run: go get -u -v golang.org/x/lint/golint
- run: sudo pip3 install black
- run: sudo pip install black
- run:
name: Lint
command: make lint
Expand All @@ -44,23 +44,23 @@ jobs:
command: make test-python
test-release:
docker:
- image: circleci/python:3.7.2-stretch
- image: circleci/python:3.6
steps:
- checkout
- run:
name: Version Test
command: make find-missing-version
build-and-deploy:
docker:
- image: circleci/python:3.7.2-stretch
- image: circleci/python:3.6
steps:
- checkout
- setup_remote_docker
- install-go
- run: make ci-build-images
- run: make ci-build-cli
- return-if-not-deployed-branch
- run: sudo pip3 install awscli
- run: sudo pip install awscli
- run: make ci-push-images
- run: make ci-build-and-upload-cli

Expand Down
2 changes: 1 addition & 1 deletion build/find-missing-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ output=$(cd "$ROOT" && find . -type f \
! -path "./build/find-missing-version.sh" \
! -path "./.git/*" \
! -name ".*" \
-exec grep -R -A 50 -e "CORTEX_VERSION" {} \+)
-exec grep -R -A 50 -e "CORTEX_VERSION" {} \;)

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

Expand Down
2 changes: 1 addition & 1 deletion build/lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ output=$(cd "$ROOT" && find . -type f \
! -name "*.md" \
! -name ".*" \
! -name "Dockerfile" \
-exec grep -L "Copyright 2019 Cortex Labs, Inc" {} \+)
-exec grep -L "Copyright 2019 Cortex Labs, Inc" {} \;)
if [[ $output ]]; then
echo "File(s) are missing Cortex license:"
echo "$output"
Expand Down
17 changes: 8 additions & 9 deletions images/downloader/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,20 @@ FROM ubuntu:18.04
ENV PYTHONPATH="/src:${PYTHONPATH}"

RUN apt-get update -qq && apt-get install -y -q \
python3 \
python3-dev \
python3-pip \
curl \
python3.6 \
python3.6-distutils \
&& apt-get clean -qq && rm -rf /var/lib/apt/lists/* && \
pip3 install --upgrade \
pip \
setuptools \
&& rm -rf /root/.cache/pip*
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \
python3.6 get-pip.py && \
rm -rf /root/.cache/pip*

COPY pkg/workloads/cortex/lib/requirements.txt /src/cortex/lib/requirements.txt
RUN pip3 install -r /src/cortex/lib/requirements.txt && \
RUN pip install -r /src/cortex/lib/requirements.txt && \
rm -rf /root/.cache/pip*

COPY pkg/workloads/cortex/consts.py /src/cortex/
COPY pkg/workloads/cortex/lib /src/cortex/lib
COPY pkg/workloads/cortex/downloader /src/cortex/downloader

ENTRYPOINT ["/usr/bin/python3", "/src/cortex/downloader/download.py"]
ENTRYPOINT ["/usr/bin/python3.6", "/src/cortex/downloader/download.py"]
4 changes: 2 additions & 2 deletions images/manager/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
FROM python:3.7-alpine3.10
FROM python:3.6-alpine3.10

WORKDIR /root

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

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

RUN apk add --no-cache bash curl gettext jq openssl
Expand Down
24 changes: 9 additions & 15 deletions images/onnx-serve-gpu/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,6 @@ FROM nvidia/cuda:10.1-cudnn7-devel

ARG ONNXRUNTIME_VERSION="0.5.0"

RUN apt-get update -qq && apt-get install -y -q \
python3 \
python3-dev \
python3-pip \
&& apt-get clean -qq && rm -rf /var/lib/apt/lists/* && \
pip3 install --upgrade \
pip \
setuptools \
&& rm -rf /root/.cache/pip*

RUN apt-get update -qq && apt-get install -y -q \
build-essential \
curl \
Expand All @@ -23,16 +13,20 @@ RUN apt-get update -qq && apt-get install -y -q \
software-properties-common \
unzip \
zlib1g-dev \
&& apt-get clean -qq && rm -rf /var/lib/apt/lists/*

python3.6-dev \
python3.6-distutils \
&& apt-get clean -qq && rm -rf /var/lib/apt/lists/* && \
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \
python3.6 get-pip.py && \
rm -rf /root/.cache/pip*

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

COPY pkg/workloads/cortex/lib/requirements.txt /src/cortex/lib/requirements.txt
COPY pkg/workloads/cortex/onnx_serve/requirements.txt /src/cortex/onnx_serve/requirements.txt
RUN pip3 install -r /src/cortex/lib/requirements.txt && \
pip3 install -r /src/cortex/onnx_serve/requirements.txt && \
pip3 install onnxruntime-gpu==${ONNXRUNTIME_VERSION} && \
RUN pip install -r /src/cortex/lib/requirements.txt && \
pip install -r /src/cortex/onnx_serve/requirements.txt && \
pip install onnxruntime-gpu==${ONNXRUNTIME_VERSION} && \
rm -rf /root/.cache/pip*

COPY pkg/workloads/cortex/consts.py /src/cortex
Expand Down
24 changes: 9 additions & 15 deletions images/onnx-serve/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,6 @@ FROM ubuntu:18.04

ARG ONNXRUNTIME_VERSION="0.5.0"

RUN apt-get update -qq && apt-get install -y -q \
python3 \
python3-dev \
python3-pip \
&& apt-get clean -qq && rm -rf /var/lib/apt/lists/* && \
pip3 install --upgrade \
pip \
setuptools \
&& rm -rf /root/.cache/pip*

RUN apt-get update -qq && apt-get install -y -q \
build-essential \
curl \
Expand All @@ -23,16 +13,20 @@ RUN apt-get update -qq && apt-get install -y -q \
software-properties-common \
unzip \
zlib1g-dev \
&& apt-get clean -qq && rm -rf /var/lib/apt/lists/*

python3.6-dev \
python3.6-distutils \
&& apt-get clean -qq && rm -rf /var/lib/apt/lists/* && \
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \
python3.6 get-pip.py && \
rm -rf /root/.cache/pip*

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

COPY pkg/workloads/cortex/lib/requirements.txt /src/cortex/lib/requirements.txt
COPY pkg/workloads/cortex/onnx_serve/requirements.txt /src/cortex/onnx_serve/requirements.txt
RUN pip3 install -r /src/cortex/lib/requirements.txt && \
pip3 install -r /src/cortex/onnx_serve/requirements.txt && \
pip3 install onnxruntime==${ONNXRUNTIME_VERSION} && \
RUN pip install -r /src/cortex/lib/requirements.txt && \
pip install -r /src/cortex/onnx_serve/requirements.txt && \
pip install onnxruntime==${ONNXRUNTIME_VERSION} && \
rm -rf /root/.cache/pip*

COPY pkg/workloads/cortex/consts.py /src/cortex
Expand Down
6 changes: 3 additions & 3 deletions images/test/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
FROM python:3.7
FROM python:3.6

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

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

COPY pkg/workloads /src
Expand Down
4 changes: 2 additions & 2 deletions images/tf-api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ RUN apt-get update -qq && apt-get install -y -q \

COPY pkg/workloads/cortex/lib/requirements.txt /src/cortex/lib/requirements.txt
COPY pkg/workloads/cortex/tf_api/requirements.txt /src/cortex/tf_api/requirements.txt
RUN pip3 install -r /src/cortex/lib/requirements.txt && \
pip3 install -r /src/cortex/tf_api/requirements.txt && \
RUN pip install -r /src/cortex/lib/requirements.txt && \
pip install -r /src/cortex/tf_api/requirements.txt && \
rm -rf /root/.cache/pip*

COPY pkg/workloads/cortex/consts.py /src/cortex/
Expand Down
4 changes: 2 additions & 2 deletions pkg/workloads/cortex/onnx_serve/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@


if [ -f "/mnt/project/requirements.txt" ]; then
pip3 install -r /mnt/project/requirements.txt
pip install -r /mnt/project/requirements.txt
fi
/usr/bin/python3 /src/cortex/onnx_serve/api.py "$@"
/usr/bin/python3.6 /src/cortex/onnx_serve/api.py "$@"
4 changes: 2 additions & 2 deletions pkg/workloads/cortex/tf_api/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@


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