From 6e3c2d8c311e208cbc7a75bf7c795d7bc9a62fb3 Mon Sep 17 00:00:00 2001 From: David Eliahu Date: Fri, 13 Sep 2019 14:41:01 -0700 Subject: [PATCH 01/10] Set Python version to 3.6 --- .circleci/config.yml | 10 +++++----- images/downloader/Dockerfile | 17 ++++++++--------- images/manager/Dockerfile | 4 ++-- images/onnx-serve-gpu/Dockerfile | 24 +++++++++--------------- images/onnx-serve/Dockerfile | 24 +++++++++--------------- images/test/Dockerfile | 6 +++--- images/tf-api/Dockerfile | 4 ++-- pkg/workloads/cortex/onnx_serve/run.sh | 4 ++-- pkg/workloads/cortex/tf_api/run.sh | 4 ++-- 9 files changed, 42 insertions(+), 55 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 248cd9855c..e6694648f9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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 @@ -44,7 +44,7 @@ jobs: command: make test-python test-release: docker: - - image: circleci/python:3.7.2-stretch + - image: circleci/python:3.6 steps: - checkout - run: @@ -52,7 +52,7 @@ jobs: 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 @@ -60,7 +60,7 @@ jobs: - 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 diff --git a/images/downloader/Dockerfile b/images/downloader/Dockerfile index 0c87a1f6f4..149ac2d602 100644 --- a/images/downloader/Dockerfile +++ b/images/downloader/Dockerfile @@ -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"] diff --git a/images/manager/Dockerfile b/images/manager/Dockerfile index c2b6babd02..07ba14c6fe 100644 --- a/images/manager/Dockerfile +++ b/images/manager/Dockerfile @@ -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 diff --git a/images/onnx-serve-gpu/Dockerfile b/images/onnx-serve-gpu/Dockerfile index 792d2d0533..5a076e340f 100644 --- a/images/onnx-serve-gpu/Dockerfile +++ b/images/onnx-serve-gpu/Dockerfile @@ -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 \ @@ -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 diff --git a/images/onnx-serve/Dockerfile b/images/onnx-serve/Dockerfile index 0f238af080..f0e367e85d 100644 --- a/images/onnx-serve/Dockerfile +++ b/images/onnx-serve/Dockerfile @@ -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 \ @@ -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 diff --git a/images/test/Dockerfile b/images/test/Dockerfile index 4ccca4e6af..07c63a0d57 100644 --- a/images/test/Dockerfile +++ b/images/test/Dockerfile @@ -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 diff --git a/images/tf-api/Dockerfile b/images/tf-api/Dockerfile index c0c7843b24..c64f05a8ce 100644 --- a/images/tf-api/Dockerfile +++ b/images/tf-api/Dockerfile @@ -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/ diff --git a/pkg/workloads/cortex/onnx_serve/run.sh b/pkg/workloads/cortex/onnx_serve/run.sh index 729c676a76..54a601afdf 100755 --- a/pkg/workloads/cortex/onnx_serve/run.sh +++ b/pkg/workloads/cortex/onnx_serve/run.sh @@ -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 "$@" diff --git a/pkg/workloads/cortex/tf_api/run.sh b/pkg/workloads/cortex/tf_api/run.sh index 802be7913a..b9a39ebbe9 100755 --- a/pkg/workloads/cortex/tf_api/run.sh +++ b/pkg/workloads/cortex/tf_api/run.sh @@ -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 "$@" From faceac15fc140aba00cd35b3ab8b643e7455afd8 Mon Sep 17 00:00:00 2001 From: David Eliahu Date: Fri, 13 Sep 2019 14:57:19 -0700 Subject: [PATCH 02/10] Update circle images --- .circleci/config.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e6694648f9..982a663e9a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -26,7 +26,7 @@ commands: jobs: test: docker: - - image: circleci/python:3.6 + - image: circleci/python:3.6-buster steps: - checkout - setup_remote_docker @@ -44,7 +44,7 @@ jobs: command: make test-python test-release: docker: - - image: circleci/python:3.6 + - image: circleci/python:3.6-buster steps: - checkout - run: @@ -52,7 +52,7 @@ jobs: command: make find-missing-version build-and-deploy: docker: - - image: circleci/python:3.6 + - image: circleci/python:3.6-buster steps: - checkout - setup_remote_docker From eae72e5fd82081be4c028c882bc60fc0b9325618 Mon Sep 17 00:00:00 2001 From: David Eliahu Date: Fri, 13 Sep 2019 15:00:25 -0700 Subject: [PATCH 03/10] Update config.yml --- .circleci/config.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 982a663e9a..248cd9855c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -26,13 +26,13 @@ commands: jobs: test: docker: - - image: circleci/python:3.6-buster + - image: circleci/python:3.7.2-stretch steps: - checkout - setup_remote_docker - install-go - run: go get -u -v golang.org/x/lint/golint - - run: sudo pip install black + - run: sudo pip3 install black - run: name: Lint command: make lint @@ -44,7 +44,7 @@ jobs: command: make test-python test-release: docker: - - image: circleci/python:3.6-buster + - image: circleci/python:3.7.2-stretch steps: - checkout - run: @@ -52,7 +52,7 @@ jobs: command: make find-missing-version build-and-deploy: docker: - - image: circleci/python:3.6-buster + - image: circleci/python:3.7.2-stretch steps: - checkout - setup_remote_docker @@ -60,7 +60,7 @@ jobs: - run: make ci-build-images - run: make ci-build-cli - return-if-not-deployed-branch - - run: sudo pip install awscli + - run: sudo pip3 install awscli - run: make ci-push-images - run: make ci-build-and-upload-cli From 3ae84afaf861609b87e5ee28c642c60f43f73026 Mon Sep 17 00:00:00 2001 From: David Eliahu Date: Fri, 13 Sep 2019 15:02:15 -0700 Subject: [PATCH 04/10] Update config.yml --- .circleci/config.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 248cd9855c..791892ebd4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -26,7 +26,7 @@ commands: jobs: test: docker: - - image: circleci/python:3.7.2-stretch + - image: circleci/python:3.6 steps: - checkout - setup_remote_docker @@ -44,7 +44,7 @@ jobs: command: make test-python test-release: docker: - - image: circleci/python:3.7.2-stretch + - image: circleci/python:3.6 steps: - checkout - run: @@ -52,7 +52,7 @@ jobs: 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 From 74a24df0cea964d8b072f80f51d53065a35e0bba Mon Sep 17 00:00:00 2001 From: David Eliahu Date: Fri, 13 Sep 2019 15:03:50 -0700 Subject: [PATCH 05/10] Update config.yml --- .circleci/config.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 791892ebd4..dc7161ebea 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -26,7 +26,7 @@ commands: jobs: test: docker: - - image: circleci/python:3.6 + - image: circleci/python:3.6-stretch steps: - checkout - setup_remote_docker @@ -44,7 +44,7 @@ jobs: command: make test-python test-release: docker: - - image: circleci/python:3.6 + - image: circleci/python:3.6-stretch steps: - checkout - run: @@ -52,7 +52,7 @@ jobs: command: make find-missing-version build-and-deploy: docker: - - image: circleci/python:3.6 + - image: circleci/python:3.6-stretch steps: - checkout - setup_remote_docker From 582eae9fb8b7758f502521dd4b6efd398a9cd7b9 Mon Sep 17 00:00:00 2001 From: David Eliahu Date: Fri, 13 Sep 2019 15:06:37 -0700 Subject: [PATCH 06/10] Update config.yml --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index dc7161ebea..e56ee26c44 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -32,7 +32,7 @@ jobs: - 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 @@ -60,7 +60,7 @@ jobs: - 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 From 05e9da779c60c6265752f1dd3e9dcb6e6becaec4 Mon Sep 17 00:00:00 2001 From: David Eliahu Date: Fri, 13 Sep 2019 15:07:09 -0700 Subject: [PATCH 07/10] Update config.yml --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e56ee26c44..4d10aacc90 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -32,7 +32,7 @@ jobs: - setup_remote_docker - install-go - run: go get -u -v golang.org/x/lint/golint - - run: sudo pip install black + - run: pip install black - run: name: Lint command: make lint @@ -60,7 +60,7 @@ jobs: - run: make ci-build-images - run: make ci-build-cli - return-if-not-deployed-branch - - run: sudo pip install awscli + - run: pip install awscli - run: make ci-push-images - run: make ci-build-and-upload-cli From 1845a8450c5fde8221f3c1b23239f900746927e3 Mon Sep 17 00:00:00 2001 From: David Eliahu Date: Fri, 13 Sep 2019 15:09:07 -0700 Subject: [PATCH 08/10] Update config.yml --- .circleci/config.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4d10aacc90..982a663e9a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -26,13 +26,13 @@ commands: jobs: test: docker: - - image: circleci/python:3.6-stretch + - image: circleci/python:3.6-buster steps: - checkout - setup_remote_docker - install-go - run: go get -u -v golang.org/x/lint/golint - - run: pip install black + - run: sudo pip install black - run: name: Lint command: make lint @@ -44,7 +44,7 @@ jobs: command: make test-python test-release: docker: - - image: circleci/python:3.6-stretch + - image: circleci/python:3.6-buster steps: - checkout - run: @@ -52,7 +52,7 @@ jobs: command: make find-missing-version build-and-deploy: docker: - - image: circleci/python:3.6-stretch + - image: circleci/python:3.6-buster steps: - checkout - setup_remote_docker @@ -60,7 +60,7 @@ jobs: - run: make ci-build-images - run: make ci-build-cli - return-if-not-deployed-branch - - run: pip install awscli + - run: sudo pip install awscli - run: make ci-push-images - run: make ci-build-and-upload-cli From 4c1866a24bdbc3b535b287a27e65355831219014 Mon Sep 17 00:00:00 2001 From: David Eliahu Date: Fri, 13 Sep 2019 15:26:25 -0700 Subject: [PATCH 09/10] Fix grep --- build/find-missing-version.sh | 2 +- build/lint.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/find-missing-version.sh b/build/find-missing-version.sh index f87d893f94..87ece3f518 100755 --- a/build/find-missing-version.sh +++ b/build/find-missing-version.sh @@ -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") diff --git a/build/lint.sh b/build/lint.sh index 7477dcb9a1..a70bd6b571 100755 --- a/build/lint.sh +++ b/build/lint.sh @@ -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" From 3d91d71323f1efa96f1a14842196e4fb107bc0ea Mon Sep 17 00:00:00 2001 From: David Eliahu Date: Fri, 13 Sep 2019 15:26:28 -0700 Subject: [PATCH 10/10] Update config.yml --- .circleci/config.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 982a663e9a..e6694648f9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -26,7 +26,7 @@ commands: jobs: test: docker: - - image: circleci/python:3.6-buster + - image: circleci/python:3.6 steps: - checkout - setup_remote_docker @@ -44,7 +44,7 @@ jobs: command: make test-python test-release: docker: - - image: circleci/python:3.6-buster + - image: circleci/python:3.6 steps: - checkout - run: @@ -52,7 +52,7 @@ jobs: command: make find-missing-version build-and-deploy: docker: - - image: circleci/python:3.6-buster + - image: circleci/python:3.6 steps: - checkout - setup_remote_docker