Skip to content

Commit 1807857

Browse files
authored
Merge pull request #1171 from newrelic/update-ci-image
Update CI Image
2 parents 7ae5f59 + 68aa7ae commit 1807857

File tree

6 files changed

+49
-35
lines changed

6 files changed

+49
-35
lines changed

.devcontainer/Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,18 @@ FROM ghcr.io/newrelic/newrelic-python-agent-ci:${IMAGE_TAG}
44

55
# Setup non-root user
66
USER root
7-
ARG UID=1000
7+
ARG UID=1001
88
ARG GID=${UID}
9-
ENV HOME /home/vscode
9+
ENV HOME=/home/vscode
1010
RUN mkdir -p ${HOME} && \
1111
groupadd --gid ${GID} vscode && \
1212
useradd --uid ${UID} --gid ${GID} --home ${HOME} vscode && \
1313
chown -R ${UID}:${GID} /home/vscode
1414

1515
# Fix pyenv installation
1616
RUN echo 'eval "$(pyenv init -)"' >>${HOME}/.bashrc && \
17-
chown -R vscode:vscode ${PYENV_ROOT}
17+
chown -R vscode:vscode "${PYENV_ROOT}" && \
18+
chown -R vscode:vscode "${PIPX_HOME}"
1819

1920
# Set user
2021
USER ${UID}:${GID}

.github/containers/Dockerfile

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
4545
make \
4646
odbc-postgresql \
4747
openssl \
48-
python2-dev \
4948
python3-dev \
5049
python3-pip \
5150
sudo \
@@ -85,7 +84,7 @@ RUN ln -fs "/usr/share/zoneinfo/${TZ}" /etc/localtime && \
8584
dpkg-reconfigure -f noninteractive tzdata
8685

8786
# Use root user
88-
ENV HOME /root
87+
ENV HOME=/root
8988
WORKDIR "${HOME}"
9089

9190
# Install pyenv
@@ -96,12 +95,23 @@ RUN echo 'eval "$(pyenv init -)"' >>${HOME}/.bashrc && \
9695
pyenv update
9796

9897
# Install Python
99-
ARG PYTHON_VERSIONS="3.11 3.10 3.9 3.8 3.7 3.12 pypy3.10-7.3.15"
100-
COPY --chown=1000:1000 --chmod=+x ./install-python.sh /tmp/install-python.sh
98+
ARG PYTHON_VERSIONS="3.12 3.11 3.10 3.9 3.8 3.7 3.13 pypy3.10-7.3.17"
99+
COPY --chown=0:0 --chmod=755 ./install-python.sh /tmp/install-python.sh
101100
RUN /tmp/install-python.sh && \
102101
rm /tmp/install-python.sh
103102

104103
# Install dependencies for main python installation
105104
COPY ./requirements.txt /tmp/requirements.txt
106105
RUN pyenv exec pip install --upgrade -r /tmp/requirements.txt && \
107-
rm /tmp/requirements.txt
106+
rm /tmp/requirements.txt
107+
108+
# Install tools with pipx in isolated environments
109+
COPY ./requirements-tools.txt /tmp/requirements-tools.txt
110+
ENV PIPX_HOME="/opt/pipx"
111+
ENV PIPX_BIN_DIR="${PIPX_HOME}/bin"
112+
ENV PATH="${PIPX_BIN_DIR}:${PATH}"
113+
RUN mkdir -p "${PIPX_BIN_DIR}" && \
114+
while IFS="" read -r line || [ -n "$line" ]; do \
115+
pyenv exec pipx install --global "${line}"; \
116+
done </tmp/requirements-tools.txt && \
117+
rm /tmp/requirements-tools.txt
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
bandit
2+
black
3+
flake8
4+
flynt
5+
isort
6+
tox
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
bandit
2-
black
3-
flake8
4-
isort
51
pip
2+
pipx
63
setuptools
7-
tox
84
virtualenv
95
wheel

