From c99ae3374ecf8540c2a223de27b6045491ccc744 Mon Sep 17 00:00:00 2001 From: Jason Sollom Date: Tue, 12 Dec 2023 15:49:05 -0600 Subject: [PATCH 1/3] CASMCMS-8879: Fix build issue caused by PEP-668 PEP-668 allows file systems to be labeled as 'externally managed'. Pip will see this label and refuse to install into any directory thusly labeled. The idea is to prevent pip from installing its packages into a directory that the operating system owns. To install files correctly, I utilize a virtual environment and install them into there. The PATH variable is modified to point first at this virtual environment. uwsgi is installed into this virtual environment and run out of there rather than being run from the operating system. --- CHANGELOG.md | 4 ++++ Dockerfile | 11 ++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 67117c87..9d412403 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## Unreleased +### Fixed +- Fix a broken build caused by PEP-668. + ## [2.11.0] - 2023-12-04 ### Changed - Sessions that specify nodes that aren't in the current tenant will fail diff --git a/Dockerfile b/Dockerfile index 59392695..626a067c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -56,8 +56,13 @@ COPY constraints.txt requirements.txt /app/ RUN apk add --upgrade --no-cache apk-tools busybox && \ apk update && \ apk add --no-cache gcc g++ python3-dev py3-pip musl-dev libffi-dev openssl-dev && \ - apk -U upgrade --no-cache && \ - pip3 install --no-cache-dir -U pip + apk -U upgrade --no-cache +# Create a virtual environment in which we can install Python packages. This +# isolates our installation from the system installation. +ENV VIRTUAL_ENV=/app/venv +RUN python3 -m venv $VIRTUAL_ENV +ENV PATH="$VIRTUAL_ENV/bin:$PATH" +RUN pip3 install --no-cache-dir -U pip RUN --mount=type=secret,id=netrc,target=/root/.netrc pip3 install --no-cache-dir -r requirements.txt RUN cd lib && pip3 install --no-cache-dir . @@ -87,7 +92,7 @@ CMD [ "./docker_api_test_entry.sh" ] FROM base as intermediate WORKDIR /app EXPOSE 9000 -RUN apk add --no-cache uwsgi-python3 +RUN pip3 install --no-cache-dir uWSGI COPY config/uwsgi.ini ./ ENTRYPOINT ["uwsgi", "--ini", "/app/uwsgi.ini"] From d723d6bbca5b161f63d672dcef8676ddb69a9218 Mon Sep 17 00:00:00 2001 From: Jason Sollom Date: Wed, 10 Jan 2024 10:58:14 -0600 Subject: [PATCH 2/3] CASMCMS-8879: Unpin the Alpine version from 3.18 back to 3 The python virtual environment change should enable us to move ahead to later versions of Alpine 3 beyond 3.18. These later versions should not cause problems due PEP-668 because the resolution to CASMCMS-8879 fixed that issue. Pinning the version to 3.18 prevented us from encountering the PEP-668 problem because it pinned to a version of Alpine that did not introduce the issue. --- CHANGELOG.md | 2 +- Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bf4f4eb5..9ef70afe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] ### Fixed -- Fix a broken build caused by PEP-668. +- Fix a broken build caused by PEP-668. Pin Alpine version to 3. This is less restrictive. ## [2.12.0] - 2024-01-02 ### Changed diff --git a/Dockerfile b/Dockerfile index a17c0072..a08bf598 100644 --- a/Dockerfile +++ b/Dockerfile @@ -25,7 +25,7 @@ # Upstream Build Args ARG OPENAPI_IMAGE=artifactory.algol60.net/csm-docker/stable/docker.io/openapitools/openapi-generator-cli:v6.6.0 -ARG ALPINE_BASE_IMAGE=artifactory.algol60.net/csm-docker/stable/docker.io/library/alpine:3.18 +ARG ALPINE_BASE_IMAGE=artifactory.algol60.net/csm-docker/stable/docker.io/library/alpine:3 # Generate Code FROM $OPENAPI_IMAGE as codegen From 614ddc0b934055e4b5e79fe531eb6533fbc1169f Mon Sep 17 00:00:00 2001 From: Jason Sollom Date: Wed, 10 Jan 2024 11:56:57 -0600 Subject: [PATCH 3/3] Release BOS version 2.13.0 Update CHANGELOG. --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ef70afe..39d7f16d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased] +## [2.13.0] - 2024-01-10 ### Fixed - Fix a broken build caused by PEP-668. Pin Alpine version to 3. This is less restrictive.