Skip to content

Commit

Permalink
Adding new/updated album_slurm-run_0.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
kephale committed Sep 30, 2024
1 parent 53bd0c1 commit e40226a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
Binary file modified album_catalog_index.db
Binary file not shown.
3 changes: 3 additions & 0 deletions solutions/album/slurm-run/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,8 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.0.2] - 2024-09-30
Better discovery of album env path

## [0.0.1] - 2024-09-30
Initial version for running a single solution via slurm
10 changes: 8 additions & 2 deletions solutions/album/slurm-run/solution.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"""

def run():
import os
import subprocess

# Fetch arguments
Expand All @@ -32,6 +33,11 @@ def run():
extra_args = args.extra_args
submit_job = args.submit_job

# Discover the album environment path dynamically
home_dir = os.path.expanduser("~")
album_env_path = os.getenv("CONDA_PREFIX") or os.getenv("MAMBA_ROOT_PREFIX") or f"{home_dir}/micromamba/envs/album"
print(f"Using album environment at: {album_env_path}")

# Construct the Slurm job script
slurm_script = f"""#!/bin/bash
#SBATCH --job-name=album_single_job
Expand All @@ -55,7 +61,7 @@ def run():
export MAMBA_CACHE_DIR=$MYDATA/micromamba_cache/dir_$SLURM_JOB_ID
micromamba_cmd="micromamba run -n album album run {album_solution_name} {extra_args}"
micromamba_cmd="micromamba run -p {album_env_path} album run {album_solution_name} {extra_args}"
echo "Executing: $micromamba_cmd"
eval $micromamba_cmd
"""
Expand All @@ -76,7 +82,7 @@ def run():
setup(
group="album",
name="slurm-run",
version="0.0.1",
version="0.0.2",
title="Run a solution on slurm the same way you run a solution",
description="Submit a single album solution to Slurm as a job with customizable resources.",
solution_creators=["Kyle Harrington"],
Expand Down
6 changes: 3 additions & 3 deletions solutions/album/slurm-run/solution.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ args:
name: submit_job
required: false
type: boolean
changelog: Initial version for running a single solution via slurm
changelog: Better discovery of album env path
description: Submit a single album solution to Slurm as a job with customizable resources.
group: album
license: MIT
Expand All @@ -55,6 +55,6 @@ tags:
- slurm
- album
- job
timestamp: '2024-09-30T16:30:54.217364'
timestamp: '2024-09-30T16:50:29.386438'
title: Run a solution on slurm the same way you run a solution
version: 0.0.1
version: 0.0.2

0 comments on commit e40226a

Please sign in to comment.