Skip to content

Commit 51e49fb

Browse files
authored
Merge pull request #7 from canonical/add-build
Adds the build & release CI
2 parents f592675 + 60bdb11 commit 51e49fb

File tree

3 files changed

+13
-11
lines changed

3 files changed

+13
-11
lines changed

.github/workflows/ci.yaml

+5-5
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@ jobs:
5050
use-labels: false
5151
fail-build: ${{ github.event_name == 'pull_request' }}
5252

53-
# build:
54-
# name: Build charm
55-
# uses: canonical/data-platform-workflows/.github/workflows/[email protected]
56-
# with:
57-
# cache: true
53+
build:
54+
name: Build charm
55+
uses: canonical/data-platform-workflows/.github/workflows/[email protected]
56+
with:
57+
cache: true
5858

5959
# integration-test:
6060
# strategy:

charmcraft.yaml

+1-5
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,10 @@ parts:
1313
/root/.local/bin/poetry export --only main,charm-libs --output requirements.txt
1414
1515
craftctl default
16-
# TODO: uncomment this line once we get charmcraftcache for opensearch-benchmark
17-
# charm-strict-dependencies: true
16+
charm-strict-dependencies: true
1817
charm-requirements: [requirements.txt]
19-
charm-entrypoint: src/charm.py
2018
build-snaps:
2119
- rustup
22-
prime:
23-
- src/workload_parameter_templates
2420
build-packages:
2521
# # Dependencies used to build opensearch-benchmark
2622
# - cmake

src/benchmark/base_charm.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,10 @@ def _unit_ip(self) -> str:
114114

115115
def _on_config_changed(self, event: EventBase) -> None:
116116
"""Config changed event."""
117+
if not self.workload.is_prepared():
118+
# nothing to do: set the status and leave
119+
self._set_status()
120+
return
117121
try:
118122
# First, we check if the status of the service
119123
if not self.database.state.get():
@@ -277,5 +281,7 @@ def supported_workloads(self) -> list[str]:
277281
"""List the supported workloads."""
278282
return [
279283
".".join(name.split(".")[:-2])
280-
for name in os.listdir("src/workload_parameter_templates")
284+
for name in os.listdir(
285+
os.path.join(self.workload.paths.templates, "workload_parameter")
286+
)
281287
]

0 commit comments

Comments
 (0)