Skip to content

Commit

Permalink
feat: implement kill and delete endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
simon-mazenoux committed Sep 11, 2023
1 parent 53f83de commit bd52dc7
Show file tree
Hide file tree
Showing 11 changed files with 620 additions and 9 deletions.
1 change: 1 addition & 0 deletions run_local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export DIRACX_CONFIG_BACKEND_URL="git+file://${tmp_dir}/cs_store/initialRepo"
export DIRACX_DB_URL_AUTHDB="sqlite+aiosqlite:///:memory:"
export DIRACX_DB_URL_JOBDB="sqlite+aiosqlite:///:memory:"
export DIRACX_DB_URL_JOBLOGGINGDB="sqlite+aiosqlite:///:memory:"
export DIRACX_DB_URL_TASKQUEUEDB="sqlite+aiosqlite:///:memory:"
export DIRACX_SERVICE_AUTH_TOKEN_KEY="file://${tmp_dir}/signing-key/rs256.key"
export DIRACX_SERVICE_AUTH_ALLOWED_REDIRECTS='["http://'$(hostname| tr -s '[:upper:]' '[:lower:]')':8000/docs/oauth2-redirect"]'

Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ diracx.dbs =
JobDB = diracx.db:JobDB
JobLoggingDB = diracx.db:JobLoggingDB
SandboxMetadataDB = diracx.db:SandboxMetadataDB
TaskQueueDB = diracx.db:TaskQueueDB
#DummyDB = diracx.db:DummyDB
diracx.services =
jobs = diracx.routers.job_manager:router
Expand Down
4 changes: 1 addition & 3 deletions src/diracx/cli/internal.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,7 @@ def generate_cs(
DefaultGroup=user_group,
Users={},
Groups={
user_group: GroupConfig(
JobShare=None, Properties=["NormalUser"], Quota=None, Users=[]
)
user_group: GroupConfig(Properties=["NormalUser"], Quota=None, Users=[])
},
)
config = Config(
Expand Down
7 changes: 6 additions & 1 deletion src/diracx/core/config/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class GroupConfig(BaseModel):
AutoAddVOMS: bool = False
AutoUploadPilotProxy: bool = False
AutoUploadProxy: bool = False
JobShare: Optional[int]
JobShare: int = 1000
Properties: list[SecurityProperty]
Quota: Optional[int]
Users: list[str]
Expand Down Expand Up @@ -86,9 +86,14 @@ class JobMonitoringConfig(BaseModel):
useESForJobParametersFlag: bool = False


class JobSchedulingConfig(BaseModel):
EnableSharesCorrection: bool = False


class ServicesConfig(BaseModel):
Catalogs: dict[str, Any] | None
JobMonitoring: JobMonitoringConfig = JobMonitoringConfig()
JobScheduling: JobSchedulingConfig = JobSchedulingConfig()


class OperationsConfig(BaseModel):
Expand Down
2 changes: 1 addition & 1 deletion src/diracx/core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class SortSpec(TypedDict):
class ScalarSearchSpec(TypedDict):
parameter: str
operator: ScalarSearchOperator
value: str
value: str | int


class VectorSearchSpec(TypedDict):
Expand Down
4 changes: 2 additions & 2 deletions src/diracx/db/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
__all__ = ("AuthDB", "JobDB", "JobLoggingDB", "SandboxMetadataDB")
__all__ = ("AuthDB", "JobDB", "JobLoggingDB", "SandboxMetadataDB", "TaskQueueDB")

from .auth.db import AuthDB
from .jobs.db import JobDB, JobLoggingDB
from .jobs.db import JobDB, JobLoggingDB, TaskQueueDB
from .sandbox_metadata.db import SandboxMetadataDB

# from .dummy.db import DummyDB
Loading

0 comments on commit bd52dc7

Please sign in to comment.