Skip to content

Commit

Permalink
Bypass charm going into blocked due to a bug
Browse files Browse the repository at this point in the history
After Octopus, the reporting about image states fails because of a
permission issue in Ceph. This change disables that status reporting
to allow a deployment to be healthy even when some tools cannot query
status.

Also modernize build and func testing: remove python 3.9 and xena from
tests

Related-Bug: #1879749
func-test-pr: openstack-charmers/zaza-openstack-tests#1063
Change-Id: Id86fc043495b89609cf6873ec58aee1e2e388578
  • Loading branch information
ChrisMacNaughton authored and sabaini committed Jun 2, 2023
1 parent dce627f commit f5965a8
Show file tree
Hide file tree
Showing 13 changed files with 76 additions and 474 deletions.
3 changes: 3 additions & 0 deletions bindep.txt
@@ -0,0 +1,3 @@
libffi-dev [platform:dpkg]
libxml2-dev [platform:dpkg]
libxslt1-dev [platform:dpkg]
31 changes: 16 additions & 15 deletions charmcraft.yaml
Expand Up @@ -2,24 +2,25 @@ type: charm

parts:
charm:
source: src/
plugin: reactive
build-snaps:
- charm
build-packages:
- tox
- git
- python3-dev
override-build: |
apt-get install ca-certificates -y
tox -e build-reactive
override-stage: |
echo "Copying charm to staging area: $CHARMCRAFT_STAGE"
NAME=$(ls $CHARMCRAFT_PART_BUILD/build/builds)
cp -r $CHARMCRAFT_PART_BUILD/build/builds/$NAME/* $CHARMCRAFT_STAGE/
override-prime: |
# For some reason, the normal priming chokes on the fact that there's a
# hooks directory.
cp -r $CHARMCRAFT_STAGE/* .
build-environment:
- CHARM_INTERFACES_DIR: /root/project/interfaces/
- CHARM_LAYERS_DIR: /root/project/layers/

bases:
- name: ubuntu
channel: "20.04"
architectures:
- amd64
- build-on:
- name: ubuntu
channel: "22.04"
architectures:
- amd64
run-on:
- name: ubuntu
channel: "22.04"
architectures: [amd64, s390x, ppc64el, arm64]
9 changes: 3 additions & 6 deletions osci.yaml
@@ -1,17 +1,14 @@
- project:
templates:
- charm-unit-jobs-py38
- charm-unit-jobs-py39
- charm-unit-jobs-py310
check:
jobs:
- focal-xena
- focal-yoga:
voting: false
- impish-xena:
voting: false
- focal-yoga
- jammy-yoga:
voting: false
vars:
needs_charm_build: true
charm_build_name: ceph-rbd-mirror
build_type: charmcraft
charmcraft_channel: 2.1/stable
19 changes: 8 additions & 11 deletions requirements.txt
Expand Up @@ -8,16 +8,13 @@
# requirements.txt
setuptools<50.0.0 # https://github.com/pypa/setuptools/commit/04e3df22df840c6bb244e9b27bc56750c44b7c85

# Build requirements
cffi==1.14.6; python_version < '3.6' # cffi 1.15.0 drops support for py35.
charm-tools==2.8.3
# NOTE: newer versions of cryptography require a Rust compiler to build,
# see
# * https://github.com/openstack-charmers/zaza/issues/421
# * https://mail.python.org/pipermail/cryptography-dev/2021-January/001003.html
#
cryptography<3.4

simplejson
git+https://github.com/juju/charm-tools.git

# Newer versions use keywords that didn't exist in python 3.5 yet (e.g.
# "ModuleNotFoundError")
# NOTE(lourot): This might look like a duplication of test-requirements.txt but
# some tox targets use only test-requirements.txt whereas charm-build uses only
# requirements.txt
importlib-metadata<3.0.0; python_version < '3.6'
importlib-resources<3.0.0; python_version < '3.6'
simplejson
8 changes: 6 additions & 2 deletions src/lib/charm/openstack/ceph_rbd_mirror.py
Expand Up @@ -97,8 +97,12 @@ def custom_assess_status_check(self):
if not pool_msg:
pool_msg = 'Pools '
pool_msg += '{} ({}) '.format(health, count)
if health != 'OK':
status = 'blocked'

# Disabling blocked state until
# https://bugs.launchpad.net/charm-ceph-rbd-mirror/+bug/1879749
# is resolved
# if health != 'OK':
# status = 'blocked'
for state, count in stats['image_states'].items():
if not image_msg:
image_msg = 'Images '
Expand Down
2 changes: 1 addition & 1 deletion src/metadata.yaml
Expand Up @@ -16,7 +16,7 @@ tags:
- misc
series:
- focal
- impish
- jammy
extra-bindings:
public:
cluster:
Expand Down
187 changes: 0 additions & 187 deletions src/tests/bundles/focal-xena.yaml

This file was deleted.

4 changes: 2 additions & 2 deletions src/tests/bundles/focal-yoga.yaml
Expand Up @@ -152,9 +152,9 @@ relations:
- - rabbitmq-server
- cinder

- - keystone
- - 'keystone:identity-service'
- cinder
- - keystone
- - 'keystone:identity-service'
- glance

- - cinder
Expand Down

0 comments on commit f5965a8

Please sign in to comment.