Migrate to charmhub
Change-Id: I2caffbca2b6a1a6661831c6771fe4b7d45deddd3
This commit is contained in:
parent
0434825ea9
commit
dc2171c0b2
@ -1 +1,7 @@
|
|||||||
git+https://github.com/canonical/charmcraft.git@0.10.2#egg=charmcraft
|
# NOTES(lourot):
|
||||||
|
# * We don't install charmcraft via pip anymore because it anyway spins up a
|
||||||
|
# container and scp the system's charmcraft snap inside it. So the charmcraft
|
||||||
|
# snap is necessary on the system anyway.
|
||||||
|
# * `tox -e build` successfully validated with charmcraft 1.2.1
|
||||||
|
|
||||||
|
cffi==1.14.6; python_version < '3.6' # cffi 1.15.0 drops support for py35.
|
||||||
|
27
charmcraft.yaml
Normal file
27
charmcraft.yaml
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
type: charm
|
||||||
|
|
||||||
|
parts:
|
||||||
|
charm:
|
||||||
|
after:
|
||||||
|
- update-certificates
|
||||||
|
charm-python-packages:
|
||||||
|
# NOTE(lourot): see
|
||||||
|
# * https://github.com/canonical/charmcraft/issues/551
|
||||||
|
# * https://github.com/canonical/charmcraft/issues/632
|
||||||
|
- setuptools < 58
|
||||||
|
build-packages:
|
||||||
|
- git
|
||||||
|
|
||||||
|
update-certificates:
|
||||||
|
plugin: nil
|
||||||
|
# See https://github.com/canonical/charmcraft/issues/658
|
||||||
|
override-build: |
|
||||||
|
apt update
|
||||||
|
apt install -y ca-certificates
|
||||||
|
update-ca-certificates
|
||||||
|
|
||||||
|
bases:
|
||||||
|
- name: ubuntu
|
||||||
|
channel: "20.04"
|
||||||
|
architectures:
|
||||||
|
- amd64
|
@ -1,6 +1,7 @@
|
|||||||
- project:
|
- project:
|
||||||
templates:
|
templates:
|
||||||
- charm-unit-jobs
|
- charm-unit-jobs-py38
|
||||||
|
- charm-unit-jobs-py39
|
||||||
check:
|
check:
|
||||||
jobs:
|
jobs:
|
||||||
- ceph-iscsi-focal-octopus
|
- ceph-iscsi-focal-octopus
|
||||||
@ -13,11 +14,10 @@
|
|||||||
name: ceph-iscsi-focal-octopus
|
name: ceph-iscsi-focal-octopus
|
||||||
parent: func-target
|
parent: func-target
|
||||||
dependencies:
|
dependencies:
|
||||||
|
- charm-build
|
||||||
- osci-lint
|
- osci-lint
|
||||||
- tox-py35
|
|
||||||
- tox-py36
|
|
||||||
- tox-py37
|
|
||||||
- tox-py38
|
- tox-py38
|
||||||
|
- tox-py39
|
||||||
vars:
|
vars:
|
||||||
tox_extra_args: focal
|
tox_extra_args: focal
|
||||||
- job:
|
- job:
|
||||||
|
13
rename.sh
Executable file
13
rename.sh
Executable file
@ -0,0 +1,13 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
charm=$(grep "charm_build_name" osci.yaml | awk '{print $2}')
|
||||||
|
echo "renaming ${charm}_*.charm to ${charm}.charm"
|
||||||
|
echo -n "pwd: "
|
||||||
|
pwd
|
||||||
|
ls -al
|
||||||
|
echo "Removing bad downloaded charm maybe?"
|
||||||
|
if [[ -e "${charm}.charm" ]];
|
||||||
|
then
|
||||||
|
rm "${charm}.charm"
|
||||||
|
fi
|
||||||
|
echo "Renaming charm here."
|
||||||
|
mv ${charm}_*.charm ${charm}.charm
|
19
tests/README.md
Normal file
19
tests/README.md
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
# Overview
|
||||||
|
|
||||||
|
This directory provides Zaza test definitions and bundles to verify basic
|
||||||
|
deployment functionality from the perspective of this charm, its requirements
|
||||||
|
and its features, as exercised in a subset of the full OpenStack deployment
|
||||||
|
test bundle topology.
|
||||||
|
|
||||||
|
Run the smoke tests with:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd ../
|
||||||
|
tox -e build
|
||||||
|
cd tests/
|
||||||
|
tox -e func-smoke
|
||||||
|
```
|
||||||
|
|
||||||
|
For full details on functional testing of OpenStack charms please refer to
|
||||||
|
the [functional testing](https://docs.openstack.org/charm-guide/latest/reference/testing.html#functional-testing)
|
||||||
|
section of the OpenStack Charm Guide.
|
@ -36,11 +36,13 @@ applications:
|
|||||||
pool-type: erasure-coded
|
pool-type: erasure-coded
|
||||||
ec-profile-k: 4
|
ec-profile-k: 4
|
||||||
ec-profile-m: 2
|
ec-profile-m: 2
|
||||||
|
# Use proposed until fix for #1883112 is backported
|
||||||
|
source: distro-proposed
|
||||||
to:
|
to:
|
||||||
- '0'
|
- '0'
|
||||||
- '1'
|
- '1'
|
||||||
ceph-osd:
|
ceph-osd:
|
||||||
charm: cs:~openstack-charmers-next/ceph-osd
|
charm: ch:ceph-osd
|
||||||
num_units: 6
|
num_units: 6
|
||||||
storage:
|
storage:
|
||||||
osd-devices: 'cinder,10G'
|
osd-devices: 'cinder,10G'
|
||||||
@ -53,8 +55,9 @@ applications:
|
|||||||
- '11'
|
- '11'
|
||||||
- '12'
|
- '12'
|
||||||
- '13'
|
- '13'
|
||||||
|
channel: latest/edge
|
||||||
ceph-mon:
|
ceph-mon:
|
||||||
charm: cs:~openstack-charmers-next/ceph-mon
|
charm: ch:ceph-mon
|
||||||
num_units: 3
|
num_units: 3
|
||||||
options:
|
options:
|
||||||
monitor-count: '3'
|
monitor-count: '3'
|
||||||
@ -62,20 +65,24 @@ applications:
|
|||||||
- '3'
|
- '3'
|
||||||
- '4'
|
- '4'
|
||||||
- '5'
|
- '5'
|
||||||
|
channel: latest/edge
|
||||||
vault:
|
vault:
|
||||||
num_units: 1
|
num_units: 1
|
||||||
charm: cs:~openstack-charmers-next/vault
|
charm: ch:vault
|
||||||
to:
|
to:
|
||||||
- '6'
|
- '6'
|
||||||
|
channel: latest/edge
|
||||||
mysql-innodb-cluster:
|
mysql-innodb-cluster:
|
||||||
charm: cs:~openstack-charmers-next/mysql-innodb-cluster
|
charm: ch:mysql-innodb-cluster
|
||||||
num_units: 3
|
num_units: 3
|
||||||
to:
|
to:
|
||||||
- '8'
|
- '8'
|
||||||
- '9'
|
- '9'
|
||||||
- '10'
|
- '10'
|
||||||
|
channel: latest/edge
|
||||||
vault-mysql-router:
|
vault-mysql-router:
|
||||||
charm: cs:~openstack-charmers-next/mysql-router
|
charm: ch:mysql-router
|
||||||
|
channel: latest/edge
|
||||||
relations:
|
relations:
|
||||||
- - 'ceph-mon:client'
|
- - 'ceph-mon:client'
|
||||||
- 'ceph-iscsi:ceph-client'
|
- 'ceph-iscsi:ceph-client'
|
||||||
|
@ -35,13 +35,15 @@ applications:
|
|||||||
num_units: 4
|
num_units: 4
|
||||||
options:
|
options:
|
||||||
gateway-metadata-pool: iscsi-foo-metadata
|
gateway-metadata-pool: iscsi-foo-metadata
|
||||||
|
# Use proposed until fix for #1883112 is backported
|
||||||
|
source: distro-proposed
|
||||||
to:
|
to:
|
||||||
- '0'
|
- '0'
|
||||||
- '1'
|
- '1'
|
||||||
- '16'
|
- '16'
|
||||||
- '17'
|
- '17'
|
||||||
ceph-osd:
|
ceph-osd:
|
||||||
charm: cs:~openstack-charmers-next/ceph-osd
|
charm: ch:ceph-osd
|
||||||
num_units: 6
|
num_units: 6
|
||||||
storage:
|
storage:
|
||||||
osd-devices: 'cinder,10G'
|
osd-devices: 'cinder,10G'
|
||||||
@ -54,8 +56,9 @@ applications:
|
|||||||
- '11'
|
- '11'
|
||||||
- '12'
|
- '12'
|
||||||
- '13'
|
- '13'
|
||||||
|
channel: latest/edge
|
||||||
ceph-mon:
|
ceph-mon:
|
||||||
charm: cs:~openstack-charmers-next/ceph-mon
|
charm: ch:ceph-mon
|
||||||
num_units: 3
|
num_units: 3
|
||||||
options:
|
options:
|
||||||
monitor-count: '3'
|
monitor-count: '3'
|
||||||
@ -63,20 +66,24 @@ applications:
|
|||||||
- '3'
|
- '3'
|
||||||
- '4'
|
- '4'
|
||||||
- '5'
|
- '5'
|
||||||
|
channel: latest/edge
|
||||||
vault:
|
vault:
|
||||||
num_units: 1
|
num_units: 1
|
||||||
charm: cs:~openstack-charmers-next/vault
|
charm: ch:vault
|
||||||
to:
|
to:
|
||||||
- '6'
|
- '6'
|
||||||
|
channel: latest/edge
|
||||||
mysql-innodb-cluster:
|
mysql-innodb-cluster:
|
||||||
charm: cs:~openstack-charmers-next/mysql-innodb-cluster
|
charm: ch:mysql-innodb-cluster
|
||||||
num_units: 3
|
num_units: 3
|
||||||
to:
|
to:
|
||||||
- '8'
|
- '8'
|
||||||
- '9'
|
- '9'
|
||||||
- '10'
|
- '10'
|
||||||
|
channel: latest/edge
|
||||||
vault-mysql-router:
|
vault-mysql-router:
|
||||||
charm: cs:~openstack-charmers-next/mysql-router
|
charm: ch:mysql-router
|
||||||
|
channel: latest/edge
|
||||||
relations:
|
relations:
|
||||||
- - 'ceph-mon:client'
|
- - 'ceph-mon:client'
|
||||||
- 'ceph-iscsi:ceph-client'
|
- 'ceph-iscsi:ceph-client'
|
||||||
|
@ -1,3 +0,0 @@
|
|||||||
applications:
|
|
||||||
ceph-iscsi:
|
|
||||||
charm: ../../ceph-iscsi.charm
|
|
@ -13,7 +13,7 @@ tests:
|
|||||||
target_deploy_status:
|
target_deploy_status:
|
||||||
ubuntu:
|
ubuntu:
|
||||||
workload-status: active
|
workload-status: active
|
||||||
workload-status-message: ''
|
workload-status-message-prefix: ''
|
||||||
vault:
|
vault:
|
||||||
workload-status: blocked
|
workload-status: blocked
|
||||||
workload-status-message: Vault needs to be initialized
|
workload-status-message-prefix: Vault needs to be initialized
|
||||||
|
17
tox.ini
17
tox.ini
@ -15,8 +15,12 @@ skip_missing_interpreters = False
|
|||||||
# * It is also necessary to pin virtualenv as a newer virtualenv would still
|
# * It is also necessary to pin virtualenv as a newer virtualenv would still
|
||||||
# lead to fetching the latest pip in the func* tox targets, see
|
# lead to fetching the latest pip in the func* tox targets, see
|
||||||
# https://stackoverflow.com/a/38133283
|
# https://stackoverflow.com/a/38133283
|
||||||
|
# * It is necessary to declare setuptools as a dependency otherwise tox will
|
||||||
|
# fail very early at not being able to load it. The version pinning is in
|
||||||
|
# line with `pip.sh`.
|
||||||
requires = pip < 20.3
|
requires = pip < 20.3
|
||||||
virtualenv < 20.0
|
virtualenv < 20.0
|
||||||
|
setuptools < 50.0.0
|
||||||
# NOTE: https://wiki.canonical.com/engineering/OpenStack/InstallLatestToxOnOsci
|
# NOTE: https://wiki.canonical.com/engineering/OpenStack/InstallLatestToxOnOsci
|
||||||
minversion = 3.2.0
|
minversion = 3.2.0
|
||||||
|
|
||||||
@ -27,10 +31,12 @@ setenv = VIRTUAL_ENV={envdir}
|
|||||||
install_command =
|
install_command =
|
||||||
pip install {opts} {packages}
|
pip install {opts} {packages}
|
||||||
commands = stestr run --slowest {posargs}
|
commands = stestr run --slowest {posargs}
|
||||||
whitelist_externals =
|
allowlist_externals =
|
||||||
git
|
git
|
||||||
add-to-archive.py
|
add-to-archive.py
|
||||||
bash
|
bash
|
||||||
|
charmcraft
|
||||||
|
rename.sh
|
||||||
passenv = HOME TERM CS_* OS_* TEST_*
|
passenv = HOME TERM CS_* OS_* TEST_*
|
||||||
deps = -r{toxinidir}/test-requirements.txt
|
deps = -r{toxinidir}/test-requirements.txt
|
||||||
|
|
||||||
@ -54,6 +60,11 @@ basepython = python3.8
|
|||||||
deps = -r{toxinidir}/requirements.txt
|
deps = -r{toxinidir}/requirements.txt
|
||||||
-r{toxinidir}/test-requirements.txt
|
-r{toxinidir}/test-requirements.txt
|
||||||
|
|
||||||
|
[testenv:py39]
|
||||||
|
basepython = python3.9
|
||||||
|
deps = -r{toxinidir}/requirements.txt
|
||||||
|
-r{toxinidir}/test-requirements.txt
|
||||||
|
|
||||||
[testenv:py3]
|
[testenv:py3]
|
||||||
basepython = python3
|
basepython = python3
|
||||||
deps = -r{toxinidir}/requirements.txt
|
deps = -r{toxinidir}/requirements.txt
|
||||||
@ -101,7 +112,9 @@ commands = {posargs}
|
|||||||
basepython = python3
|
basepython = python3
|
||||||
deps = -r{toxinidir}/build-requirements.txt
|
deps = -r{toxinidir}/build-requirements.txt
|
||||||
commands =
|
commands =
|
||||||
charmcraft build
|
charmcraft clean
|
||||||
|
charmcraft -v build
|
||||||
|
{toxinidir}/rename.sh
|
||||||
|
|
||||||
[testenv:func-noop]
|
[testenv:func-noop]
|
||||||
basepython = python3
|
basepython = python3
|
||||||
|
@ -195,14 +195,6 @@ class TestCephISCSIGatewayCharmBase(CharmTestCase):
|
|||||||
self.harness.add_relation_unit(
|
self.harness.add_relation_unit(
|
||||||
rel_id,
|
rel_id,
|
||||||
'ceph-iscsi/1')
|
'ceph-iscsi/1')
|
||||||
self.harness.update_relation_data(
|
|
||||||
rel_id,
|
|
||||||
'ceph-iscsi/1',
|
|
||||||
{
|
|
||||||
'ingress-address': '10.0.0.2',
|
|
||||||
'gateway_ready': 'True',
|
|
||||||
'gateway_fqdn': 'ceph-iscsi-1.example'
|
|
||||||
})
|
|
||||||
return rel_id
|
return rel_id
|
||||||
|
|
||||||
def complete_cluster_relation(self, rel_id):
|
def complete_cluster_relation(self, rel_id):
|
||||||
@ -231,7 +223,8 @@ class TestCephISCSIGatewayCharmBase(CharmTestCase):
|
|||||||
@patch('socket.getfqdn')
|
@patch('socket.getfqdn')
|
||||||
def test_on_create_target_action(self, _getfqdn):
|
def test_on_create_target_action(self, _getfqdn):
|
||||||
_getfqdn.return_value = 'ceph-iscsi-0.example'
|
_getfqdn.return_value = 'ceph-iscsi-0.example'
|
||||||
self.add_base_cluster_relation()
|
cluster_rel_id = self.add_base_cluster_relation()
|
||||||
|
self.complete_cluster_relation(cluster_rel_id)
|
||||||
self.harness.begin()
|
self.harness.begin()
|
||||||
action_event = MagicMock()
|
action_event = MagicMock()
|
||||||
action_event.params = {
|
action_event.params = {
|
||||||
@ -276,7 +269,8 @@ class TestCephISCSIGatewayCharmBase(CharmTestCase):
|
|||||||
@patch('socket.getfqdn')
|
@patch('socket.getfqdn')
|
||||||
def test_on_create_target_action_ec(self, _getfqdn):
|
def test_on_create_target_action_ec(self, _getfqdn):
|
||||||
_getfqdn.return_value = 'ceph-iscsi-0.example'
|
_getfqdn.return_value = 'ceph-iscsi-0.example'
|
||||||
self.add_base_cluster_relation()
|
cluster_rel_id = self.add_base_cluster_relation()
|
||||||
|
self.complete_cluster_relation(cluster_rel_id)
|
||||||
self.harness.begin()
|
self.harness.begin()
|
||||||
action_event = MagicMock()
|
action_event = MagicMock()
|
||||||
action_event.params = {
|
action_event.params = {
|
||||||
|
Loading…
Reference in New Issue
Block a user