Skip to content

Commit

Permalink
CASMHMS-6282: Avoid PEP 668 build issue with new python by using venv.
Browse files Browse the repository at this point in the history
Also restructured Dockerfiles for easier reading
  • Loading branch information
jwlv committed Dec 16, 2024
1 parent d1d2044 commit 9b335c0
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 21 deletions.
30 changes: 23 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -51,23 +51,39 @@ FROM artifactory.algol60.net/csm-docker/stable/docker.io/library/alpine:3.19 AS

COPY cmd/fw-loader/Pipfile /

#### System Setup

RUN set -x \
&& apk -U upgrade \
&& apk add --no-cache \
bash \
curl \
python3 \
py3-pip \
rpm \
&& mkdir -p /.local \
rpm

#### Environment Preparation

RUN mkdir -p /.local \
&& mkdir -p /.cache \
&& ln -s /.local /root/.local \
&& ln -s /.cache /root/.cache \
&& export LANG="en_US.UTF-8" \
&& pip3 install --upgrade pip \
&& pip3 install pipenv \
&& pipenv install --deploy --ignore-pipfile \
&& mkdir -p /fw && chown 65534:65534 /fw
&& export LANG="en_US.UTF-8"

#### Python Virtual Environment and Dependencies

RUN python3 -m venv /venv \
&& . /venv/bin/activate \
&& pip install --upgrade pip \
&& pip install pipenv

#### Application Dependencies

RUN pipenv install --deploy --ignore-pipfile

#### Final Configuration

RUN mkdir -p /fw && chown 65534:65534 /fw

### Final Stage ###

Expand Down
14 changes: 10 additions & 4 deletions Dockerfile.functionaltesting.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,22 @@

FROM artifactory.algol60.net/csm-docker/stable/docker.io/library/alpine:3.19 AS build-base

#### System Setup

RUN set -ex \
&& apk -U upgrade \
&& apk add --no-cache \
bash \
curl \
python3 \
py3-pip \
&& pip3 install --upgrade pip \
&& pip3 install \
pipenv \
py3-pip

#### Python Virtual Environment and Dependencies

RUN python3 -m venv /venv \
&& . /venv/bin/activate \
&& pip install --upgrade pip \
&& pip install pipenv \
requests \
pytest

Expand Down
30 changes: 23 additions & 7 deletions Dockerfile.integration.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -51,23 +51,39 @@ FROM artifactory.algol60.net/csm-docker/stable/docker.io/library/alpine:3.19 AS

COPY cmd/fw-loader/Pipfile /

#### System Setup

RUN set -x \
&& apk -U upgrade \
&& apk add --no-cache \
bash \
curl \
python3 \
py3-pip \
rpm \
&& mkdir -p /.local \
rpm

#### Environment Preparation

RUN mkdir -p /.local \
&& mkdir -p /.cache \
&& ln -s /.local /root/.local \
&& ln -s /.cache /root/.cache \
&& export LANG="en_US.UTF-8" \
&& pip3 install --upgrade pip \
&& pip3 install pipenv \
&& pipenv install --deploy --ignore-pipfile \
&& mkdir -p /fw && chown 65534:65534 /fw
&& export LANG="en_US.UTF-8"

#### Python Virtual Environment and Dependencies

RUN python3 -m venv /venv \
&& . /venv/bin/activate \
&& pip install --upgrade pip \
&& pip install pipenv

#### Application Dependencies

RUN pipenv install --deploy --ignore-pipfile

#### Final Configuration

RUN mkdir -p /fw && chown 65534:65534 /fw

### Final Stage ###

Expand Down
14 changes: 11 additions & 3 deletions Dockerfile.integration.tests.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,23 @@ ENV VERIFY_SSL False
COPY test/integration/py/src src
COPY test/integration/py/requirements.txt .

#### System Setup

RUN set -x \
&& apk -U upgrade \
&& apk add --no-cache \
bash \
curl \
python3 \
py3-pip \
&& pip3 install --upgrade pip \
&& pip3 install \
py3-pip

#### Python Virtual Environment and Dependencies

RUN python3 -m venv /venv \
&& . /venv/bin/activate \
&& pip install --upgrade pip \
&& pip install pipenv \
&& pip install \
requests \
pytest

Expand Down

0 comments on commit 9b335c0

Please sign in to comment.