From 1f387b99579d727299ba8b46c74491d14ffc7596 Mon Sep 17 00:00:00 2001 From: Soban Javed Date: Mon, 30 Aug 2021 13:21:00 +0500 Subject: [PATCH 1/2] fix: run tests on python 3.8 by fixing Dockerfile --- .travis.yml | 1 + Dockerfile | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/.travis.yml b/.travis.yml index 8bf22a65f..78ed52d93 100644 --- a/.travis.yml +++ b/.travis.yml @@ -28,6 +28,7 @@ install: script: - docker exec -t -e TRAVIS=1 insights_testing bash -c " + source /edx/app/insights/venvs/insights/bin/activate && cd /edx/app/insights/edx_analytics_dashboard/ && PATH=\$PATH:/edx/app/insights/nodeenvs/insights/bin:/snap/bin && make $TARGETS " diff --git a/Dockerfile b/Dockerfile index deab74346..3d4e15122 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,6 +10,10 @@ RUN apt update && \ python3.8 get-pip.py && python3.8 -m pip install --upgrade pip setuptools && \ rm -rf /var/lib/apt/lists/* +ENV VIRTUAL_ENV=/venv +RUN python3.8 -m venv $VIRTUAL_ENV +ENV PATH="$VIRTUAL_ENV/bin:$PATH" + RUN locale-gen en_US.UTF-8 ENV LANG en_US.UTF-8 ENV LANGUAGE en_US:en From 217aea03a43db0823396211ba48599792dc0733c Mon Sep 17 00:00:00 2001 From: Soban Javed Date: Mon, 30 Aug 2021 13:35:31 +0500 Subject: [PATCH 2/2] use ubuntu focal instead of xenial --- Dockerfile | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3d4e15122..9f83615b5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,9 @@ -FROM ubuntu:xenial as openedx - -RUN apt update && \ - apt-get install -y software-properties-common && \ - apt-add-repository -y ppa:deadsnakes/ppa && apt-get update && \ - apt-get install -y curl && \ - apt-get upgrade -qy && \ - apt install -y git-core language-pack-en build-essential python3.8-dev python3.8-distutils libmysqlclient-dev && \ +FROM ubuntu:focal as openedx + +RUN apt update && apt-get upgrade -qy +RUN apt install -y git-core language-pack-en python3.8 python3-pip python3.8-distutils libmysqlclient-dev && \ curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \ - python3.8 get-pip.py && python3.8 -m pip install --upgrade pip setuptools && \ + pip install --upgrade pip setuptools && \ rm -rf /var/lib/apt/lists/* ENV VIRTUAL_ENV=/venv