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
3 changes: 2 additions & 1 deletion Containerfile.debugpy
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
ENV UV_COMPILE_BYTECODE=1 UV_LINK_MODE=copy

RUN apt-get update \
&& apt-get install -y --no-install-recommends \
&& apt-get install -y --no-install-recommends git \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /app
Expand All @@ -44,6 +44,7 @@ COPY --from=frontend /app/coldfront/static/bundles /app/coldfront/static/bundles
ENV DEBUG=True
ENV PYTHONUNBUFFERED=1
ENV PLUGIN_SLURM=True
ENV PLUGIN_SLURMREST=True
ENV PLUGIN_XDMOD=True
ENV PLUGIN_API=True
ENV EMAIL_ENABLED=True
Expand Down
4 changes: 1 addition & 3 deletions coldfront/config/email.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,4 @@
"EMAIL_ALLOCATION_EXPIRING_NOTIFICATION_DAYS", cast=int, default=[7, 14, 30]
)
EMAIL_SIGNATURE = ENV.str("EMAIL_SIGNATURE", default="", multiline=True)
EMAIL_ADMINS_ON_ALLOCATION_EXPIRE = ENV.bool(
"EMAIL_ADMINS_ON_ALLOCATION_EXPIRE", default=False
)
EMAIL_ADMINS_ON_ALLOCATION_EXPIRE = ENV.bool("EMAIL_ADMINS_ON_ALLOCATION_EXPIRE", default=False)
28 changes: 28 additions & 0 deletions coldfront/config/plugins/slurmrest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
from coldfront.config.base import INSTALLED_APPS
from coldfront.config.env import ENV # noqa: F401
from coldfront.config.logging import LOGGING


if "coldfront_plugin_slurmrest" not in INSTALLED_APPS:
INSTALLED_APPS += [
"coldfront_plugin_slurmrest",
]

SLURMREST_CLUSTER_ATTRIBUTE_NAME = ENV.str("SLURM_CLUSTER_ATTRIBUTE_NAME", default="slurm_cluster")
SLURMREST_ACCOUNT_ATTRIBUTE_NAME = ENV.str("SLURM_ACCOUNT_ATTRIBUTE_NAME", default="slurm_account_name")
SLURMREST_SPECS_ATTRIBUTE_NAME = ENV.str("SLURM_SPECS_ATTRIBUTE_NAME", default="slurm_specs")
SLURMREST_USER_SPECS_ATTRIBUTE_NAME = ENV.str("SLURM_USER_SPECS_ATTRIBUTE_NAME", default="slurm_user_specs")

SLURMREST_NOOP = ENV.bool("SLURM_NOOP", default=False)
SLURMREST_IGNORE_USERS = ENV.list("SLURM_IGNORE_USERS", default=["root"])
SLURMREST_IGNORE_ACCOUNTS = ENV.list("SLURM_IGNORE_ACCOUNTS", default=[])

SLURMREST_CLUSTERS = {}
for cluster in filter(None, ENV.str("SLURMREST_CLUSTERS", "").split(",")):
cluster_name = f"SLURM_{cluster.upper()}"
cluster_type = ENV.str(f"{cluster_name}_TYPE")
SLURMREST_CLUSTERS[cluster] = {
"name": cluster,
"base_url": ENV.str(f"{cluster_name}_ENDPOINT"),
"token": ENV.str(f"{cluster_name}_TOKEN"),
}
1 change: 1 addition & 0 deletions coldfront/config/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# ColdFront plugin settings
plugin_configs = {
"PLUGIN_SLURM": "plugins/slurm.py",
"PLUGIN_SLURMREST": "plugins/slurmrest.py",
"PLUGIN_IQUOTA": "plugins/iquota.py",
"PLUGIN_FREEIPA": "plugins/freeipa.py",
"PLUGIN_SYSMON": "plugins/system_monitor.py",
Expand Down
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ classifiers = [
]

dependencies = [
"coldfront-plugin-slurmrest",
"crispy-bootstrap4>=2024.10",
"django>5.2,<6",
"django-crispy-forms>=2.3",
Expand Down Expand Up @@ -110,3 +111,6 @@ plugins = ["mypy_django_plugin.main"]

[tool.django-stubs]
django_settings_module = "coldfront.config.settings"

[tool.uv.sources]
coldfront-plugin-slurmrest = { git = "https://github.com/NYU-RTS/rts-coldfront-slurm-plugin" }
Loading
Loading