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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.memsearch/
*.py[cod]
*.swp
coldfront.egg-info
Expand Down
3 changes: 3 additions & 0 deletions Containerfile.debugpy
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ ENV PLUGIN_XDMOD=True
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
2 changes: 1 addition & 1 deletion coldfront/config/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# ------------------------------------------------------------------------------
# Default HPC resource configuration
# ------------------------------------------------------------------------------
GENERAL_RESOURCE_NAME = ENV.str("GENERAL_RESOURCE_NAME", default="University HPC")
GENERAL_RESOURCE_NAME = ENV.str("GENERAL_RESOURCE_NAME", default="UniversityHPC")

# ------------------------------------------------------------------------------
# Enable Research Outputs, Grants, Publications
Expand Down
6 changes: 5 additions & 1 deletion coldfront/config/plugins/slurmrest.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import sys

from coldfront.config.base import INSTALLED_APPS
from coldfront.config.env import ENV # noqa: F401
from coldfront.config.logging import LOGGING
Expand All @@ -20,7 +22,9 @@
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")
if (ENV.str(f"{cluster_name}_ENDPOINT") is None) or (ENV.str(f"{cluster_name}_TOKEN") is None):
sys.exit(1)

SLURMREST_CLUSTERS[cluster] = {
"name": cluster,
"base_url": ENV.str(f"{cluster_name}_ENDPOINT"),
Expand Down
46 changes: 16 additions & 30 deletions coldfront/core/utils/management/commands/load_test_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,12 @@ def handle(self, *args, **options):
is_allocatable=is_allocatable,
)

ResourceAttribute.objects.get_or_create(
resource_attribute_type=ResourceAttributeType.objects.get(name="slurm_cluster"),
resource=Resource.objects.get(name=GENERAL_RESOURCE_NAME),
value=GENERAL_RESOURCE_NAME,
)

pi1 = User.objects.get(username="cgray")
pi1.userprofile.is_pi = True
pi1.save()
Expand Down Expand Up @@ -282,45 +288,35 @@ def handle(self, *args, **options):
allocation_obj.resources.add(Resource.objects.get(name=GENERAL_RESOURCE_NAME))
allocation_obj.save()

allocation_attribute_type_obj = AllocationAttributeType.objects.get(
name="slurm_specs"
)
allocation_attribute_type_obj = AllocationAttributeType.objects.get(name="slurm_specs")
AllocationAttribute.objects.get_or_create(
allocation_attribute_type=allocation_attribute_type_obj,
allocation=allocation_obj,
value="Fairshare=100:QOS+=supporters",
)

allocation_attribute_type_obj = AllocationAttributeType.objects.get(
name="slurm_user_specs"
)
allocation_attribute_type_obj = AllocationAttributeType.objects.get(name="slurm_user_specs")
AllocationAttribute.objects.get_or_create(
allocation_attribute_type=allocation_attribute_type_obj,
allocation=allocation_obj,
value="Fairshare=parent",
)

allocation_attribute_type_obj = AllocationAttributeType.objects.get(
name="slurm_account_name"
)
allocation_attribute_type_obj = AllocationAttributeType.objects.get(name="slurm_account_name")
AllocationAttribute.objects.get_or_create(
allocation_attribute_type=allocation_attribute_type_obj,
allocation=allocation_obj,
value=f"torch_pr_{allocation_obj.project.pk}_general",
)

allocation_attribute_type_obj = AllocationAttributeType.objects.get(
name="SupportersQOS"
)
allocation_attribute_type_obj = AllocationAttributeType.objects.get(name="SupportersQOS")
AllocationAttribute.objects.get_or_create(
allocation_attribute_type=allocation_attribute_type_obj,
allocation=allocation_obj,
value="Yes",
)

allocation_attribute_type_obj = AllocationAttributeType.objects.get(
name="SupportersQOSExpireDate"
)
allocation_attribute_type_obj = AllocationAttributeType.objects.get(name="SupportersQOSExpireDate")
AllocationAttribute.objects.get_or_create(
allocation_attribute_type=allocation_attribute_type_obj,
allocation=allocation_obj,
Expand All @@ -344,17 +340,13 @@ def handle(self, *args, **options):
)
allocation_obj.resources.add(Resource.objects.get(name="Tandon"))
allocation_obj.save()
allocation_attribute_type_obj = AllocationAttributeType.objects.get(
name="slurm_account_name"
)
allocation_attribute_type_obj = AllocationAttributeType.objects.get(name="slurm_account_name")
AllocationAttribute.objects.get_or_create(
allocation_attribute_type=allocation_attribute_type_obj,
allocation=allocation_obj,
value=f"torch_pr_{allocation_obj.project.pk}_Tandon",
)
allocation_attribute_type_obj = AllocationAttributeType.objects.get(
name="Core Usage (Hours)"
)
allocation_attribute_type_obj = AllocationAttributeType.objects.get(name="Core Usage (Hours)")
AllocationAttribute.objects.get_or_create(
allocation_attribute_type=allocation_attribute_type_obj,
allocation=allocation_obj,
Expand Down Expand Up @@ -437,9 +429,7 @@ def handle(self, *args, **options):
grant_number="12345",
role="PI",
grant_pi_full_name="Stephanie Foster",
funding_agency=GrantFundingAgency.objects.get(
name="Department of Defense (DoD)"
),
funding_agency=GrantFundingAgency.objects.get(name="Department of Defense (DoD)"),
grant_start=start_date,
grant_end=end_date,
percent_credit=20.0,
Expand All @@ -461,18 +451,14 @@ def handle(self, *args, **options):
allocation_obj.resources.add(Resource.objects.get(name=GENERAL_RESOURCE_NAME))
allocation_obj.save()

allocation_attribute_type_obj = AllocationAttributeType.objects.get(
name="slurm_account_name"
)
allocation_attribute_type_obj = AllocationAttributeType.objects.get(name="slurm_account_name")
AllocationAttribute.objects.get_or_create(
allocation_attribute_type=allocation_attribute_type_obj,
allocation=allocation_obj,
value=f"torch_pr_{allocation_obj.project.pk}_general",
)

allocation_attribute_type_obj = AllocationAttributeType.objects.get(
name="Core Usage (Hours)"
)
allocation_attribute_type_obj = AllocationAttributeType.objects.get(name="Core Usage (Hours)")
allocation_attribute_obj, _ = AllocationAttribute.objects.get_or_create(
allocation_attribute_type=allocation_attribute_type_obj,
allocation=allocation_obj,
Expand Down
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