forked from DIRACGrid/DIRAC
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Getting there to adda diracx instance...
- Loading branch information
Showing
6 changed files
with
150 additions
and
53 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
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
50 changes: 25 additions & 25 deletions
50
src/DIRAC/WorkloadManagementSystem/FutureClient/JobMonitoringClient.py
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,34 +1,34 @@ | ||
from diracx.client import Dirac | ||
from diracx.client.models import JobSearchParams | ||
# from diracx.client import Dirac | ||
# from diracx.client.models import JobSearchParams | ||
|
||
from diracx.cli.utils import get_auth_headers | ||
# from diracx.cli.utils import get_auth_headers | ||
|
||
from DIRAC.Core.Utilities.ReturnValues import convertToReturnValue | ||
# from DIRAC.Core.Utilities.ReturnValues import convertToReturnValue | ||
|
||
|
||
def fetch(parameters, jobIDs): | ||
# breakpoint() | ||
with Dirac(endpoint="http://localhost:8000") as api: | ||
jobs = api.jobs.search( | ||
parameters=["JobID"] + parameters, | ||
search=[{"parameter": "JobID", "operator": "in", "values": jobIDs}], | ||
headers=get_auth_headers(), | ||
) | ||
return {j["JobID"]: {param: j[param] for param in parameters} for j in jobs} | ||
# def fetch(parameters, jobIDs): | ||
# # breakpoint() | ||
# with Dirac(endpoint="http://localhost:8000") as api: | ||
# jobs = api.jobs.search( | ||
# parameters=["JobID"] + parameters, | ||
# search=[{"parameter": "JobID", "operator": "in", "values": jobIDs}], | ||
# headers=get_auth_headers(), | ||
# ) | ||
# return {j["JobID"]: {param: j[param] for param in parameters} for j in jobs} | ||
|
||
|
||
class JobMonitoringClient: | ||
def __init__(self, *args, **kwargs): | ||
"""TODO""" | ||
# class JobMonitoringClient: | ||
# def __init__(self, *args, **kwargs): | ||
# """TODO""" | ||
|
||
@convertToReturnValue | ||
def getJobsMinorStatus(self, jobIDs): | ||
return fetch(["MinorStatus"], jobIDs) | ||
# @convertToReturnValue | ||
# def getJobsMinorStatus(self, jobIDs): | ||
# return fetch(["MinorStatus"], jobIDs) | ||
|
||
@convertToReturnValue | ||
def getJobsStates(self, jobIDs): | ||
return fetch(["Status", "MinorStatus", "ApplicationStatus"], jobIDs) | ||
# @convertToReturnValue | ||
# def getJobsStates(self, jobIDs): | ||
# return fetch(["Status", "MinorStatus", "ApplicationStatus"], jobIDs) | ||
|
||
@convertToReturnValue | ||
def getJobsSites(self, jobIDs): | ||
return fetch(["Site"], jobIDs) | ||
# @convertToReturnValue | ||
# def getJobsSites(self, jobIDs): | ||
# return fetch(["Site"], jobIDs) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/usr/bin/env bash | ||
source /home/dirac/ServerInstallDIR/bashrc | ||
git config --global user.name "DIRAC Server CI" | ||
git config --global user.email "dirac-server-ci@invalid" | ||
curl -L https://gitlab.cern.ch/chaen/chris-hackaton-cs/-/raw/master/convert-from-legacy.py |DIRAC_COMPAT_ENABLE_CS_CONVERSION=True ~/ServerInstallDIR/diracos/bin/python - ~/ServerInstallDIR/etc/Production.cfg /cs_store/initialRepo/ | ||
git -C /cs_store/initialRepo/ commit -am "export $(date)" |