Skip to content

Commit

Permalink
swanspawner: Remove gpu egroup requirement
Browse files Browse the repository at this point in the history
It was decided to allow any SWAN user to use the GPU resources available
in the SWAN service, granted there are GPUs available to be used.

Therefore, the egroup restriction was removed.
  • Loading branch information
PMax5 authored and diocas committed Jan 30, 2024
1 parent c6b07f6 commit 63518a6
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions SwanSpawner/swanspawner/swankubespawner.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ async def start(self):
"""

if self._gpu_requested():
self._check_gpu_access()

self.extra_resource_guarantees["nvidia.com/gpu"] = "1"
self.extra_resource_limits["nvidia.com/gpu"] = "1"
elif "nvidia.com/gpu" in self.extra_resource_guarantees:
Expand Down Expand Up @@ -116,12 +114,4 @@ def get_env(self):

def _gpu_requested(self):
"""Returns true if the user requested a GPU"""
return "cu" in self.user_options[self.lcg_rel_field]

def _check_gpu_access(self):
"""Checks if the user is allowed to start a session with a GPU"""
if "swan-gpu" not in self.user_roles:
raise ValueError(
"""Access to GPUs is not granted;
please <a href="https://cern.service-now.com/service-portal?id=functional_element&name=swan" target="_blank">open a Support Ticket</a>"""
)
return "cu" in self.user_options[self.lcg_rel_field]

0 comments on commit 63518a6

Please sign in to comment.