-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6c14d8b
commit 3babee6
Showing
5 changed files
with
63 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
GPU_LABEL = "nvidia.com/gpu" | ||
GPU_LIMIT_ANNOTATION = 'gpu-limit' | ||
LOW_PRIORITY_CLASS = "low" | ||
LOW_PRIORITY_CLASS = "low" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
from dataclasses import dataclass | ||
import json | ||
from typing import List, Optional | ||
|
||
from dataclasses_json import dataclass_json | ||
from dsmlp.plugin.awsed import AwsedClient, UnsuccessfulRequest | ||
from dsmlp.plugin.console import Console | ||
from dsmlp.plugin.course import ConfigProvider | ||
from dsmlp.plugin.kube import KubeClient, NotFound | ||
import jsonify | ||
|
||
from dsmlp.plugin.logger import Logger | ||
from dsmlp.app.types import * | ||
from dsmlp.app.config import * | ||
|
||
# used in order to bypass awsed for tritonGPT while still maintaining UID security. | ||
class TritonGPTValidator(ComponentValidator): | ||
|
||
def __init__(self, kube: KubeClient, logger: Logger) -> None: | ||
self.kube = kube | ||
self.logger = logger | ||
|
||
def validate_pod(self, request: Request): | ||
|
||
permitted_uids = self.kube.get_tgpt_uids() | ||
requested_uid = request.object.spec.securityContext.runAsUser | ||
|
||
# if request.uid is not in kube.get_tgpt_uids | ||
# return validationfailure | ||
if requested_uid not in permitted_uids: | ||
raise ValidationFailure(f"TritonGPT Validator: user with {permitted_uids} attempted to run a pod as {requested_uid}. Pod denied.") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.