.github/workflows/tests.yml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ concurrency:
3131
jobs:
3232
# Aggregate job that provides a single check for all tests passing
3333
tests:
34-
runs-on: ubuntu-20.04
34+
runs-on: ubuntu-latest
3535
needs:
3636
- python
3737
- elasticsearchserver07
@@ -98,7 +98,7 @@ jobs:
9898
# Combine and upload coverage data
9999
coverage:
100100
if: success() || failure() # Does not run on cancelled workflows
101-
runs-on: ubuntu-20.04
101+
runs-on: ubuntu-latest
102102
needs:
103103
- tests
104104

@@ -160,7 +160,7 @@ jobs:
160160
20,
161161
]
162162

163-
runs-on: ubuntu-20.04
163+
runs-on: ubuntu-latest
164164
container:
165165
image: ghcr.io/newrelic/newrelic-python-agent-ci:latest
166166
options: >-
@@ -209,7 +209,7 @@ jobs:
209209
matrix:
210210
group-number: [1]
211211

212-
runs-on: ubuntu-20.04
212+
runs-on: ubuntu-latest
213213
container:
214214
image: ghcr.io/newrelic/newrelic-python-agent-ci:latest
215215
options: >-
@@ -258,7 +258,7 @@ jobs:
258258
matrix:
259259
group-number: [1, 2]
260260

261-
runs-on: ubuntu-20.04
261+
runs-on: ubuntu-latest
262262
container:
263263
image: ghcr.io/newrelic/newrelic-python-agent-ci:latest
264264
options: >-
@@ -322,7 +322,7 @@ jobs:
322322
matrix:
323323
group-number: [1]
324324

325-
runs-on: ubuntu-20.04
325+
runs-on: ubuntu-latest
326326
container:
327327
image: ghcr.io/newrelic/newrelic-python-agent-ci:latest
328328
options: >-
@@ -386,7 +386,7 @@ jobs:
386386
matrix:
387387
group-number: [1]
388388

389-
runs-on: ubuntu-20.04
389+
runs-on: ubuntu-latest
390390
container:
391391
image: ghcr.io/newrelic/newrelic-python-agent-ci:latest
392392
options: >-
@@ -453,7 +453,7 @@ jobs:
453453
matrix:
454454
group-number: [1, 2]
455455

456-
runs-on: ubuntu-20.04
456+
runs-on: ubuntu-latest
457457
container:
458458
image: ghcr.io/newrelic/newrelic-python-agent-ci:latest
459459
options: >-
@@ -520,7 +520,7 @@ jobs:
520520
matrix:
521521
group-number: [1]
522522

523-
runs-on: ubuntu-20.04
523+
runs-on: ubuntu-latest
524524
container:
525525
image: ghcr.io/newrelic/newrelic-python-agent-ci:latest
526526
options: >-
@@ -623,7 +623,7 @@ jobs:
623623
matrix:
624624
group-number: [1, 2]
625625

626-
runs-on: ubuntu-20.04
626+
runs-on: ubuntu-latest
627627
container:
628628
image: ghcr.io/newrelic/newrelic-python-agent-ci:latest
629629
options: >-
@@ -685,7 +685,7 @@ jobs:
685685
matrix:
686686
group-number: [1]
687687

688-
runs-on: ubuntu-20.04
688+
runs-on: ubuntu-latest
689689
container:
690690
image: ghcr.io/newrelic/newrelic-python-agent-ci:latest
691691
options: >-
@@ -749,7 +749,7 @@ jobs:
749749
matrix:
750750
group-number: [1, 2]
751751

752-
runs-on: ubuntu-20.04
752+
runs-on: ubuntu-latest
753753
container:
754754
image: ghcr.io/newrelic/newrelic-python-agent-ci:latest
755755
options: >-
@@ -811,7 +811,7 @@ jobs:
811811
matrix:
812812
group-number: [1]
813813

814-
runs-on: ubuntu-20.04
814+
runs-on: ubuntu-latest
815815
container:
816816
image: ghcr.io/newrelic/newrelic-python-agent-ci:latest
817817
options: >-
@@ -874,7 +874,7 @@ jobs:
874874
matrix:
875875
group-number: [1, 2, 3, 4]
876876

