Skip to content
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
2 changes: 0 additions & 2 deletions Containerfile.debugpy
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ ENV PLUGIN_API=True
ENV EMAIL_ENABLED=True
ENV XDMOD_API_URL="localhost"
ENV SLURMREST_CLUSTERS="UniversityHPC"
ENV SLURM_UNIVERSITYHPC_ENDPOINT="localhost"
ENV SLURM_UNIVERSITYHPC_TOKEN="dummy"
EXPOSE 8000
EXPOSE 5678

Expand Down
23 changes: 18 additions & 5 deletions coldfront/config/plugins/slurmrest.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import logging
import sys

from coldfront.config.base import INSTALLED_APPS
from coldfront.config.env import ENV # noqa: F401
from coldfront.config.logging import LOGGING

logger = logging.getLogger(__name__)

if "coldfront_plugin_slurmrest" not in INSTALLED_APPS:
INSTALLED_APPS += [
Expand All @@ -22,11 +23,23 @@
SLURMREST_CLUSTERS = {}
for cluster in filter(None, ENV.str("SLURMREST_CLUSTERS", "").split(",")):
cluster_name = f"SLURM_{cluster.upper()}"
if (ENV.str(f"{cluster_name}_ENDPOINT") is None) or (ENV.str(f"{cluster_name}_TOKEN") is None):
sys.exit(1)
endpoint = ENV.str(f"{cluster_name}_ENDPOINT", default=None)
token = ENV.str(f"{cluster_name}_TOKEN", default=None)
if endpoint is None or token is None:
# this is an informational logging entry, but since this occurs
# before the log handlers are configured, it needs to be at the
# warn level for the output to be visible in the build logs
logger.warn(
"Configuring slurmrest cluster %r: %s and %s missing, adding dummy values",
cluster,
f"{cluster_name}_ENDPOINT",
f"{cluster_name}_TOKEN",
)
endpoint = "dummy"
token = "dummy"

SLURMREST_CLUSTERS[cluster] = {
"name": cluster,
"base_url": ENV.str(f"{cluster_name}_ENDPOINT"),
"token": ENV.str(f"{cluster_name}_TOKEN"),
"base_url": endpoint,
"token": token,
}
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading