From 51c49d24ea57098a1f33b435ebabfe189f70ac3d Mon Sep 17 00:00:00 2001 From: Vallari Agrawal Date: Mon, 3 Jun 2024 22:49:40 +0530 Subject: [PATCH 1/2] Dockefile: use base image 'ubuntu:jammy' instead of focal Default python version in focal is python3.8 which is breaking integration CI builds on t-api PRs with: `ERROR: Package 'teuthology-1.1.1.dev729-g861a8dcf' requires a different Python: 3.8.10 not in '>=3.10'` Recently, we upgraded the minimum teuthology version to support python3.10, which could be the reason of the above CI failures. Signed-off-by: Vallari Agrawal --- Dockerfile | 8 +++++--- start_container.sh | 5 +++-- 2 files changed, 8 insertions(+), 5 deletions(-) mode change 100644 => 100755 start_container.sh diff --git a/Dockerfile b/Dockerfile index 2548abf..66dc4a8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,6 @@ -FROM ubuntu:focal +FROM ubuntu:jammy ENV DEBIAN_FRONTEND=noninteractive +ENV VENV=${VENV:-"venv"} RUN apt-get update && \ apt-get install -y \ git \ @@ -21,7 +22,8 @@ RUN apt-get update && \ COPY .teuthology.yaml /root WORKDIR /teuthology_api COPY . /teuthology_api/ -RUN pip3 install -e . +RUN python3 -m venv ${VENV} +RUN /teuthology_api/${VENV}/bin/pip3 install -e . RUN mkdir /archive_dir/ -CMD sh /teuthology_api/start_container.sh +ENTRYPOINT /teuthology_api/start_container.sh diff --git a/start_container.sh b/start_container.sh old mode 100644 new mode 100755 index c6559d6..2d9919c --- a/start_container.sh +++ b/start_container.sh @@ -1,11 +1,12 @@ -#!/usr/bin/env sh +#!/usr/bin/bash set -ex trap exit TERM HOST=${TEUTHOLOGY_API_SERVER_HOST:-"0.0.0.0"} PORT=${TEUTHOLOGY_API_SERVER_PORT:-"8082"} +VENV=${VENV:-"venv"} - +source ${VENV}/bin/activate cd /teuthology_api/src/ if [ "$DEPLOYMENT" = "development" ]; then From 1cd680bc845989e7cf81fadb0b918d7b9ff0629b Mon Sep 17 00:00:00 2001 From: Vallari Agrawal Date: Thu, 13 Jun 2024 00:23:29 +0530 Subject: [PATCH 2/2] .github/workflows/unit_tests.yaml: Use ubuntu-22.04 and python 3.10 Signed-off-by: Vallari Agrawal --- .github/workflows/unit_tests.yaml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/unit_tests.yaml b/.github/workflows/unit_tests.yaml index 04adff6..f0e1f1a 100644 --- a/.github/workflows/unit_tests.yaml +++ b/.github/workflows/unit_tests.yaml @@ -3,8 +3,13 @@ on: pull_request jobs: build: - - runs-on: ubuntu-latest + name: Unit Tests on python${{ matrix.python }} via ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + include: + - os: ubuntu-22.04 + python: "3.10" steps: - uses: actions/checkout@v4 - name: Setup Python