877-
runs-on: ubuntu-20.04
877+
runs-on: ubuntu-latest
878878
container:
879879
image: ghcr.io/newrelic/newrelic-python-agent-ci:latest
880880
options: >-
@@ -948,7 +948,7 @@ jobs:
948948
matrix:
949949
group-number: [1]
950950

951-
runs-on: ubuntu-20.04
951+
runs-on: ubuntu-latest
952952
container:
953953
image: ghcr.io/newrelic/newrelic-python-agent-ci:latest
954954
options: >-
@@ -1010,7 +1010,7 @@ jobs:
10101010
matrix:
10111011
group-number: [1]
10121012

1013-
runs-on: ubuntu-20.04
1013+
runs-on: ubuntu-latest
10141014
container:
10151015
image: ghcr.io/newrelic/newrelic-python-agent-ci:latest
10161016
options: >-
@@ -1074,7 +1074,7 @@ jobs:
10741074
matrix:
10751075
group-number: [1]
10761076

1077-
runs-on: ubuntu-20.04
1077+
runs-on: ubuntu-latest
10781078
container:
10791079
image: ghcr.io/newrelic/newrelic-python-agent-ci:latest
10801080
options: >-
@@ -1139,7 +1139,7 @@ jobs:
11391139
matrix:
11401140
group-number: [1]
11411141

1142-
runs-on: ubuntu-20.04
1142+
runs-on: ubuntu-latest
11431143
container:
11441144
image: ghcr.io/newrelic/newrelic-python-agent-ci:latest
11451145
options: >-

tox.ini

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ envlist =
9191
python-agent_unittests-{py37,py38,py39,py310,py311,py312}-{with,without}_extensions,
9292
python-agent_unittests-pypy310-without_extensions,
9393
python-application_celery-{py37,py38,py39,py310,py311,py312,pypy310}-celerylatest,
94-
python-application_celery-py311-celery{0503,0502,0501},
94+
python-application_celery-py311-celery{0504,0503,0502},
9595
python-component_djangorestframework-{py37,py38,py39,py310,py311,py312}-djangorestframeworklatest,
9696
python-component_flask_rest-{py38,py39,py310,py311,py312,pypy310}-flaskrestxlatest,
9797
python-component_flask_rest-py37-flaskrestx110,
@@ -156,8 +156,9 @@ envlist =
156156
python-template_jinja2-py37-jinja2030103,
157157
python-template_mako-{py37,py38,py39,py310,py311,py312},
158158
rabbitmq-messagebroker_pika-{py37,py38,py39,py310,py311,py312,pypy310}-pikalatest,
159-
redis-datastore_redis-{py37,py38,py39,py310,py311,py312,pypy310}-redis{04,latest},
160-
rediscluster-datastore_rediscluster-{py37,py311,py312,pypy310}-redislatest,
159+
redis-datastore_redis-{py37,py311,pypy310}-redis04,
160+
redis-datastore_redis-{py37,py38,py39,py310,py311,py312,pypy310}-redislatest,
161+
rediscluster-datastore_rediscluster-{py37,py312,pypy310}-redislatest,
161162
solr-datastore_pysolr-{py37,py38,py39,py310,py311,py312,pypy310},
162163

163164
[testenv]
@@ -199,9 +200,9 @@ deps =
199200
agent_features: beautifulsoup4
200201
agent_features: protobuf
201202
application_celery-celerylatest: celery[pytest]
203+
application_celery-celery0504: celery[pytest]<5.5
202204
application_celery-celery0503: celery[pytest]<5.4
203205
application_celery-celery0502: celery[pytest]<5.3
204-
application_celery-celery0501: celery[pytest]<5.2
205206
application_celery-{py37,pypy310}: importlib-metadata<5.0
206207
mlmodel_sklearn: pandas
207208
mlmodel_sklearn: protobuf

0 commit comments

Comments
 (0)