Skip to content

Commit

Permalink
ASP-2756: Pack NHC tar file on slurmd charm (#174)
Browse files Browse the repository at this point in the history
Removed the NHC resource on metadata.yaml.
  • Loading branch information
jaimesouza committed Jul 13, 2023
1 parent 59aa2fc commit acbdd9a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 15 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ This file keeps track of all notable changes to the Slurm Charms.
Unreleased
----------

- removed the nhc resource and packed the nhc tar file along with slurmd charm

1.1.1 - 2023-06-27
------------------

Expand Down
7 changes: 0 additions & 7 deletions charm-slurmd/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,3 @@ requires:
peers:
slurmd-peer:
interface: slurmd-peer

resources:
nhc:
type: file
filename: lbnl-nhc-1.4.3.tar.gz
description: |
Official tarball containing NHC. Retrieved from Github Releases.
15 changes: 7 additions & 8 deletions charm-slurmd/src/charm.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python3
"""SlurmdCharm."""
import os
import json
import logging
from pathlib import Path
Expand All @@ -19,6 +20,8 @@

logger = logging.getLogger()

RESOURCES_DIR = Path(os.path.dirname(os.path.abspath(__file__))) / "resources"


class SlurmdStart(EventBase):
"""Emitted when slurmd should start."""
Expand Down Expand Up @@ -91,14 +94,10 @@ def __init__(self, *args):

def _on_install(self, event):
"""Perform installation operations for slurmd."""
try:
nhc_path = self.model.resources.fetch("nhc")
logger.debug(f"## Found nhc resource: {nhc_path}")
except Exception as e:
logger.error(f"## Missing nhc resource: {e}")
self.unit.status = BlockedStatus("Missing nhc resource")
event.defer()
return

# official tarball containing NHC, retrieved from Github Releases
nhc_path = RESOURCES_DIR / "lbnl-nhc-1.4.3.tar.gz"
logger.debug(f"## Found nhc resource: {nhc_path}")

self.unit.set_workload_version(Path("version").read_text().strip())
self.unit.status = WaitingStatus("Installing slurmd")
Expand Down
Binary file added charm-slurmd/src/resources/lbnl-nhc-1.4.3.tar.gz
Binary file not shown.

0 comments on commit acbdd9a

Please sign in to comment.