Skip to content

Commit

Permalink
Merge pull request #1316 from tobias-urdin/fix-ci-2023-45
Browse files Browse the repository at this point in the history
Fix multiple CI issues
  • Loading branch information
tobias-urdin authored Aug 1, 2023
2 parents eaa83d6 + 8488399 commit b9ab45b
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/gnocchi-ci-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ jobs:
context: ./images
file: ./images/Dockerfile.ci
push: true
tags: ghcr.io/gnocchixyz/ci:latest
tags: ghcr.io/gnocchixyz/ci:4.5
18 changes: 9 additions & 9 deletions .github/workflows/gnocchi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
if: steps.changes.outputs.ci_image == 'false'
- run: docker pull ghcr.io/gnocchixyz/ci:latest
- run: docker pull ghcr.io/gnocchixyz/ci:4.5
if: steps.changes.outputs.ci_image == 'false'
- uses: docker/build-push-action@v2
with:
context: ./images
file: ./images/Dockerfile.ci
push: false
tags: ghcr.io/gnocchixyz/ci:latest
tags: ghcr.io/gnocchixyz/ci:4.5
if: steps.changes.outputs.ci_image == 'true'
- name: Set env vars
run: |
Expand All @@ -57,7 +57,7 @@ jobs:
echo "DOCKER_ENV_OPTS=" >> $GITHUB_ENV
fi
- 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.env }}"
run: docker run --rm -v ${{ github.workspace }}:/github/workspace -w /github/workspace $DOCKER_ENV_OPTS ghcr.io/gnocchixyz/ci:4.5 "tox -e ${{ matrix.env }}"

check:
runs-on: ubuntu-latest
Expand All @@ -83,14 +83,14 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
if: steps.changes.outputs.ci_image == 'false'
- run: docker pull ghcr.io/gnocchixyz/ci:latest
- run: docker pull ghcr.io/gnocchixyz/ci:4.5
if: steps.changes.outputs.ci_image == 'false'
- uses: docker/build-push-action@v2
with:
context: ./images
file: ./images/Dockerfile.ci
push: false
tags: ghcr.io/gnocchixyz/ci:latest
tags: ghcr.io/gnocchixyz/ci:4.5
if: steps.changes.outputs.ci_image == 'true'
- name: Set env vars
run: |
Expand All @@ -100,7 +100,7 @@ jobs:
echo "DOCKER_ENV_OPTS=" >> $GITHUB_ENV
fi
- 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.env }}"
run: docker run --rm -v ${{ github.workspace }}:/github/workspace -w /github/workspace $DOCKER_ENV_OPTS ghcr.io/gnocchixyz/ci:4.5 "tox -e ${{ matrix.env }}"

test:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -151,14 +151,14 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
if: steps.changes.outputs.ci_image == 'false'
- run: docker pull ghcr.io/gnocchixyz/ci:latest
- run: docker pull ghcr.io/gnocchixyz/ci:4.5
if: steps.changes.outputs.ci_image == 'false'
- uses: docker/build-push-action@v2
with:
context: ./images
file: ./images/Dockerfile.ci
push: false
tags: ghcr.io/gnocchixyz/ci:latest
tags: ghcr.io/gnocchixyz/ci:4.5
if: steps.changes.outputs.ci_image == 'true'
- name: Set env vars
run: |
Expand All @@ -168,4 +168,4 @@ jobs:
echo "DOCKER_ENV_OPTS=" >> $GITHUB_ENV
fi
- 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 }}"
run: docker run --rm -v ${{ github.workspace }}:/github/workspace -w /github/workspace $DOCKER_ENV_OPTS ghcr.io/gnocchixyz/ci:4.5 "tox -e ${{ matrix.python }}-${{ matrix.env }}"
15 changes: 13 additions & 2 deletions images/Dockerfile.ci
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,19 @@ RUN apt-get update -y && apt-get install -qy \
libsnappy-dev \
libprotobuf-dev \
# For redis
redis-server \
&& rm -rf /var/lib/apt/lists/*
redis-server

# TODO(tobias-urdin): Downgrade MySQL to a version that works. Report this
# bug to Ubuntu packaging.
ENV MYSQL_VERSION=8.0.19-0ubuntu5
RUN apt-get install -qy --allow-downgrades mysql-client=$MYSQL_VERSION \
mysql-client-8.0=$MYSQL_VERSION \
mysql-server=$MYSQL_VERSION \
mysql-server-8.0=$MYSQL_VERSION \
mysql-client-core-8.0=$MYSQL_VERSION \
mysql-server-core-8.0=$MYSQL_VERSION

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

#NOTE(sileht): really no utf-8 in 2017 !?
ENV LANG en_US.UTF-8
Expand Down
4 changes: 3 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ install_requires =
Paste
PasteDeploy
daiquiri
pyparsing>=2.2.0
# TODO(tobias-urdin): Evaluate unpin later
# https://github.com/pyparsing/pyparsing/issues/504
pyparsing>=2.2.0,<3.1.0
lz4>=0.9.0
tooz>=1.38
cachetools
Expand Down
12 changes: 10 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,12 @@ def run(self):
# replaced by the correct interpreter. We do the same here.
bs_cmd = self.get_finalized_command('build_scripts')
executable = getattr(bs_cmd, 'executable', easy_install.sys_executable)
script = easy_install.get_script_header("", executable) + SCRIPT_TMPL
try:
script = easy_install.get_script_header(
"", executable) + SCRIPT_TMPL
except AttributeError:
script = easy_install.ScriptWriter.get_header(
"", executable) + SCRIPT_TMPL
if PY3:
script = script.encode('ascii')
self.write_script("gnocchi-api", script, 'b')
Expand All @@ -74,7 +79,10 @@ def install_wrapper_scripts(self, dist):
develop.develop.install_wrapper_scripts(self, dist)
if self.exclude_scripts:
return
script = easy_install.get_script_header("") + SCRIPT_TMPL
try:
script = easy_install.get_script_header("") + SCRIPT_TMPL
except AttributeError:
script = easy_install.ScriptWriter.get_header("") + SCRIPT_TMPL
if PY3:
script = script.encode('ascii')
self.write_script("gnocchi-api", script, 'b')
Expand Down
2 changes: 0 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ setenv =
# coordination driver in functional tests (--coordination-driver is passed to
# pifpaf)
deps =
-e
.[test,redis,prometheus,amqp1,{env:GNOCCHI_STORAGE_DEPS:},{env:GNOCCHI_INDEXER_DEPS:}]
{env:GNOCCHI_TEST_TARBALLS:}
# TODO(tobias-urdin): Remove this pin and use pifpaf directly instead when this is
Expand Down Expand Up @@ -127,7 +126,6 @@ basepython = python3
# .[postgresql,doc]
# setenv = GNOCCHI_STORAGE_DEPS=file
deps =
-e
.[test,file,postgresql,doc]
doc8
setenv = GNOCCHI_TEST_DEBUG=1
Expand Down

0 comments on commit b9ab45b

Please sign in to comment.