Skip to content

Commit

Permalink
Merge pull request #1128 from OasisLMF/update/main-python-3.12
Browse files Browse the repository at this point in the history
Update python 3.12
  • Loading branch information
sambles authored Oct 28, 2024
2 parents 6804612 + 47be68a commit 4a8ee11
Show file tree
Hide file tree
Showing 19 changed files with 335 additions and 361 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ env:
IGNORE_UNFIXED: 'true'
SEVERITY: 'CRITICAL,HIGH'
IMAGE_REPO: 'coreoasis/github-actions'
TRIVY_SKIP_DB_UPDATE: true
TRIVY_SKIP_JAVA_DB_UPDATE: true

jobs:
build:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Set up Python 3.10
- name: Set up Python 3.12
uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: '3.12'

- name: Install requirments
run: pip install -r requirements-server.txt
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
python-version: "3.12"

- name: install pip tools
run: |
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/scan-external.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ on:
env:
SEVERITY: 'HIGH,CRITICAL'
IGNORE_UNFIXED: 'true'
TRIVY_SKIP_DB_UPDATE: true
TRIVY_SKIP_JAVA_DB_UPDATE: true

jobs:
scan_external_images:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ jobs:
REPORT: 'repo-results.sarif'
IGNORE_UNFIXED: 'true'
EXIT_CODE: '1'
TRIVY_SKIP_DB_UPDATE: true
TRIVY_SKIP_JAVA_DB_UPDATE: true

runs-on: ubuntu-latest
steps:
- name: Adding code-scanning URL
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/test-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,16 +112,15 @@ jobs:
# Select matching base branch on piwind
if [[ "${{ github.event_name }}" = "pull_request" ]]; then
BRANCH=${{ github.base_ref }}
if [[ ! $BRANCH == stable/* ]]; then
BRANCH='main'
fi
elif [[ "${{ github.event_name }}" = "push" ]]; then
BRANCH=${{ github.ref_name }}
else
BRANCH=${{ inputs.piwind_branch }}
fi
#override 'main-platform1' -> 'main'
if [[ "$BRANCH" = 'main-platform1' ]]; then
BRANCH=main
fi
echo "branch=$BRANCH" >> $GITHUB_OUTPUT
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-python_api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ jobs:
repository: OasisLMF/OasisPlatform
ref: ${{ env.PLAT_BRANCH }}

- name: Set up Python 3.10
- name: Set up Python 3.12
uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: '3.12'
- run: pip install -r requirements.txt

- name: Download package
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/update-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ jobs:
GIT_EMAIL: ${{ secrets.BUILD_GIT_EMAIL }}
GIT_USERNAME: ${{ secrets.BUILD_GIT_USERNAME }}

- name: Set up Python 3.10
- name: Set up Python 3.12
uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: '3.12'

- name: Install piptools
run: pip install pip-tools setuptools-rust
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,11 @@ jobs:
echo ${{ inputs.platform_version }} > VERSION
git add VERSION
- name: Set up Python 3.10
- name: Set up Python 3.12
if: inputs.oasislmf_version != ''
uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: '3.12'

- name: Install piptools
run: pip install pip-tools
Expand Down
12 changes: 8 additions & 4 deletions Dockerfile.api_server
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# ---- STAGE 1 -----
FROM ubuntu:22.04 AS build-packages
FROM ubuntu:24.04 AS build-packages

ENV PIP_BREAK_SYSTEM_PACKAGES 1
ENV DEBIAN_FRONTEND noninteractive
COPY ./requirements-server.txt ./requirements-server.txt
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/*
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/*
RUN pip install --user --no-warn-script-location -r ./requirements-server.txt && pip install --no-warn-script-location --user mysqlclient

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

# ---- STAGE 2 ----
FROM ubuntu:22.04
FROM ubuntu:24.04
RUN apt-get update \
&& apt-get upgrade -y \
&& apt-get install -y --no-install-recommends sudo python3 python3-pkg-resources curl libmariadbclient-dev-compat \
&& rm -rf /var/lib/apt/lists/

RUN adduser --home /home/server --shell /bin/bash --disabled-password --gecos "" server
ARG USER_ID=1000
RUN userdel -r ubuntu
RUN useradd -u ${USER_ID} --home /home/server --shell /bin/bash server

COPY --chown=server:server --from=build-packages /root/.local /home/server/.local
RUN mkdir -p /var/log/oasis /shared-fs && chmod 777 -R /var/log/oasis

Expand Down
9 changes: 6 additions & 3 deletions Dockerfile.model_worker
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# ---- STAGE 1 -----
FROM ubuntu:22.04 AS build-packages
FROM ubuntu:24.04 AS build-packages

# Build python packages
ENV PIP_BREAK_SYSTEM_PACKAGES 1
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y libspatialindex-dev git curl g++ build-essential libtool autoconf automake python3-dev python3 python3-pip pkg-config
COPY ./requirements-worker.txt ./requirements-worker.txt
Expand Down Expand Up @@ -35,14 +36,16 @@ RUN if [ ! -z "$odm_branch" ] ; then \
USER worker

# ---- STAGE 2 ----
FROM ubuntu:22.04
FROM ubuntu:24.04
RUN apt-get update \
&& apt-get upgrade -y \
&& apt-get install -y --no-install-recommends vim git python3 python3-pip libspatialindex-dev curl procps \
&& rm -rf /var/lib/apt/lists/*

# Copy built python packages
RUN adduser --home /home/worker --shell /bin/bash --disabled-password --gecos "" worker
ARG USER_ID=1000
RUN userdel -r ubuntu
RUN useradd -u ${USER_ID} --home /home/worker --shell /bin/bash worker
COPY --chown=worker:worker --from=build-packages /root/.local /home/worker/.local

# Copy in worker files
Expand Down
4 changes: 1 addition & 3 deletions kubernetes/worker-controller/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with Python 3.10
# This file is autogenerated by pip-compile with Python 3.12
# by the following command:
#
# pip-compile kubernetes/worker-controller/requirements.in
Expand All @@ -10,8 +10,6 @@ aiohttp==3.9.4
# kubernetes-asyncio
aiosignal==1.3.1
# via aiohttp
async-timeout==4.0.3
# via aiohttp
attrs==22.1.0
# via aiohttp
certifi==2023.7.22
Expand Down
Loading

0 comments on commit 4a8ee11

Please sign in to comment.