Skip to content

Commit 559fb35

Browse files
committed
pull request #1128 from OasisLMF/update/main-python-3.12
1 parent 6804612 commit 559fb35

19 files changed

Lines changed: 335 additions & 361 deletions

.github/workflows/build-images.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ env:
7272
IGNORE_UNFIXED: 'true'
7373
SEVERITY: 'CRITICAL,HIGH'
7474
IMAGE_REPO: 'coreoasis/github-actions'
75+
TRIVY_SKIP_DB_UPDATE: true
76+
TRIVY_SKIP_JAVA_DB_UPDATE: true
7577

7678
jobs:
7779
build:

.github/workflows/build-schema.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ jobs:
3939
steps:
4040
- uses: actions/checkout@v3
4141

42-
- name: Set up Python 3.10
42+
- name: Set up Python 3.12
4343
uses: actions/setup-python@v4
4444
with:
45-
python-version: '3.10'
45+
python-version: '3.12'
4646

4747
- name: Install requirments
4848
run: pip install -r requirements-server.txt

.github/workflows/code-quality.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: Set up Python
1919
uses: actions/setup-python@v4
2020
with:
21-
python-version: "3.10"
21+
python-version: "3.12"
2222

2323
- name: install pip tools
2424
run: |

.github/workflows/scan-external.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ on:
1515
env:
1616
SEVERITY: 'HIGH,CRITICAL'
1717
IGNORE_UNFIXED: 'true'
18+
TRIVY_SKIP_DB_UPDATE: true
19+
TRIVY_SKIP_JAVA_DB_UPDATE: true
1820

1921
jobs:
2022
scan_external_images:

.github/workflows/scan.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ jobs:
4545
REPORT: 'repo-results.sarif'
4646
IGNORE_UNFIXED: 'true'
4747
EXIT_CODE: '1'
48+
TRIVY_SKIP_DB_UPDATE: true
49+
TRIVY_SKIP_JAVA_DB_UPDATE: true
50+
4851
runs-on: ubuntu-latest
4952
steps:
5053
- name: Adding code-scanning URL

.github/workflows/test-images.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,16 +112,15 @@ jobs:
112112
# Select matching base branch on piwind
113113
if [[ "${{ github.event_name }}" = "pull_request" ]]; then
114114
BRANCH=${{ github.base_ref }}
115+
if [[ ! $BRANCH == stable/* ]]; then
116+
BRANCH='main'
117+
fi
115118
elif [[ "${{ github.event_name }}" = "push" ]]; then
116119
BRANCH=${{ github.ref_name }}
117120
else
118121
BRANCH=${{ inputs.piwind_branch }}
119122
fi
120123
121-
#override 'main-platform1' -> 'main'
122-
if [[ "$BRANCH" = 'main-platform1' ]]; then
123-
BRANCH=main
124-
fi
125124
echo "branch=$BRANCH" >> $GITHUB_OUTPUT
126125
127126

.github/workflows/test-python_api.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ jobs:
5151
repository: OasisLMF/OasisPlatform
5252
ref: ${{ env.PLAT_BRANCH }}
5353

54-
- name: Set up Python 3.10
54+
- name: Set up Python 3.12
5555
uses: actions/setup-python@v4
5656
with:
57-
python-version: '3.10'
57+
python-version: '3.12'
5858
- run: pip install -r requirements.txt
5959

6060
- name: Download package

.github/workflows/update-python.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ jobs:
3232
GIT_EMAIL: ${{ secrets.BUILD_GIT_EMAIL }}
3333
GIT_USERNAME: ${{ secrets.BUILD_GIT_USERNAME }}
3434

35-
- name: Set up Python 3.10
35+
- name: Set up Python 3.12
3636
uses: actions/setup-python@v4
3737
with:
38-
python-version: '3.10'
38+
python-version: '3.12'
3939

4040
- name: Install piptools
4141
run: pip install pip-tools setuptools-rust

.github/workflows/version.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,11 @@ jobs:
7777
echo ${{ inputs.platform_version }} > VERSION
7878
git add VERSION
7979
80-
- name: Set up Python 3.10
80+
- name: Set up Python 3.12
8181
if: inputs.oasislmf_version != ''
8282
uses: actions/setup-python@v4
8383
with:
84-
python-version: '3.10'
84+
python-version: '3.12'
8585

8686
- name: Install piptools
8787
run: pip install pip-tools

Dockerfile.api_server

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
# ---- STAGE 1 -----
2-
FROM ubuntu:22.04 AS build-packages
2+
FROM ubuntu:24.04 AS build-packages
33

4+
ENV PIP_BREAK_SYSTEM_PACKAGES 1
45
ENV DEBIAN_FRONTEND noninteractive
56
COPY ./requirements-server.txt ./requirements-server.txt
6-
RUN apt-get update && apt-get install -y --no-install-recommends gcc build-essential python3 python3-pip python3-dev libmariadbclient-dev-compat && rm -rf /var/lib/apt/lists/*
7+
RUN apt-get update && apt-get install -y --no-install-recommends gcc build-essential python3 python3-pip python3-dev pkg-config libmariadb-dev-compat && rm -rf /var/lib/apt/lists/*
78
RUN pip install --user --no-warn-script-location -r ./requirements-server.txt && pip install --no-warn-script-location --user mysqlclient
89

910
# Install ODS-Tools from git branch (Optional) 'docker build --build-arg ods_tools_branch=develop'
@@ -25,13 +26,16 @@ RUN if [ ! -z "$odm_branch" ] ; then \
2526
USER server
2627

2728
# ---- STAGE 2 ----
28-
FROM ubuntu:22.04
29+
FROM ubuntu:24.04
2930
RUN apt-get update \
3031
&& apt-get upgrade -y \
3132
&& apt-get install -y --no-install-recommends sudo python3 python3-pkg-resources curl libmariadbclient-dev-compat \
3233
&& rm -rf /var/lib/apt/lists/
3334

34-
RUN adduser --home /home/server --shell /bin/bash --disabled-password --gecos "" server
35+
ARG USER_ID=1000
36+
RUN userdel -r ubuntu
37+
RUN useradd -u ${USER_ID} --home /home/server --shell /bin/bash server
38+
3539
COPY --chown=server:server --from=build-packages /root/.local /home/server/.local
3640
RUN mkdir -p /var/log/oasis /shared-fs && chmod 777 -R /var/log/oasis
3741

0 commit comments

Comments
 (0)