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

Remove CI image build hacks #1429

Merged
merged 1 commit into from
Nov 3, 2024
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
12 changes: 9 additions & 3 deletions .github/workflows/gnocchi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -167,12 +167,18 @@ jobs:
push: false
tags: ghcr.io/gnocchixyz/ci:latest
if: steps.changes.outputs.ci_image == 'true'
# NOTE(callumdickinson): SETUPTOOLS_USE_DISTUTILS needs to be set to 'stdlib'
# for Debian-packaged setuptools to work correctly on Python 3.9 and 3.11.
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1003252
- name: Set env vars
run: |
export DOCKER_ENV_OPTS=
if [ "${{ github.event.inputs.debug }}" == "true" ]; then
echo "DOCKER_ENV_OPTS=-e GNOCCHI_TEST_DEBUG=1" >> $GITHUB_ENV
else
echo "DOCKER_ENV_OPTS=" >> $GITHUB_ENV
export DOCKER_ENV_OPTS="$DOCKER_ENV_OPTS -e GNOCCHI_TEST_DEBUG=1"
fi
if [ "${{ matrix.python }}" = "py39" -o "${{ matrix.python }}" = "py311" ]; then
export DOCKER_ENV_OPTS="$DOCKER_ENV_OPTS -e SETUPTOOLS_USE_DISTUTILS=stdlib"
fi
echo "DOCKER_ENV_OPTS=$DOCKER_ENV_OPTS" >> $GITHUB_ENV
- name: Run tests with tox in container
run: docker run --rm -v ${{ github.workspace }}:/github/workspace -w /github/workspace $DOCKER_ENV_OPTS ghcr.io/gnocchixyz/ci:latest "tox -e ${{ matrix.python }}-${{ matrix.env }}"
13 changes: 4 additions & 9 deletions images/Dockerfile.ci
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,16 @@ RUN apt-get update -y && apt-get install -qy \
python3 \
python3-dev \
python3-pip \
python3-setuptools \
python3-wheel \
python3-virtualenv \
python3.9 \
python3.9-dev \
python3.9-distutils \
python3.11 \
python3.11-dev \
python3.11-distutils \
tox \
# Needed for uwsgi core routing support
build-essential \
libffi-dev \
Expand All @@ -42,15 +46,6 @@ RUN apt-get update -y && apt-get install -qy \

RUN rm -rf /var/lib/apt/lists/*

# NOTE(tobias.urdin): hack since pyparsing in site-packages collides with our requirements
RUN rm -rf /usr/lib/python3/dist-packages/pyparsing*

# NOTE(tobias.urdin): hack since jaraco packages in site-packages collides with our requirements
RUN rm -rf /usr/lib/python3/dist-packages/jaraco*

# TODO(tobias.urdin): hack remove this when we drop python 3.9
RUN sed -i '1s/^/from __future__ import annotations\n/' /usr/lib/python3/dist-packages/werkzeug/sansio/utils.py

#NOTE(sileht): really no utf-8 in 2017 !?
ENV LANG en_US.UTF-8
RUN update-locale
Expand Down
4 changes: 0 additions & 4 deletions images/entrypoint.sh.ci
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
#!/bin/sh

python3 -m virtualenv /tmp/gnocchi-tox-env
. /tmp/gnocchi-tox-env/bin/activate
pip install tox

$@
10 changes: 5 additions & 5 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ passenv =
GNOCCHI_TEST_*
AWS_*
setenv =
VIRTUALENV_SETUPTOOLS=bundle
SETUPTOOLS_USE_DISTUTILS={env:SETUPTOOLS_USE_DISTUTILS:local}
GNOCCHI_TEST_STORAGE_DRIVER=file
GNOCCHI_TEST_INDEXER_DRIVER=postgresql
GNOCCHI_TEST_STORAGE_DRIVERS=file swift ceph s3 redis
Expand Down Expand Up @@ -69,7 +69,7 @@ deps =
# Gnocchi we can't reuse the virtualenv
recreate = True
setenv =
VIRTUALENV_SETUPTOOLS=bundle
SETUPTOOLS_USE_DISTUTILS={env:SETUPTOOLS_USE_DISTUTILS:local}
GNOCCHI_VERSION_FROM=stable/4.5
GNOCCHI_VARIANT=test,postgresql,file
deps =
Expand All @@ -84,7 +84,7 @@ allowlist_externals = {toxinidir}/run-upgrade-tests.sh
# Gnocchi we can't reuse the virtualenv
recreate = True
setenv =
VIRTUALENV_SETUPTOOLS=bundle
SETUPTOOLS_USE_DISTUTILS={env:SETUPTOOLS_USE_DISTUTILS:local}
GNOCCHI_VERSION_FROM=stable/4.5
GNOCCHI_VARIANT=test,mysql,ceph,ceph_recommended_lib
deps =
Expand Down Expand Up @@ -134,7 +134,7 @@ deps =
.[test,file,postgresql,doc]
doc8
setenv =
VIRTUALENV_SETUPTOOLS=bundle
SETUPTOOLS_USE_DISTUTILS={env:SETUPTOOLS_USE_DISTUTILS:local}
GNOCCHI_TEST_DEBUG=1
commands =
doc8 --ignore-path doc/source/rest.rst,doc/source/comparison-table.rst doc/source
Expand All @@ -145,7 +145,7 @@ allowlist_externals =
/bin/bash
/bin/rm
setenv =
VIRTUALENV_SETUPTOOLS=bundle
SETUPTOOLS_USE_DISTUTILS={env:SETUPTOOLS_USE_DISTUTILS:local}
GNOCCHI_STORAGE_DEPS=file
GNOCCHI_TEST_DEBUG=1
deps =
Expand Down
Loading