Skip to content
This repository has been archived by the owner on Aug 9, 2024. It is now read-only.

Commit

Permalink
chore: fix CI pipeline
Browse files Browse the repository at this point in the history
A fix was applied because there was a bug on the way we deferred `_on_slurmctld_available`.
  • Loading branch information
jedel1043 authored and NucciTheBoss committed Jul 17, 2024
1 parent 777ea8d commit cafb2cd
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 8 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
strategy:
fail-fast: true
matrix:
bases:
bases:
- ubuntu@22.04
name: Integration tests (LXD) | ${{ matrix.bases }}
runs-on: ubuntu-latest
Expand All @@ -78,10 +78,17 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: main
- name: Fetch slurmctld
uses: actions/checkout@v4
with:
repository: charmed-hpc/slurmctld-operator
path: slurmctld-operator
- name: Setup operator environment
uses: charmed-kubernetes/actions-operator@main
with:
provider: lxd
juju-channel: 3.1/stable
juju-channel: 3.4/stable
- name: Run tests
run: tox run -e integration -- --charm-base=${{ matrix.bases }}
run: cd main && tox run -e integration -- --charm-base=${{ matrix.bases }} --use-local
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ jobs:
- name: Checkout
uses: actions/checkout@v3
- name: Select charmhub channel
uses: canonical/charming-actions/channel@2.2.0
uses: canonical/charming-actions/channel@2.5.0-rc
id: channel
- name: Upload charm to charmhub
uses: canonical/charming-actions/upload-charm@2.2.0
uses: canonical/charming-actions/upload-charm@2.5.0-rc
with:
credentials: "${{ secrets.CHARMCRAFT_AUTH }}"
github-token: "${{ secrets.GITHUB_TOKEN }}"
Expand Down
7 changes: 6 additions & 1 deletion src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,12 @@ def _on_slurmctld_available(self, event: SlurmctldAvailableEvent) -> None:
self._slurmdbd_ops_manager.write_munge_key(munge_key)
self._slurmdbd_ops_manager.start_munge()

self._write_config_and_restart_slurmdbd(event)
# Don't try to write the config before the database has been created.
# Otherwise, this will trigger a defer on this event, which we don't really need
# or the munge service will restart too many times, triggering a restart limit on
# systemctl.
if self._stored.db_info:
self._write_config_and_restart_slurmdbd(event)

def _on_database_created(self, event: DatabaseCreatedEvent) -> None:
"""Process the DatabaseCreatedEvent and updates the database parameters.
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/test_charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ async def test_build_and_deploy_against_edge(
),
)
# Set relations for charmed applications.
await ops_test.model.integrate(f"{SLURMDBD}:{SLURMDBD}", f"{SLURMCTLD}:{SLURMDBD}")
await ops_test.model.integrate(f"{SLURMDBD}:{SLURMCTLD}", f"{SLURMCTLD}:{SLURMDBD}")
await ops_test.model.integrate(f"{ROUTER}:backend-database", f"{DATABASE}:database")
await ops_test.model.integrate(f"{SLURMDBD}:database", f"{ROUTER}:database")
# Reduce the update status frequency to accelerate the triggering of deferred events.
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ env_list = lint, type, unit
[vars]
src_path = {toxinidir}/src
tst_path = {toxinidir}/tests
all_path = {[vars]src_path} {[vars]tst_path}
all_path = {[vars]src_path} {[vars]tst_path}

[testenv]
setenv =
Expand Down

0 comments on commit cafb2cd

Please sign in to comment.