Skip to content

Commit 5fc29f6

Browse files
authored
Merge pull request #600 from donny-wong/v2.7.0
V2.7.0
2 parents cb29334 + afa0e2e commit 5fc29f6

38 files changed

+637
-96
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
repos:
22
- repo: https://github.com/psf/black
3-
rev: 24.10.0
3+
rev: 25.1.0
44
hooks:
55
- id: black
66
- repo: https://github.com/pycqa/flake8
7-
rev: 7.1.1
7+
rev: 7.1.2
88
hooks:
99
- id: flake8

Changelog.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,20 @@
11
# CHANGELOG
22
All notable changes to this project will be documented here.
33

4+
## [v2.7.0]
5+
- Update python, pyta and jupyter testers to allow a requirements file (#580)
6+
- Update R tester to allow a renv.lock file (#581)
7+
- Improve display of Python package installation errors when creating environment (#585)
8+
- Update "setting up test environment" message with http response of status code 503 (#589)
9+
- Change rlimit resource settings to apply each worker individually (#587)
10+
- Drop support for Python 3.8 (#590)
11+
- Use Python 3.13 in development (#590)
12+
- Update Docker configuration to install dependencies in a separate service (#590)
13+
- Improve error reporting with handled assertion errors (#591)
14+
- Add custom pytest markers to Python tester to record MarkUs metadata (#592)
15+
- Stop the autotester from running tests if there are errors in test settings (#593)
16+
- Implement Redis backoff strategy (#594)
17+
418
## [v2.6.0]
519
- Update python versions in docker file (#568)
620
- Update Github Actions config to use Python 3.11-3.13 and update action versions (#569)

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,8 @@ redis_url: # url of the redis database. default is: redis://127.0.0.1:6379/0
196196
supervisor_url: # url used by the supervisor process. default is: '127.0.0.1:9001'
197197
# This can also be set with the SUPERVISOR_URL environment variable.
198198
199+
worker_log_dir: # an absolute path to a directory containing the worker's stdout and stderr logs.
200+
199201
rlimit_settings: # RLIMIT settings (see details below)
200202
nproc: # for example, this setting sets the hard and soft limits for the number of processes available to 300
201203
- 300

client/.dockerfiles/Dockerfile

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,7 @@ FROM ubuntu:$UBUNTU_VERSION
55
RUN apt-get update -y && \
66
DEBIAN_FRONTEND=noninteractive apt-get -y install software-properties-common && \
77
DEBIAN_FRONTEND=noninteractive add-apt-repository -y ppa:deadsnakes/ppa && \
8-
DEBIAN_FRONTEND=noninteractive apt-get install -y python3.11 python3.11-venv
9-
10-
COPY ./requirements.txt /requirements.txt
11-
12-
RUN python3.11 -m venv /markus_venv && \
13-
/markus_venv/bin/pip install wheel && \
14-
/markus_venv/bin/pip install -r /requirements.txt
8+
DEBIAN_FRONTEND=noninteractive apt-get install -y python3.13 python3.13-venv
159

1610
WORKDIR /app
1711

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/env bash
2+
3+
[ -f /markus_venv/bin/python3.13 ] || python3.13 -m venv /markus_venv
4+
5+
/markus_venv/bin/pip install -q --upgrade pip
6+
/markus_venv/bin/pip install -q wheel
7+
printf "[MarkUs] Running pip install -q -r requirements.txt..."
8+
if /markus_venv/bin/pip install -q -r requirements.txt; then
9+
printf " \e[32m✔\e[0m \n"
10+
fi
11+
12+
# Execute the provided command
13+
exec "$@"

client/autotest_client/__init__.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
import traceback
1212
import dotenv
1313
import redis
14+
from redis.retry import Retry
15+
from redis.exceptions import TimeoutError, ConnectionError
16+
from redis.backoff import FullJitterBackoff
1417
from datetime import datetime
1518
from contextlib import contextmanager
1619

@@ -24,7 +27,12 @@
2427
SETTINGS_JOB_TIMEOUT = os.environ.get("SETTINGS_JOB_TIMEOUT", 600)
2528
REDIS_URL = os.environ["REDIS_URL"]
2629

27-
REDIS_CONNECTION = redis.Redis.from_url(REDIS_URL)
30+
REDIS_CONNECTION = redis.Redis.from_url(
31+
REDIS_URL,
32+
retry=Retry(FullJitterBackoff(cap=10, base=1), 25),
33+
retry_on_error=[ConnectionError, TimeoutError],
34+
health_check_interval=1,
35+
)
2836

2937
app = Flask(__name__)
3038

@@ -224,7 +232,7 @@ def run_tests(settings_id, user):
224232
test_settings = json.loads(REDIS_CONNECTION.hget("autotest:settings", key=settings_id))
225233
env_status = test_settings.get("_env_status")
226234
if env_status == "setup":
227-
raise Exception("Setting up test environment. Please try again later.")
235+
abort(make_response(jsonify(message="Setting up test environment. Please try again later."), 503))
228236
elif env_status == "error":
229237
msg = "Settings Error"
230238
settings_error = test_settings.get("_error", "")

client/requirements.txt

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
1-
flask==2.2.5;python_version<"3.8"
2-
flask==3.0.3;python_version>="3.8"
3-
python-dotenv==0.21.1;python_version<"3.8"
4-
python-dotenv==1.0.1;python_version>="3.8"
5-
rq==2.0.0
6-
redis==5.2.0
7-
jsonschema==4.17.3;python_version<"3.8"
8-
jsonschema==4.23.0;python_version>="3.8"
9-
Werkzeug==2.2.3;python_version<"3.8"
10-
Werkzeug==3.1.3;python_version>="3.8"
1+
flask==3.1.0
2+
python-dotenv==1.0.1
3+
rq==2.1.0
4+
redis==5.2.1
5+
jsonschema==4.23.0
6+
Werkzeug==3.1.3

compose.yaml

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,39 @@
11
services:
2-
server:
2+
server: &server
33
build:
44
context: ./server
55
dockerfile: ./.dockerfiles/Dockerfile
66
args:
77
UBUNTU_VERSION: '22.04'
88
LOGIN_USER: 'docker'
99
WORKSPACE: '/home/docker/.autotesting'
10-
image: markus-autotest-server-dev:1.2.0
10+
image: markus-autotest-server-dev:1.3.0
1111
volumes:
1212
- ./server:/app:cached
13+
- venv_server:/home/docker/markus_venv
1314
- workspace:/home/docker/.autotesting:rw
1415
environment:
1516
- REDIS_URL=redis://redis:6379/
1617
- WORKSPACE=/home/docker/.autotesting
1718
- SUPERVISOR_URL=127.0.0.1:9001
1819
- AUTOTESTER_CONFIG=/app/.dockerfiles/docker-config.yml
1920
- STACK_ROOT=/home/docker/.autotesting/.stack
21+
- WORKER_LOG_DIR=/home/docker/.autotesting/worker_log_dir
2022
depends_on:
2123
- postgres
2224
- redis
2325

24-
client:
26+
client: &client
2527
build:
2628
context: ./client
2729
dockerfile: ./.dockerfiles/Dockerfile
2830
args:
2931
UBUNTU_VERSION: '22.04'
30-
image: markus-autotest-client-dev:1.2.0
32+
image: markus-autotest-client-dev:1.3.0
3133
container_name: 'autotest-client'
3234
volumes:
3335
- ./client:/app:cached
36+
- venv_client:/markus_venv
3437
environment:
3538
- REDIS_URL=redis://redis:6379/
3639
- FLASK_HOST=0.0.0.0
@@ -43,6 +46,20 @@ services:
4346
- default
4447
- markus_dev
4548

49+
server-deps-updater:
50+
<<: *server
51+
entrypoint: "/app/.dockerfiles/entrypoint-dev-deps-updater.sh"
52+
profiles: ["manual"] # Prevent service from starting automatically
53+
depends_on: []
54+
55+
client-deps-updater:
56+
<<: *client
57+
entrypoint: ".dockerfiles/entrypoint-dev-deps-updater.sh"
58+
profiles: ["manual"] # Prevent service from starting automatically
59+
ports: []
60+
depends_on: []
61+
networks: []
62+
4663
postgres:
4764
image: postgres:14
4865
volumes:
@@ -72,6 +89,8 @@ services:
7289
volumes:
7390
postgres_autotest:
7491
redis_autotest:
92+
venv_client:
93+
venv_server:
7594
workspace:
7695

7796
networks:

server/.dockerfiles/Dockerfile

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,12 @@ RUN chmod a+x /home/${LOGIN_USER}
4343

4444
COPY . /app
4545

46-
RUN python3.11 -m venv /markus_venv && \
47-
/markus_venv/bin/pip install wheel && \
48-
/markus_venv/bin/pip install -r /app/requirements.txt && \
49-
find /app/autotest_server/testers -name requirements.system -exec {} \; && \
50-
rm -rf /app/*
46+
RUN find /app/autotest_server/testers -name requirements.system -exec {} \;
5147

5248
RUN echo "TZ=$( cat /etc/timezone )" >> /etc/R/Renviron.site
5349

5450
RUN mkdir -p ${WORKSPACE} && chown ${LOGIN_USER} ${WORKSPACE}
51+
RUN mkdir -p /home/${LOGIN_USER}/markus_venv && chown ${LOGIN_USER} /home/${LOGIN_USER}/markus_venv
5552

5653
WORKDIR /home/${LOGIN_USER}
5754

server/.dockerfiles/cmd-dev.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/usr/bin/env bash
22

3-
/markus_venv/bin/python /app/install.py
4-
/markus_venv/bin/python /app/start_stop.py start -n
3+
markus_venv/bin/python /app/install.py
4+
markus_venv/bin/python /app/start_stop.py start -n

0 commit comments

Comments
 (0)