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

fix: prime NHC tarball within charm during packing #37

Merged
merged 2 commits into from
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions charmcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,16 @@ bases:
architectures: [amd64]

parts:
charm:
charm: {}
nhc:
plugin: nil
build-packages:
- wget
override-pull: |
wget https://github.com/mej/nhc/releases/download/1.4.3/lbnl-nhc-1.4.3.tar.gz
override-build: |
wget https://github.com/mej/nhc/releases/download/1.4.3/lbnl-nhc-1.4.3.tar.gz
craftctl default
install -m644 -D -t $CRAFT_PART_INSTALL lbnl-nhc-1.4.3.tar.gz
craftctl default

provides:
slurmctld:
Expand Down
7 changes: 6 additions & 1 deletion src/slurmd_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,12 @@ def _install_nhc_from_tarball(self) -> bool:
base_path.mkdir()

cmd = f"tar --extract --directory {base_path} --file lbnl-nhc-1.4.3.tar.gz".split()
subprocess.run(cmd)
try:
result = subprocess.check_output(cmd, stderr=subprocess.STDOUT, text=True)
logger.debug(result)
except subprocess.CalledProcessError as e:
logger.error("failed to extract NHC using tar. reason:\n%s", e.stdout)
return False

full_path = base_path / os.listdir(base_path)[0]

Expand Down
Loading