Skip to content

Commit efa5a14

Browse files
authored
Upgrade pyyaml to 6.0.1 (#445)
* Upgrade pyyaml to 6.0.1 Previous versions are incompatible with Cython 3.0.0, which was released just the previous week. See yaml/pyyaml#724 * Upgrade package versions, from dependabot warnings. sqlparse to 0.4.4 requests to 2.31.0 django to 3.2.20 cryptography to 41.0.2 * Fix CI. The new machine runs a new version of Docker. We require changes. The new machine runs python 3.10, we require changes.
1 parent d4a5144 commit efa5a14

10 files changed

+200
-106
lines changed

.circleci/Dockerfile-coord

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
FROM python:3.6
1+
FROM python:3.10
22
ENV PYTHONUNBUFFERED 1
33

4-
RUN pip install appdeps
4+
RUN pip3 install appdeps
55

66
RUN mkdir /scionlab
77
WORKDIR /scionlab
88
COPY requirements.txt dev-requirements.txt /scionlab/
9-
RUN pip install -r requirements.txt -r dev-requirements.txt
9+
RUN pip3 install -r requirements.txt -r dev-requirements.txt
1010
COPY . /scionlab/
1111

1212
# Fixup django settings for the integration tests:

.circleci/Dockerfile-scionHost

+8-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
1-
FROM ubuntu:bionic
1+
FROM ubuntu:jammy
2+
# New docker versions seem __NOT__ to create /.dockerenv during __image creation__. But we need it.
3+
RUN touch /.dockerenv
24

35
ARG package_repo=packages.netsec.inf.ethz.ch
46

7+
# Force debconf (called by apt-get) to be noninteractive
8+
ENV DEBIAN_FRONTEND=noninteractive
9+
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
10+
511
# Install base
612
RUN apt-get update && apt-get install --assume-yes \
713
systemd \
@@ -11,7 +17,7 @@ RUN apt-get update && apt-get install --assume-yes \
1117
curl \
1218
moreutils
1319

14-
# systemd
20+
# systemd configuration. Note that the cgroup volume is no longer needed, nor works like documented below.
1521
# Based on: https://developers.redhat.com/blog/2014/05/05/running-systemd-within-docker-container/
1622
# - converted to ubuntu, i.e. fixed some paths and removed unnecessary cleanup
1723
# - keep systemd-user-sessions.service, to allow login through SSH (login disabled on startup until this is run)
@@ -23,7 +29,6 @@ rm -f /lib/systemd/system/local-fs.target.wants/*; \
2329
rm -f /lib/systemd/system/sockets.target.wants/*udev*; \
2430
rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \
2531
rm -f /lib/systemd/system/basic.target.wants/*;
26-
VOLUME [ "/sys/fs/cgroup" ]
2732

2833
# Install SCION
2934
# XXX(matzf): install testing/prod based on branch name???

.circleci/config.yml

+19-4
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ commands:
7272
jobs:
7373
style-check:
7474
docker:
75-
- image: cimg/python:3.6.13
75+
- image: cimg/python:3.10
7676
steps:
7777
- install_git_lfs
7878
- cached_checkout
@@ -91,7 +91,7 @@ jobs:
9191

9292
unit-tests:
9393
docker:
94-
- image: cimg/python:3.6.13
94+
- image: cimg/python:3.10
9595
steps:
9696
- install_git_lfs
9797
- cached_checkout
@@ -111,7 +111,7 @@ jobs:
111111

112112
integration-tests:
113113
machine:
114-
image: ubuntu-2004:202107-02
114+
image: ubuntu-2204:2023.07.2
115115
docker_layer_caching: true
116116
environment:
117117
COMPOSE_FILE: ".circleci/docker-compose.yml"
@@ -120,10 +120,23 @@ jobs:
120120

121121
- cached_checkout
122122

123+
- run:
124+
name: Python defaults
125+
command: |
126+
set -x
127+
128+
# Use python3 as default
129+
VERSION=$(pyenv versions --bare | grep -e "^3." | tail -n 1)
130+
echo "Python3 version is: $VERSION"
131+
pyenv global $VERSION
132+
133+
pip install --upgrade pip setuptools wheel install
134+
123135
- run:
124136
name: Build and start containers for coordinator and ASes
125137
command: |
126138
set -x
139+
127140
pip install pyyaml
128141
129142
.circleci/setup/build-containers.sh --build-arg package_repo=packages-test.netsec.inf.ethz.ch
@@ -199,10 +212,12 @@ jobs:
199212
name: OLD -- Checkout
200213
command: |
201214
git checkout --force -B master --track origin/master
215+
202216
- run:
203217
name: OLD -- Build and start containers for coordinator and ASes
204218
command: |
205219
set -x
220+
206221
pip install pyyaml
207222
208223
.circleci/setup/build-containers.sh --build-arg package_repo=packages.netsec.inf.ethz.ch # start with released packages
@@ -237,7 +252,7 @@ jobs:
237252

238253
production-stack-tests:
239254
machine:
240-
image: ubuntu-2004:202107-02
255+
image: ubuntu-2204:2023.07.2
241256
docker_layer_caching: true
242257
environment:
243258
COMPOSE_FILE: "docker-compose.yml:.circleci/docker-compose.test-prod-db.yaml"

.circleci/docker-compose.yml

-12
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,6 @@ services:
5353
ipv4_address: 172.31.0.110
5454
env_file: /tmp/as1301.env
5555
privileged: true
56-
volumes:
57-
- /sys/fs/cgroup:/sys/fs/cgroup:ro
5856

5957
as1303:
6058
build:
@@ -65,8 +63,6 @@ services:
6563
ipv4_address: 172.31.0.111
6664
env_file: /tmp/as1303.env
6765
privileged: true
68-
volumes:
69-
- /sys/fs/cgroup:/sys/fs/cgroup:ro
7066

7167
as1305:
7268
build:
@@ -77,8 +73,6 @@ services:
7773
ipv4_address: 172.31.0.112
7874
env_file: /tmp/as1305.env
7975
privileged: true
80-
volumes:
81-
- /sys/fs/cgroup:/sys/fs/cgroup:ro
8276

8377
as1401:
8478
build:
@@ -89,8 +83,6 @@ services:
8983
ipv4_address: 172.31.0.113
9084
env_file: /tmp/as1401.env
9185
privileged: true
92-
volumes:
93-
- /sys/fs/cgroup:/sys/fs/cgroup:ro
9486

9587
as1405:
9688
build:
@@ -101,8 +93,6 @@ services:
10193
ipv4_address: 172.31.0.114
10294
env_file: /tmp/as1405.env
10395
privileged: true
104-
volumes:
105-
- /sys/fs/cgroup:/sys/fs/cgroup:ro
10696

10797
useras4:
10898
build:
@@ -113,8 +103,6 @@ services:
113103
ipv4_address: 172.31.0.2
114104
env_file: /tmp/as4.env
115105
privileged: true
116-
volumes:
117-
- /sys/fs/cgroup:/sys/fs/cgroup:ro
118106

119107
volumes:
120108
pgdata:

.circleci/setup/generate-host-envs.py

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
# Write the information to /tmp/asXY.env files, so it can easily be consumed in the docker-compose
44
# setup.
55

6-
from __future__ import print_function
76
import yaml
87

98
import os

.circleci/setup/init-ases.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515

16-
for c in $(docker-compose ps --services egrep -x '(user)?as[0-9]+'); do
16+
for c in $(docker-compose ps --services | egrep -x '(user)?as[0-9]+'); do
1717
docker-compose exec -T "$c" /bin/bash -c 'scionlab-config --host-id ${SCIONLAB_HOST_ID} --host-secret ${SCIONLAB_HOST_SECRET} --url http://coord:8000'
1818
done

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ source venv/bin/activate
4242
# Install Python requirements (Django, libraries, etc.)
4343
pip install --require-hashes -r requirements.txt -r dev-requirements.txt
4444

45-
# NOTE: the 'scrypt' package may fail to build if libssl is not installed
45+
# NOTE: Some packages may fail to build. To ensure a complete dev setup is ready, in ubuntu you would run:
46+
# apt install gcc libpq-dev libpython3-dev libffi-dev
4647
# on your machine; install and try again.
47-
# apt install libssl1.0
4848
```
4949

5050
To render the topology graph, `graphviz` needs to be installed additionally to the python dependencies. On ubuntu:

deploy/Dockerfile-django

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3.6
1+
FROM python:3.10
22
ENV PYTHONUNBUFFERED 1
33

44
# Graphviz is used to render the topology (see scionlab.views.topology); the python
@@ -8,12 +8,12 @@ RUN apt-get update && apt-get install -y graphviz
88
# Appdeps is used by the entrypoint script to wait for the DB services.
99
# Not included in requirements because it's a requirement of the
1010
# docker-compose plumbing, not the application.
11-
RUN pip install appdeps
11+
RUN pip3 install appdeps
1212

1313
RUN mkdir /scionlab
1414
WORKDIR /scionlab
1515
COPY requirements.txt /scionlab/
16-
RUN pip install -r requirements.txt
16+
RUN pip3 install -r requirements.txt
1717
COPY . /scionlab/
1818

1919

requirements.in

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
Django>=3.2.18,<4.0
2-
cryptography>=39.0.1
1+
Django>=3.2.20,<4.0
2+
cryptography>=41.0.2
33
django-crispy-forms>=1.9.0
44
django-extensions
55
django-maintenance-mode>=0.14.0
@@ -10,6 +10,10 @@ gunicorn
1010
jinja2
1111
psycopg2-binary # PostgreSQL backend
1212
pynacl
13-
pyyaml>=4.2b1 # for fixtures and config generation; high severity vulnerability before 4.1 (CVE-2017-18342)
13+
pyyaml>=6.0.1 # for fixtures and config generation; high severity vulnerability before 4.1 (CVE-2017-18342), Cython>=3.0.0 (released in 2023) incompatible before 6.0.1
1414
scrypt
1515
toml
16+
17+
18+
# Sub-dependencies of above packages which have security implications, and thus require specific prerequisites:
19+
requests>=2.31.0

0 commit comments

Comments
 (0)