Skip to content

Commit ddaab2e

Browse files
committed
CI docker: install python 3.11.9 on top of chromium base.
1 parent c244b23 commit ddaab2e

File tree

3 files changed

+37
-24
lines changed

3 files changed

+37
-24
lines changed

Dockerfile.selenium

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,22 @@ FROM seleniarm/standalone-chromium
22

33
ENV PYTHONUNBUFFERED 1
44
USER root
5-
RUN apt-get update ; apt-get install -yq python3 python3-venv
6-
RUN ln -s /usr/bin/python3 /usr/local/bin/python
7-
RUN ln -s /usr/bin/chromedriver /usr/local/bin/chromedriver
8-
RUN useradd -m -s /bin/bash DEV
9-
USER DEV
5+
RUN sudo apt-get update ; apt-get install -yq build-essential zlib1g-dev make libssl-dev
6+
RUN wget -O /Python-3.11.9.tgz https://www.python.org/ftp/python/3.11.9/Python-3.11.9.tgz
7+
WORKDIR /
8+
RUN tar -xvzf Python-3.11.9.tgz
9+
WORKDIR /Python-3.11.9
10+
RUN sudo ./configure && sudo make && sudo make altinstall
11+
RUN sudo rm /usr/bin/python3
12+
RUN sudo ln -s /usr/local/bin/python3.11 /usr/bin/python3
13+
RUN sudo ln -s /usr/local/bin/pip3.11 /usr/bin/pip3
14+
# RUN sudo -H pip3 install virtualenv
15+
# RUN useradd -m -s /bin/bash DEV
16+
# USER DEV
1017
ADD . /code
1118
WORKDIR /code
12-
RUN python -m venv /tmp/venv
13-
RUN . /tmp/venv/bin/activate
14-
ENV PATH="/tmp/venv/bin:${PATH}"
19+
# RUN python3 -m venv /tmp/venv
20+
# RUN . /tmp/venv/bin/activate
21+
# ENV PATH="/tmp/venv/bin:${PATH}"
1522
RUN pip3 install --upgrade pip
1623
RUN pip3 install selenium pytest debugpy jsonschema python-dateutil

Dockerfiles/Dockerfile.selenium-jenkins-python311-chromium

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@ FROM --platform=linux/amd64 seleniarm/standalone-chromium
22

33
ENV PYTHONUNBUFFERED 1
44
USER root
5-
6-
RUN apt-get update ; apt-get install -yq python3 python3-venv
7-
RUN ln -s /usr/bin/python3 /usr/local/bin/python
5+
RUN sudo apt-get update ; apt-get install -yq build-essential zlib1g-dev make libssl-dev
6+
RUN wget -O /Python-3.11.9.tgz https://www.python.org/ftp/python/3.11.9/Python-3.11.9.tgz
7+
WORKDIR /
8+
RUN tar -xvzf Python-3.11.9.tgz
9+
WORKDIR /Python-3.11.9
10+
RUN sudo ./configure && sudo make && sudo make altinstall
11+
RUN sudo rm /usr/bin/python3
12+
RUN sudo ln -s /usr/local/bin/python3.11 /usr/bin/python3
13+
RUN sudo ln -s /usr/local/bin/pip3.11 /usr/bin/pip3

Jenkinsfiles/Jenkinsfile.cbc-run-multi-pr-checks-w-selenium-chromium

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -50,21 +50,26 @@ pipeline {
5050
}
5151
}
5252

53+
stage("REPORT Python Version") {
54+
steps {
55+
sh """
56+
python3 --version
57+
"""
58+
}
59+
}
60+
5361
stage("INSTALL Python Packages") {
5462
steps {
5563
sh """
56-
python -m venv venv
57-
. venv/bin/activate
58-
pip install --upgrade pip setuptools wheel newrelic==8.8.0 pillow==10.3.0 psycopg2-binary==2.9.6
59-
pip install -r requirements/requirements.dev.txt --no-index --find-links ./vendor/
64+
pip3 install --upgrade pip setuptools wheel
65+
pip3 install -r requirements/requirements.dev.txt --no-index --find-links ./vendor/
6066
"""
6167
}
6268
}
6369

6470
stage("CHECK Flake8 Python Lint/Style") {
6571
steps{
6672
sh """
67-
. venv/bin/activate
6873
flake8
6974
"""
7075
}
@@ -73,8 +78,7 @@ pipeline {
7378
stage("RUN Django Unit Tests") {
7479
steps{
7580
sh """
76-
. venv/bin/activate
77-
python runtests.py
81+
python3 runtests.py
7882
"""
7983
}
8084
}
@@ -85,9 +89,8 @@ pipeline {
8589
}
8690
steps{
8791
sh """
88-
. venv/bin/activate
8992
mkdir ./docker-compose/tmp/
90-
python manage.py migrate && python manage.py create_admin_groups && python manage.py loaddata scopes.json && python manage.py create_blue_button_scopes && python manage.py create_test_user_and_application && python manage.py create_user_identification_label_selection && python manage.py create_test_feature_switches && (if [ ! -d 'bluebutton-css' ] ; then git clone https://github.com/CMSgov/bluebutton-css.git ; else echo 'CSS already installed.' ; fi) && echo 'starting bb2...' && (export DJANGO_SETTINGS_MODULE=hhs_oauth_server.settings.logging_it && python manage.py runserver 0.0.0.0:8000 > ./docker-compose/tmp/bb2_email_to_stdout.log 2>&1 &)
93+
python3 manage.py migrate && python manage.py create_admin_groups && python manage.py loaddata scopes.json && python manage.py create_blue_button_scopes && python manage.py create_test_user_and_application && python manage.py create_user_identification_label_selection && python manage.py create_test_feature_switches && (if [ ! -d 'bluebutton-css' ] ; then git clone https://github.com/CMSgov/bluebutton-css.git ; else echo 'CSS already installed.' ; fi) && echo 'starting bb2...' && (export DJANGO_SETTINGS_MODULE=hhs_oauth_server.settings.logging_it && python manage.py runserver 0.0.0.0:8000 > ./docker-compose/tmp/bb2_email_to_stdout.log 2>&1 &)
9194
"""
9295
}
9396
}
@@ -111,7 +114,6 @@ pipeline {
111114
steps{
112115
sh 'echo "RUN selenium tests - user account and app management tests"'
113116
sh """
114-
. venv/bin/activate
115117
pytest ./apps/integration_tests/selenium_accounts_tests.py::TestUserAndAppMgmt::testAccountAndAppMgmt
116118
"""
117119
}
@@ -120,8 +122,7 @@ pipeline {
120122
stage("RUN integration tests") {
121123
steps{
122124
sh """
123-
. venv/bin/activate
124-
python runtests.py --integration apps.integration_tests.integration_test_fhir_resources.IntegrationTestFhirApiResources
125+
python3 runtests.py --integration apps.integration_tests.integration_test_fhir_resources.IntegrationTestFhirApiResources
125126
"""
126127
}
127128
}
@@ -133,7 +134,6 @@ pipeline {
133134
steps{
134135
sh 'echo "RUN selenium tests - testclient based authorization flow tests and data flow tests"'
135136
sh """
136-
. venv/bin/activate
137137
USE_NEW_PERM_SCREEN=true pytest ./apps/integration_tests/selenium_tests.py
138138
"""
139139
}

0 commit comments

Comments
 (0)