Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CASMCMS-8713: Temporarily modify PyYAML, kubernetes install procedure #263

Merged
merged 1 commit into from
Jul 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Dependencies
- Bump `google-auth` from 2.21.0 to 2.22.0 (#258)
- Bump `jsonschema` from 4.18.0 to 4.18.2 (#259)
- Temporarily modify [`Dockerfile`](Dockerfile) procedure used to install `PyYAML` and `kubernetes`, to work around https://github.com/yaml/pyyaml/issues/601 (#263)

## [1.8.11] - 2023-07-10

Expand Down
37 changes: 34 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,37 @@ ARG PYMOD_VERSION=0.0.0

WORKDIR /src/
COPY cray_product_catalog/ ./cray_product_catalog
COPY setup.py requirements.txt constraints.txt README.md ./

# The addition of the requirements-pyyaml.txt and requirements-non-pyyaml.txt files is to work around
# a problem installing the PyYAML Python module. A change was also made to the pip3 install commands to
# use these files. This work around essentially forces the install of the PyYAML module to use a
# version of Cython that is < 3.0 (this restriction was added to constraints.txt along with the changes
# here in the Dockerfile).
#
# These workarounds are necessary until one of the following things happens:
# * PyYAML publishes an update which constrains its build environment to using Cython < 3.0, so that
# we don't have to manually impose that constraint.
# * A combination of Cython and PyYAML versions are released that allow PyYAML to build under Alpine using
# Cython >= 3.0, so that we don't need to manually constrain the Cython version.
# * A PyYAML wheel is available for Alpine, so that the build environment is a non-issue.
#
# Currently there is a PyYAML PR up which would do the first item on that list: https://github.com/yaml/pyyaml/pull/702
# If that PR merges and is added to a PyYAML release, then the following steps should be done to undo the workaround:
#
# * Update constraints.txt with the PyYAML version that contains the workaround
# * Delete requirements-pyyaml.txt requirements-non-pyyaml.txt from the repository
# * Remove requirements-pyyaml.txt requirements-non-pyyaml.txt from the COPY line in this Dockerfile
# * Remove the Cython constraint from constraints.txt
# * Modify the following Dockerfile lines from:
#
# && pip3 install --ignore-installed --no-cache-dir -r requirements-pyyaml.txt --no-build-isolation \
# && pip3 install --ignore-installed --no-cache-dir -r requirements-non-pyyaml.txt \
#
# to:
#
# && pip3 install --ignore-installed --no-cache-dir -r requirements.txt \
#
COPY setup.py requirements.txt constraints.txt requirements-pyyaml.txt requirements-non-pyyaml.txt README.md ./
dlaine-hpe marked this conversation as resolved.
Show resolved Hide resolved
RUN echo ${PYMOD_VERSION} > .version

RUN apk add --upgrade --no-cache apk-tools \
Expand All @@ -37,8 +67,9 @@ RUN apk add --upgrade --no-cache apk-tools \
python3-dev \
libc-dev \
&& apk -U upgrade --no-cache \
&& pip3 install --upgrade pip \
&& pip3 install --ignore-installed --no-cache-dir -r requirements.txt \
&& pip3 install --upgrade pip wheel \
&& pip3 install --ignore-installed --no-cache-dir -r requirements-pyyaml.txt --no-build-isolation \
&& pip3 install --ignore-installed --no-cache-dir -r requirements-non-pyyaml.txt \
&& python3 setup.py install \
&& rm -rf /src/

Expand Down
1 change: 1 addition & 0 deletions constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ attrs==23.1.0
cachetools==5.3.1
certifi==2023.5.7
charset-normalizer==3.2.0
Cython<3.0
google-auth==2.22.0
idna==3.4
jsonschema==4.18.2
Expand Down
4 changes: 4 additions & 0 deletions requirements-non-pyyaml.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-c constraints.txt

jsonschema
urllib3
5 changes: 5 additions & 0 deletions requirements-pyyaml.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-c constraints.txt

Cython
PyYAML
kubernetes