Skip to content

Commit cced864

Browse files
Move individual charms to building from local libraries
1 parent a8af988 commit cced864

File tree

6 files changed

+15
-16
lines changed

6 files changed

+15
-16
lines changed

.github/workflows/build-and-test.yml

+1
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ jobs:
9696
id: builder
9797
run: |
9898
sudo snap install charmcraft --classic
99+
# expects the local libraries to be already available in $charm/lib as it was done for unit tests.
99100
tox -c ${{ matrix.part }} -e build
100101
101102
- name: Upload built charm

ceph-dashboard/requirements.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
importlib-resources
22
ops >= 1.2.0, <= 1.5.2
33
tenacity
4-
git+https://github.com/openstack/charms.ceph#egg=charms_ceph
4+
./lib/charms.ceph
5+
git+https://github.com/canonical/cos-lib # for ceph_metrics
56
git+https://opendev.org/openstack/charm-ops-openstack#egg=ops_openstack
67
git+https://opendev.org/openstack/charm-ops-interface-tls-certificates#egg=interface_tls_certificates
78
git+https://github.com/openstack-charmers/ops-interface-ceph-iscsi-admin-access#egg=interface_ceph_iscsi_admin_access

ceph-mon/charmcraft.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ parts:
99
- setuptools
1010
build-packages:
1111
- git
12+
- cargo
13+
- rustc
1214

1315
update-certificates:
1416
# Ensure that certificates in the base image are up-to-date.

ceph-mon/requirements.txt

+3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,12 @@ dnspython
66
netaddr
77
netifaces
88
pyyaml
9+
cosl==0.0.55
10+
911
# the build process expects charms.ceph and charms.ceph_metrics be at lib/ inside the charm directory.
1012
./lib/charms.ceph_metrics
1113
./lib/charms.ceph
14+
1215
git+https://opendev.org/openstack/charm-ops-openstack#egg=ops_openstack
1316
git+https://opendev.org/openstack/charm-ops-interface-tls-certificates#egg=interface_tls_certificates
1417
git+https://github.com/openstack-charmers/ops-interface-ceph-iscsi-admin-access#egg=interface_ceph_iscsi_admin_access

charm_utils.sh

+5-13
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,14 @@
11
#!/bin/bash
22

3-
function build() {
4-
local charm="${1?missing}"
5-
6-
# remove old and copy fresh dependencies into lib dir.
7-
rm -rf $charm/lib/charms.ceph*
8-
cp -r ./charms.ceph* $charm/lib/
9-
10-
cd $charm
11-
tox -e build
12-
}
13-
143
function copy_libs() {
154
local charm="${1?missing}"
165

17-
# remove old and copy fresh dependencies into lib dir.
18-
rm -rf $charm/lib/charms.ceph*
6+
# remove old copy of local libraries may fail if lib folder does not exist.
7+
rm -rf $charm/lib/charms.ceph* || true
8+
# create a lib folder in case it does not exist
9+
mkdir -p $charm/lib
1910
cp -r ./charms.ceph* $charm/lib/
11+
2012
}
2113

2214
function clean() {

charms.ceph_metrics/requirements.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Requirements for ceph_metrics dependencies
22
ops >= 1.2.0
33
tenacity
4+
cosl==0.0.55
5+
46
# the build process expects charms.ceph and charms.ceph_metrics be at lib/ inside the charm directory.
57
../charms.ceph # charms.ceph from local repository
6-
7-
git+https://github.com/canonical/cos-lib

0 commit comments

Comments
 (0)