DIRAC 9.0.0a42__py3-none-any.whl → 9.0.7__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- DIRAC/AccountingSystem/Client/AccountingCLI.py +0 -140
- DIRAC/AccountingSystem/Client/DataStoreClient.py +0 -13
- DIRAC/AccountingSystem/Client/Types/BaseAccountingType.py +0 -7
- DIRAC/AccountingSystem/ConfigTemplate.cfg +0 -5
- DIRAC/AccountingSystem/Service/DataStoreHandler.py +0 -72
- DIRAC/ConfigurationSystem/Client/Helpers/CSGlobals.py +0 -9
- DIRAC/ConfigurationSystem/Client/Helpers/Registry.py +38 -26
- DIRAC/ConfigurationSystem/Client/Helpers/Resources.py +11 -43
- DIRAC/ConfigurationSystem/Client/Helpers/test/Test_Helpers.py +0 -16
- DIRAC/ConfigurationSystem/Client/LocalConfiguration.py +14 -8
- DIRAC/ConfigurationSystem/Client/PathFinder.py +47 -8
- DIRAC/ConfigurationSystem/Client/SyncPlugins/CERNLDAPSyncPlugin.py +4 -1
- DIRAC/ConfigurationSystem/Client/VOMS2CSSynchronizer.py +32 -19
- DIRAC/ConfigurationSystem/Client/test/Test_PathFinder.py +41 -1
- DIRAC/ConfigurationSystem/private/RefresherBase.py +4 -2
- DIRAC/Core/Base/API.py +4 -7
- DIRAC/Core/Base/SQLAlchemyDB.py +1 -0
- DIRAC/Core/DISET/ServiceReactor.py +11 -3
- DIRAC/Core/DISET/private/BaseClient.py +1 -2
- DIRAC/Core/DISET/private/Transports/M2SSLTransport.py +9 -7
- DIRAC/Core/DISET/private/Transports/SSL/M2Utils.py +3 -1
- DIRAC/Core/LCG/GOCDBClient.py +5 -7
- DIRAC/Core/Security/DiracX.py +31 -17
- DIRAC/Core/Security/IAMService.py +5 -10
- DIRAC/Core/Security/Locations.py +27 -18
- DIRAC/Core/Security/ProxyInfo.py +9 -5
- DIRAC/Core/Security/VOMSService.py +2 -4
- DIRAC/Core/Security/m2crypto/X509Certificate.py +4 -6
- DIRAC/Core/Security/m2crypto/asn1_utils.py +17 -5
- DIRAC/Core/Security/test/test_diracx_token_from_pem.py +161 -0
- DIRAC/Core/Tornado/Client/ClientSelector.py +4 -1
- DIRAC/Core/Tornado/Server/TornadoService.py +1 -1
- DIRAC/Core/Utilities/CGroups2.py +328 -0
- DIRAC/Core/Utilities/ClassAd/ClassAdLight.py +4 -290
- DIRAC/Core/Utilities/DErrno.py +5 -309
- DIRAC/Core/Utilities/Extensions.py +10 -1
- DIRAC/Core/Utilities/File.py +1 -1
- DIRAC/Core/Utilities/Graphs/GraphData.py +1 -1
- DIRAC/Core/Utilities/Graphs/GraphUtilities.py +6 -1
- DIRAC/Core/Utilities/JDL.py +1 -195
- DIRAC/Core/Utilities/List.py +1 -124
- DIRAC/Core/Utilities/MySQL.py +103 -99
- DIRAC/Core/Utilities/Os.py +32 -1
- DIRAC/Core/Utilities/Platform.py +2 -107
- DIRAC/Core/Utilities/Proxy.py +0 -4
- DIRAC/Core/Utilities/ReturnValues.py +7 -252
- DIRAC/Core/Utilities/StateMachine.py +12 -178
- DIRAC/Core/Utilities/Subprocess.py +35 -14
- DIRAC/Core/Utilities/TimeUtilities.py +10 -253
- DIRAC/Core/Utilities/test/Test_JDL.py +0 -3
- DIRAC/Core/Utilities/test/Test_Profiler.py +20 -20
- DIRAC/Core/scripts/dirac_agent.py +1 -1
- DIRAC/Core/scripts/dirac_apptainer_exec.py +72 -46
- DIRAC/Core/scripts/dirac_configure.py +1 -3
- DIRAC/Core/scripts/dirac_install_db.py +24 -6
- DIRAC/Core/scripts/dirac_platform.py +1 -92
- DIRAC/DataManagementSystem/Agent/FTS3Agent.py +8 -7
- DIRAC/DataManagementSystem/Agent/RequestOperations/RemoveFile.py +7 -6
- DIRAC/DataManagementSystem/Client/FTS3Job.py +71 -34
- DIRAC/DataManagementSystem/DB/FTS3DB.py +7 -3
- DIRAC/DataManagementSystem/DB/FileCatalogComponents/DatasetManager/DatasetManager.py +1 -1
- DIRAC/DataManagementSystem/DB/FileCatalogDB.sql +9 -9
- DIRAC/DataManagementSystem/DB/FileCatalogWithFkAndPsDB.sql +9 -9
- DIRAC/DataManagementSystem/Utilities/DMSHelpers.py +6 -2
- DIRAC/DataManagementSystem/scripts/dirac_admin_allow_se.py +13 -8
- DIRAC/DataManagementSystem/scripts/dirac_admin_ban_se.py +13 -8
- DIRAC/DataManagementSystem/scripts/dirac_dms_create_moving_request.py +2 -0
- DIRAC/DataManagementSystem/scripts/dirac_dms_protocol_matrix.py +0 -1
- DIRAC/FrameworkSystem/Client/BundleDeliveryClient.py +2 -7
- DIRAC/FrameworkSystem/Client/ComponentInstaller.py +9 -4
- DIRAC/FrameworkSystem/Client/ProxyManagerClient.py +5 -2
- DIRAC/FrameworkSystem/Client/SystemAdministratorClientCLI.py +11 -6
- DIRAC/FrameworkSystem/ConfigTemplate.cfg +2 -0
- DIRAC/FrameworkSystem/DB/AuthDB.py +3 -3
- DIRAC/FrameworkSystem/DB/InstalledComponentsDB.py +4 -4
- DIRAC/FrameworkSystem/DB/ProxyDB.py +11 -3
- DIRAC/FrameworkSystem/DB/TokenDB.py +1 -1
- DIRAC/FrameworkSystem/Service/ProxyManagerHandler.py +8 -6
- DIRAC/FrameworkSystem/Utilities/MonitoringUtilities.py +2 -19
- DIRAC/FrameworkSystem/Utilities/TokenManagementUtilities.py +3 -2
- DIRAC/FrameworkSystem/Utilities/diracx.py +36 -14
- DIRAC/FrameworkSystem/private/authorization/AuthServer.py +2 -2
- DIRAC/FrameworkSystem/scripts/dirac_admin_update_pilot.py +18 -11
- DIRAC/FrameworkSystem/scripts/dirac_login.py +2 -2
- DIRAC/FrameworkSystem/scripts/dirac_proxy_init.py +7 -8
- DIRAC/Interfaces/API/Dirac.py +27 -15
- DIRAC/Interfaces/API/DiracAdmin.py +45 -17
- DIRAC/Interfaces/API/Job.py +9 -13
- DIRAC/Interfaces/scripts/dirac_admin_allow_site.py +12 -18
- DIRAC/Interfaces/scripts/dirac_admin_ban_site.py +12 -10
- DIRAC/Interfaces/scripts/dirac_admin_get_site_mask.py +4 -13
- DIRAC/Interfaces/scripts/dirac_admin_reset_job.py +3 -6
- DIRAC/Interfaces/scripts/dirac_wms_job_parameters.py +0 -1
- DIRAC/MonitoringSystem/Client/Types/WMSHistory.py +4 -0
- DIRAC/MonitoringSystem/Client/WebAppClient.py +26 -0
- DIRAC/MonitoringSystem/ConfigTemplate.cfg +9 -0
- DIRAC/MonitoringSystem/DB/MonitoringDB.py +6 -25
- DIRAC/MonitoringSystem/Service/MonitoringHandler.py +0 -33
- DIRAC/MonitoringSystem/Service/WebAppHandler.py +599 -0
- DIRAC/MonitoringSystem/private/MainReporter.py +0 -3
- DIRAC/ProductionSystem/DB/ProductionDB.sql +4 -4
- DIRAC/ProductionSystem/scripts/dirac_prod_get.py +2 -2
- DIRAC/ProductionSystem/scripts/dirac_prod_get_all.py +2 -2
- DIRAC/ProductionSystem/scripts/dirac_prod_get_trans.py +2 -3
- DIRAC/RequestManagementSystem/Agent/RequestExecutingAgent.py +8 -6
- DIRAC/RequestManagementSystem/Agent/RequestOperations/ForwardDISET.py +2 -14
- DIRAC/RequestManagementSystem/Client/ReqClient.py +66 -13
- DIRAC/RequestManagementSystem/ConfigTemplate.cfg +6 -6
- DIRAC/RequestManagementSystem/DB/RequestDB.py +10 -5
- DIRAC/RequestManagementSystem/DB/test/RMSTestScenari.py +2 -0
- DIRAC/RequestManagementSystem/private/RequestValidator.py +40 -46
- DIRAC/ResourceStatusSystem/Client/SiteStatus.py +4 -2
- DIRAC/ResourceStatusSystem/Command/FreeDiskSpaceCommand.py +3 -1
- DIRAC/ResourceStatusSystem/DB/ResourceManagementDB.py +8 -8
- DIRAC/ResourceStatusSystem/DB/ResourceStatusDB.py +2 -2
- DIRAC/ResourceStatusSystem/Utilities/CSHelpers.py +2 -31
- DIRAC/ResourceStatusSystem/scripts/dirac_rss_set_status.py +30 -12
- DIRAC/Resources/Catalog/RucioFileCatalogClient.py +195 -1
- DIRAC/Resources/Catalog/test/Test_RucioFileCatalogClient.py +181 -0
- DIRAC/Resources/Computing/AREXComputingElement.py +25 -8
- DIRAC/Resources/Computing/BatchSystems/Condor.py +126 -108
- DIRAC/Resources/Computing/BatchSystems/SLURM.py +5 -1
- DIRAC/Resources/Computing/BatchSystems/test/Test_SLURM.py +46 -0
- DIRAC/Resources/Computing/ComputingElement.py +1 -1
- DIRAC/Resources/Computing/HTCondorCEComputingElement.py +44 -44
- DIRAC/Resources/Computing/InProcessComputingElement.py +4 -2
- DIRAC/Resources/Computing/LocalComputingElement.py +1 -18
- DIRAC/Resources/Computing/SSHBatchComputingElement.py +1 -17
- DIRAC/Resources/Computing/SSHComputingElement.py +1 -18
- DIRAC/Resources/Computing/SingularityComputingElement.py +19 -5
- DIRAC/Resources/Computing/test/Test_HTCondorCEComputingElement.py +67 -49
- DIRAC/Resources/Computing/test/Test_PoolComputingElement.py +2 -1
- DIRAC/Resources/IdProvider/CheckInIdProvider.py +13 -0
- DIRAC/Resources/IdProvider/IdProviderFactory.py +11 -3
- DIRAC/Resources/MessageQueue/StompMQConnector.py +1 -1
- DIRAC/Resources/Storage/GFAL2_StorageBase.py +24 -15
- DIRAC/Resources/Storage/OccupancyPlugins/WLCGAccountingHTTPJson.py +1 -3
- DIRAC/Resources/Storage/StorageBase.py +4 -2
- DIRAC/Resources/Storage/StorageElement.py +6 -7
- DIRAC/StorageManagementSystem/DB/StorageManagementDB.sql +2 -2
- DIRAC/TransformationSystem/Agent/TaskManagerAgentBase.py +10 -16
- DIRAC/TransformationSystem/Agent/TransformationAgent.py +22 -1
- DIRAC/TransformationSystem/Agent/TransformationCleaningAgent.py +16 -16
- DIRAC/TransformationSystem/Client/TaskManager.py +2 -4
- DIRAC/TransformationSystem/Client/Transformation.py +6 -7
- DIRAC/TransformationSystem/Client/TransformationClient.py +21 -11
- DIRAC/TransformationSystem/Client/Utilities.py +9 -0
- DIRAC/TransformationSystem/DB/TransformationDB.py +11 -14
- DIRAC/TransformationSystem/DB/TransformationDB.sql +9 -9
- DIRAC/TransformationSystem/Service/TransformationManagerHandler.py +0 -333
- DIRAC/TransformationSystem/Utilities/ReplicationCLIParameters.py +3 -3
- DIRAC/TransformationSystem/Utilities/TransformationInfo.py +7 -5
- DIRAC/TransformationSystem/scripts/dirac_production_runjoblocal.py +2 -4
- DIRAC/TransformationSystem/test/Test_TransformationInfo.py +22 -15
- DIRAC/TransformationSystem/test/Test_replicationTransformation.py +5 -6
- DIRAC/Workflow/Modules/test/Test_Modules.py +5 -0
- DIRAC/WorkloadManagementSystem/Agent/JobAgent.py +38 -26
- DIRAC/WorkloadManagementSystem/Agent/JobCleaningAgent.py +12 -8
- DIRAC/WorkloadManagementSystem/Agent/PilotSyncAgent.py +4 -3
- DIRAC/WorkloadManagementSystem/Agent/PushJobAgent.py +13 -13
- DIRAC/WorkloadManagementSystem/Agent/SiteDirector.py +18 -14
- DIRAC/WorkloadManagementSystem/Agent/StalledJobAgent.py +18 -51
- DIRAC/WorkloadManagementSystem/Agent/StatesAccountingAgent.py +41 -1
- DIRAC/WorkloadManagementSystem/Agent/test/Test_Agent_JobAgent.py +45 -4
- DIRAC/WorkloadManagementSystem/Agent/test/Test_Agent_JobCleaningAgent.py +7 -9
- DIRAC/WorkloadManagementSystem/Agent/test/Test_Agent_PushJobAgent.py +1 -0
- DIRAC/WorkloadManagementSystem/Agent/test/Test_Agent_SiteDirector.py +9 -2
- DIRAC/WorkloadManagementSystem/Agent/test/Test_Agent_StalledJobAgent.py +4 -5
- DIRAC/WorkloadManagementSystem/Client/DownloadInputData.py +9 -9
- DIRAC/WorkloadManagementSystem/Client/InputDataResolution.py +6 -6
- DIRAC/WorkloadManagementSystem/Client/JobMonitoringClient.py +10 -11
- DIRAC/WorkloadManagementSystem/Client/JobReport.py +1 -1
- DIRAC/WorkloadManagementSystem/Client/JobState/CachedJobState.py +3 -0
- DIRAC/WorkloadManagementSystem/Client/JobState/JobManifest.py +32 -261
- DIRAC/WorkloadManagementSystem/Client/JobState/JobState.py +6 -0
- DIRAC/WorkloadManagementSystem/Client/JobStateUpdateClient.py +3 -0
- DIRAC/WorkloadManagementSystem/Client/JobStatus.py +8 -152
- DIRAC/WorkloadManagementSystem/Client/PoolXMLSlice.py +12 -19
- DIRAC/WorkloadManagementSystem/Client/SandboxStoreClient.py +25 -38
- DIRAC/WorkloadManagementSystem/Client/WMSClient.py +2 -3
- DIRAC/WorkloadManagementSystem/Client/test/Test_Client_DownloadInputData.py +29 -0
- DIRAC/WorkloadManagementSystem/ConfigTemplate.cfg +4 -8
- DIRAC/WorkloadManagementSystem/DB/JobDB.py +89 -132
- DIRAC/WorkloadManagementSystem/DB/JobDB.sql +8 -8
- DIRAC/WorkloadManagementSystem/DB/JobDBUtils.py +18 -147
- DIRAC/WorkloadManagementSystem/DB/JobLoggingDB.py +19 -6
- DIRAC/WorkloadManagementSystem/DB/JobParametersDB.py +9 -9
- DIRAC/WorkloadManagementSystem/DB/PilotAgentsDB.py +16 -5
- DIRAC/WorkloadManagementSystem/DB/PilotAgentsDB.sql +3 -3
- DIRAC/WorkloadManagementSystem/DB/SandboxMetadataDB.py +44 -82
- DIRAC/WorkloadManagementSystem/DB/StatusUtils.py +125 -0
- DIRAC/WorkloadManagementSystem/DB/tests/Test_JobDB.py +1 -1
- DIRAC/WorkloadManagementSystem/DB/tests/Test_StatusUtils.py +28 -0
- DIRAC/WorkloadManagementSystem/Executor/JobSanity.py +5 -4
- DIRAC/WorkloadManagementSystem/Executor/JobScheduling.py +4 -0
- DIRAC/WorkloadManagementSystem/FutureClient/JobStateUpdateClient.py +75 -33
- DIRAC/WorkloadManagementSystem/JobWrapper/JobWrapper.py +22 -11
- DIRAC/WorkloadManagementSystem/JobWrapper/JobWrapperTemplate.py +9 -10
- DIRAC/WorkloadManagementSystem/JobWrapper/test/Test_JobWrapper.py +60 -10
- DIRAC/WorkloadManagementSystem/JobWrapper/test/Test_JobWrapperTemplate.py +4 -0
- DIRAC/WorkloadManagementSystem/Service/JobManagerHandler.py +33 -154
- DIRAC/WorkloadManagementSystem/Service/JobMonitoringHandler.py +5 -323
- DIRAC/WorkloadManagementSystem/Service/JobStateUpdateHandler.py +0 -16
- DIRAC/WorkloadManagementSystem/Service/PilotManagerHandler.py +6 -103
- DIRAC/WorkloadManagementSystem/Service/SandboxStoreHandler.py +7 -53
- DIRAC/WorkloadManagementSystem/Service/WMSAdministratorHandler.py +16 -79
- DIRAC/WorkloadManagementSystem/Service/WMSUtilities.py +4 -18
- DIRAC/WorkloadManagementSystem/Utilities/JobModel.py +28 -209
- DIRAC/WorkloadManagementSystem/Utilities/JobParameters.py +65 -3
- DIRAC/WorkloadManagementSystem/Utilities/JobStatusUtility.py +2 -64
- DIRAC/WorkloadManagementSystem/Utilities/ParametricJob.py +7 -171
- DIRAC/WorkloadManagementSystem/Utilities/PilotCStoJSONSynchronizer.py +73 -7
- DIRAC/WorkloadManagementSystem/Utilities/PilotWrapper.py +41 -11
- DIRAC/WorkloadManagementSystem/Utilities/RemoteRunner.py +16 -0
- DIRAC/WorkloadManagementSystem/Utilities/Utils.py +36 -1
- DIRAC/WorkloadManagementSystem/Utilities/jobAdministration.py +15 -0
- DIRAC/WorkloadManagementSystem/Utilities/test/Test_JobModel.py +1 -15
- DIRAC/WorkloadManagementSystem/Utilities/test/Test_ParametricJob.py +45 -128
- DIRAC/WorkloadManagementSystem/Utilities/test/Test_PilotWrapper.py +16 -0
- DIRAC/WorkloadManagementSystem/scripts/dirac_jobexec.py +7 -2
- DIRAC/WorkloadManagementSystem/scripts/dirac_wms_pilot_job_info.py +1 -1
- DIRAC/__init__.py +62 -60
- DIRAC/tests/Utilities/testJobDefinitions.py +22 -28
- {DIRAC-9.0.0a42.dist-info → dirac-9.0.7.dist-info}/METADATA +8 -5
- {DIRAC-9.0.0a42.dist-info → dirac-9.0.7.dist-info}/RECORD +229 -228
- {DIRAC-9.0.0a42.dist-info → dirac-9.0.7.dist-info}/WHEEL +1 -1
- {DIRAC-9.0.0a42.dist-info → dirac-9.0.7.dist-info}/entry_points.txt +0 -3
- DIRAC/Core/Utilities/test/Test_List.py +0 -150
- DIRAC/Core/Utilities/test/Test_Time.py +0 -88
- DIRAC/Resources/Computing/PilotBundle.py +0 -70
- DIRAC/TransformationSystem/scripts/dirac_transformation_archive.py +0 -30
- DIRAC/TransformationSystem/scripts/dirac_transformation_clean.py +0 -30
- DIRAC/TransformationSystem/scripts/dirac_transformation_remove_output.py +0 -30
- DIRAC/WorkloadManagementSystem/Utilities/test/Test_JobManager.py +0 -58
- {DIRAC-9.0.0a42.dist-info → dirac-9.0.7.dist-info/licenses}/LICENSE +0 -0
- {DIRAC-9.0.0a42.dist-info → dirac-9.0.7.dist-info}/top_level.txt +0 -0
|
@@ -16,14 +16,12 @@ from datetime import datetime, timedelta
|
|
|
16
16
|
|
|
17
17
|
# # from DIRAC
|
|
18
18
|
from DIRAC import S_ERROR, S_OK
|
|
19
|
-
from DIRAC.ConfigurationSystem.Client.ConfigurationData import gConfigurationData
|
|
20
19
|
from DIRAC.ConfigurationSystem.Client.Helpers.Operations import Operations
|
|
21
20
|
from DIRAC.Core.Base.AgentModule import AgentModule
|
|
22
21
|
from DIRAC.Core.Utilities.DErrno import cmpError
|
|
23
22
|
from DIRAC.Core.Utilities.List import breakListIntoChunks
|
|
24
23
|
from DIRAC.Core.Utilities.Proxy import executeWithUserProxy
|
|
25
24
|
from DIRAC.Core.Utilities.ReturnValues import returnSingleResult
|
|
26
|
-
from DIRAC.DataManagementSystem.Client.DataManager import DataManager
|
|
27
25
|
from DIRAC.RequestManagementSystem.Client.File import File
|
|
28
26
|
from DIRAC.RequestManagementSystem.Client.Operation import Operation
|
|
29
27
|
from DIRAC.RequestManagementSystem.Client.ReqClient import ReqClient
|
|
@@ -34,8 +32,12 @@ from DIRAC.Resources.Catalog.FileCatalogClient import FileCatalogClient
|
|
|
34
32
|
from DIRAC.Resources.Storage.StorageElement import StorageElement
|
|
35
33
|
from DIRAC.TransformationSystem.Client import TransformationStatus
|
|
36
34
|
from DIRAC.TransformationSystem.Client.TransformationClient import TransformationClient
|
|
37
|
-
from DIRAC.WorkloadManagementSystem.
|
|
38
|
-
from DIRAC.WorkloadManagementSystem.
|
|
35
|
+
from DIRAC.WorkloadManagementSystem.DB.JobDB import JobDB
|
|
36
|
+
from DIRAC.WorkloadManagementSystem.Service.JobPolicy import (
|
|
37
|
+
RIGHT_DELETE,
|
|
38
|
+
RIGHT_KILL,
|
|
39
|
+
)
|
|
40
|
+
from DIRAC.WorkloadManagementSystem.DB.StatusUtils import kill_delete_jobs
|
|
39
41
|
|
|
40
42
|
# # agent's name
|
|
41
43
|
AGENT_NAME = "Transformation/TransformationCleaningAgent"
|
|
@@ -59,12 +61,12 @@ class TransformationCleaningAgent(AgentModule):
|
|
|
59
61
|
|
|
60
62
|
# # transformation client
|
|
61
63
|
self.transClient = None
|
|
62
|
-
# # wms client
|
|
63
|
-
self.wmsClient = None
|
|
64
64
|
# # request client
|
|
65
65
|
self.reqClient = None
|
|
66
66
|
# # file catalog client
|
|
67
67
|
self.metadataClient = None
|
|
68
|
+
# # JobDB
|
|
69
|
+
self.jobDB = None
|
|
68
70
|
|
|
69
71
|
# # transformations types
|
|
70
72
|
self.transformationTypes = None
|
|
@@ -119,14 +121,12 @@ class TransformationCleaningAgent(AgentModule):
|
|
|
119
121
|
|
|
120
122
|
# # transformation client
|
|
121
123
|
self.transClient = TransformationClient()
|
|
122
|
-
# # wms client
|
|
123
|
-
self.wmsClient = WMSClient()
|
|
124
124
|
# # request client
|
|
125
125
|
self.reqClient = ReqClient()
|
|
126
126
|
# # file catalog client
|
|
127
127
|
self.metadataClient = FileCatalogClient()
|
|
128
|
-
# # job
|
|
129
|
-
self.
|
|
128
|
+
# # job DB
|
|
129
|
+
self.jobDB = JobDB()
|
|
130
130
|
|
|
131
131
|
return S_OK()
|
|
132
132
|
|
|
@@ -224,7 +224,7 @@ class TransformationCleaningAgent(AgentModule):
|
|
|
224
224
|
So, we should just clean from time to time.
|
|
225
225
|
What I added here is done only when the agent finalize, and it's quite light-ish operation anyway.
|
|
226
226
|
"""
|
|
227
|
-
res = self.
|
|
227
|
+
res = self.jobDB.getDistinctJobAttributes("JobGroup", None, datetime.utcnow() - timedelta(days=365))
|
|
228
228
|
if not res["OK"]:
|
|
229
229
|
self.log.error("Failed to get job groups", res["Message"])
|
|
230
230
|
return res
|
|
@@ -268,7 +268,7 @@ class TransformationCleaningAgent(AgentModule):
|
|
|
268
268
|
|
|
269
269
|
# Remove JobIDs that were unknown to the TransformationSystem
|
|
270
270
|
jobGroupsToCheck = [str(transDict["TransformationID"]).zfill(8) for transDict in toClean + toArchive]
|
|
271
|
-
res = self.
|
|
271
|
+
res = self.jobDB.selectJobs({"JobGroup": jobGroupsToCheck})
|
|
272
272
|
if not res["OK"]:
|
|
273
273
|
return res
|
|
274
274
|
jobIDsToRemove = [int(jobID) for jobID in res["Value"]]
|
|
@@ -610,8 +610,8 @@ class TransformationCleaningAgent(AgentModule):
|
|
|
610
610
|
# Prevent 0 job IDs
|
|
611
611
|
jobIDs = [int(j) for j in transJobIDs if int(j)]
|
|
612
612
|
allRemove = True
|
|
613
|
-
for jobList in breakListIntoChunks(jobIDs,
|
|
614
|
-
res =
|
|
613
|
+
for jobList in breakListIntoChunks(jobIDs, 1000):
|
|
614
|
+
res = kill_delete_jobs(RIGHT_KILL, jobList, force=True)
|
|
615
615
|
if res["OK"]:
|
|
616
616
|
self.log.info(f"Successfully killed {len(jobList)} jobs from WMS")
|
|
617
617
|
elif ("InvalidJobIDs" in res) and ("NonauthorizedJobIDs" not in res) and ("FailedJobIDs" not in res):
|
|
@@ -623,7 +623,7 @@ class TransformationCleaningAgent(AgentModule):
|
|
|
623
623
|
self.log.error("Failed to kill jobs", f"(n={len(res['FailedJobIDs'])})")
|
|
624
624
|
allRemove = False
|
|
625
625
|
|
|
626
|
-
res =
|
|
626
|
+
res = kill_delete_jobs(RIGHT_DELETE, jobList, force=True)
|
|
627
627
|
if res["OK"]:
|
|
628
628
|
self.log.info("Successfully deleted jobs from WMS", f"(n={len(jobList)})")
|
|
629
629
|
elif ("InvalidJobIDs" in res) and ("NonauthorizedJobIDs" not in res) and ("FailedJobIDs" not in res):
|
|
@@ -684,7 +684,7 @@ class TransformationCleaningAgent(AgentModule):
|
|
|
684
684
|
|
|
685
685
|
for index, lfnList in enumerate(breakListIntoChunks(lfns, 300)):
|
|
686
686
|
oRequest = Request()
|
|
687
|
-
requestName = "TCA_{transID}_{index}_{md5(repr(time.time()).encode()).hexdigest()[:5]}"
|
|
687
|
+
requestName = f"TCA_{transID}_{index}_{md5(repr(time.time()).encode()).hexdigest()[:5]}"
|
|
688
688
|
oRequest.RequestName = requestName
|
|
689
689
|
oOperation = Operation()
|
|
690
690
|
oOperation.Type = "RemoveFile"
|
|
@@ -6,11 +6,9 @@ for managing jobs and requests tasks
|
|
|
6
6
|
|
|
7
7
|
import time
|
|
8
8
|
|
|
9
|
-
from DIRAC import
|
|
10
|
-
from DIRAC.TransformationSystem.Client.TransformationClient import TransformationClient
|
|
9
|
+
from DIRAC import S_ERROR, S_OK, gLogger
|
|
11
10
|
from DIRAC.TransformationSystem.Agent.TransformationAgentsUtilities import TransformationAgentsUtilities
|
|
12
|
-
|
|
13
|
-
COMPONENT_NAME = "TaskManager"
|
|
11
|
+
from DIRAC.TransformationSystem.Client.TransformationClient import TransformationClient
|
|
14
12
|
|
|
15
13
|
|
|
16
14
|
class TaskBase(TransformationAgentsUtilities):
|
|
@@ -4,16 +4,15 @@ See the information about transformation parameters below.
|
|
|
4
4
|
"""
|
|
5
5
|
import json
|
|
6
6
|
|
|
7
|
-
from DIRAC import
|
|
7
|
+
from DIRAC import S_ERROR, S_OK, gConfig, gLogger
|
|
8
|
+
from DIRAC.ConfigurationSystem.Client.Helpers.Operations import Operations
|
|
9
|
+
from DIRAC.Core.Base.API import API
|
|
8
10
|
from DIRAC.Core.Utilities.JEncode import encode
|
|
9
11
|
from DIRAC.Core.Utilities.PromptUser import promptUser
|
|
10
|
-
from DIRAC.
|
|
12
|
+
from DIRAC.MonitoringSystem.Client.WebAppClient import WebAppClient
|
|
13
|
+
from DIRAC.RequestManagementSystem.Client.Operation import Operation
|
|
11
14
|
from DIRAC.TransformationSystem.Client.BodyPlugin.BaseBody import BaseBody
|
|
12
15
|
from DIRAC.TransformationSystem.Client.TransformationClient import TransformationClient
|
|
13
|
-
from DIRAC.ConfigurationSystem.Client.Helpers.Operations import Operations
|
|
14
|
-
from DIRAC.RequestManagementSystem.Client.Operation import Operation
|
|
15
|
-
|
|
16
|
-
COMPONENT_NAME = "Transformation"
|
|
17
16
|
|
|
18
17
|
|
|
19
18
|
class Transformation(API):
|
|
@@ -500,7 +499,7 @@ class Transformation(API):
|
|
|
500
499
|
]
|
|
501
500
|
dictList = []
|
|
502
501
|
|
|
503
|
-
result =
|
|
502
|
+
result = WebAppClient().getTransformationSummaryWeb(condDict, orderby, start, maxitems)
|
|
504
503
|
if not result["OK"]:
|
|
505
504
|
self._prettyPrint(result)
|
|
506
505
|
return result
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
"""
|
|
1
|
+
"""Class that contains client access to the transformation DB handler."""
|
|
2
2
|
|
|
3
3
|
from DIRAC import S_OK, S_ERROR, gLogger
|
|
4
4
|
from DIRAC.Core.Base.Client import Client, createClient
|
|
5
5
|
from DIRAC.Core.Utilities.List import breakListIntoChunks
|
|
6
|
-
from DIRAC.Core.Utilities.
|
|
6
|
+
from DIRAC.Core.Utilities.ReturnValues import convertToReturnValue, returnValueOrRaise
|
|
7
|
+
from DIRAC.Core.Utilities.JEncode import decode as jdecode, strToIntDict
|
|
7
8
|
from DIRAC.ConfigurationSystem.Client.Helpers.Operations import Operations
|
|
8
9
|
from DIRAC.TransformationSystem.Client import TransformationStatus
|
|
9
10
|
from DIRAC.TransformationSystem.Client import TransformationFilesStatus
|
|
@@ -47,13 +48,6 @@ class TransformationClient(Client):
|
|
|
47
48
|
|
|
48
49
|
getFileSummary(lfns)
|
|
49
50
|
exists(lfns)
|
|
50
|
-
|
|
51
|
-
Web monitoring tools
|
|
52
|
-
|
|
53
|
-
getDistinctAttributeValues(attribute, selectDict)
|
|
54
|
-
getTransformationStatusCounters()
|
|
55
|
-
getTransformationSummary()
|
|
56
|
-
getTransformationSummaryWeb(selectDict, sortList, startItem, maxItems)
|
|
57
51
|
"""
|
|
58
52
|
|
|
59
53
|
def __init__(self, **kwargs):
|
|
@@ -62,8 +56,8 @@ class TransformationClient(Client):
|
|
|
62
56
|
super().__init__(**kwargs)
|
|
63
57
|
opsH = Operations()
|
|
64
58
|
self.maxResetCounter = opsH.getValue("Transformations/FilesMaxResetCounter", 10)
|
|
65
|
-
|
|
66
|
-
|
|
59
|
+
if "url" not in kwargs:
|
|
60
|
+
self.setServer("Transformation/TransformationManager")
|
|
67
61
|
|
|
68
62
|
def setServer(self, url):
|
|
69
63
|
self.serverURL = url
|
|
@@ -591,3 +585,19 @@ class TransformationClient(Client):
|
|
|
591
585
|
def addDirectory(self, path, force=False):
|
|
592
586
|
rpcClient = self._getRPC()
|
|
593
587
|
return rpcClient.addDirectory(path, force)
|
|
588
|
+
|
|
589
|
+
@convertToReturnValue
|
|
590
|
+
def getTransformationFilesCount(self, transName, field, selection=None, **kwargs):
|
|
591
|
+
if not selection:
|
|
592
|
+
selection = {}
|
|
593
|
+
rpcClient = self._getRPC(**kwargs)
|
|
594
|
+
|
|
595
|
+
files_count = returnValueOrRaise(rpcClient.getTransformationFilesCount(transName, field, selection))
|
|
596
|
+
# Some of these fields are LHCb specific, however:
|
|
597
|
+
# * it seems only LHCb uses this method
|
|
598
|
+
# * it will not be necessary with diracx & pydantic anymore
|
|
599
|
+
if field in ["TransformationID", "FileID", "TaskID", "ErrorCount", "RunNumber", "Size"]:
|
|
600
|
+
total = files_count.pop("Total")
|
|
601
|
+
files_count = strToIntDict(files_count)
|
|
602
|
+
files_count["Total"] = total
|
|
603
|
+
return files_count
|
|
@@ -9,6 +9,8 @@ Utilities for Transformation system
|
|
|
9
9
|
import ast
|
|
10
10
|
import random
|
|
11
11
|
|
|
12
|
+
from cachetools import LRUCache, cachedmethod
|
|
13
|
+
from cachetools.keys import hashkey
|
|
12
14
|
from DIRAC import S_OK, S_ERROR, gLogger
|
|
13
15
|
|
|
14
16
|
from DIRAC.Core.Utilities.List import breakListIntoChunks
|
|
@@ -22,6 +24,9 @@ from DIRAC.Resources.Catalog.FileCatalog import FileCatalog
|
|
|
22
24
|
from DIRAC.Resources.Storage.StorageElement import StorageElement
|
|
23
25
|
from DIRAC.TransformationSystem.Client.TransformationClient import TransformationClient
|
|
24
26
|
|
|
27
|
+
# Module-level cache for isSameSEInList method (shared across PluginUtilities instances)
|
|
28
|
+
_is_same_se_in_list_cache = LRUCache(maxsize=1024)
|
|
29
|
+
|
|
25
30
|
|
|
26
31
|
class PluginUtilities:
|
|
27
32
|
"""
|
|
@@ -400,6 +405,10 @@ class PluginUtilities:
|
|
|
400
405
|
|
|
401
406
|
return StorageElement(se1).isSameSE(StorageElement(se2))
|
|
402
407
|
|
|
408
|
+
@cachedmethod(
|
|
409
|
+
lambda self: _is_same_se_in_list_cache,
|
|
410
|
+
key=lambda _, a, b: hashkey(a, *sorted(b)),
|
|
411
|
+
)
|
|
403
412
|
def isSameSEInList(self, se1, seList):
|
|
404
413
|
"""Check if an SE is the same as any in a list"""
|
|
405
414
|
if se1 in seList:
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
"""
|
|
1
|
+
"""DIRAC Transformation DB
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
Transformation database is used to collect and serve the necessary information
|
|
4
|
+
in order to automate the task of job preparation for high level transformations.
|
|
5
|
+
This class is typically used as a base class for more specific data processing
|
|
6
|
+
databases
|
|
7
7
|
"""
|
|
8
8
|
|
|
9
9
|
import re
|
|
@@ -397,14 +397,11 @@ class TransformationDB(DB):
|
|
|
397
397
|
def __updateTransformationParameter(self, transID, paramName, paramValue, connection=False):
|
|
398
398
|
if paramName not in self.mutable:
|
|
399
399
|
return S_ERROR(f"Can not update the '{paramName}' transformation parameter")
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
req = f"UPDATE Transformations SET {paramName}='{paramValue}', LastUpdate=UTC_TIMESTAMP() WHERE TransformationID={transID}"
|
|
406
|
-
return self._update(req, conn=connection)
|
|
407
|
-
req = f"UPDATE Transformations SET {paramName}='{paramValue}', LastUpdate=UTC_TIMESTAMP() WHERE TransformationID={transID}"
|
|
400
|
+
res = self._escapeString(paramValue)
|
|
401
|
+
if not res["OK"]:
|
|
402
|
+
return S_ERROR("Failed to parse parameter value")
|
|
403
|
+
paramValue = res["Value"]
|
|
404
|
+
req = f"UPDATE Transformations SET {paramName}={paramValue}, LastUpdate=UTC_TIMESTAMP() WHERE TransformationID={transID}"
|
|
408
405
|
return self._update(req, conn=connection)
|
|
409
406
|
|
|
410
407
|
def _getTransformationID(self, transName, connection=False):
|
|
@@ -709,7 +706,7 @@ class TransformationDB(DB):
|
|
|
709
706
|
res = self.getCounters("TransformationFiles", ["TransformationID", field], selection)
|
|
710
707
|
if not res["OK"]:
|
|
711
708
|
return res
|
|
712
|
-
countDict = {attrDict[field]: count for attrDict, count in res["Value"]}
|
|
709
|
+
countDict = {str(attrDict[field]): count for attrDict, count in res["Value"]}
|
|
713
710
|
countDict["Total"] = sum(countDict.values())
|
|
714
711
|
return S_OK(countDict)
|
|
715
712
|
|
|
@@ -48,7 +48,7 @@ CREATE TABLE Transformations(
|
|
|
48
48
|
INDEX(TransformationFamily),
|
|
49
49
|
INDEX(Status),
|
|
50
50
|
INDEX(Type)
|
|
51
|
-
) ENGINE = InnoDB DEFAULT CHARSET =
|
|
51
|
+
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4;
|
|
52
52
|
|
|
53
53
|
-- -------------------------------------------------------------------------------
|
|
54
54
|
DROP TABLE IF EXISTS DataFiles;
|
|
@@ -59,7 +59,7 @@ CREATE TABLE DataFiles(
|
|
|
59
59
|
INDEX(Status),
|
|
60
60
|
INDEX(LFN),
|
|
61
61
|
PRIMARY KEY(FileID)
|
|
62
|
-
) ENGINE = InnoDB DEFAULT CHARSET =
|
|
62
|
+
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4;
|
|
63
63
|
|
|
64
64
|
-- -------------------------------------------------------------------------------
|
|
65
65
|
DROP TABLE IF EXISTS AdditionalParameters;
|
|
@@ -70,7 +70,7 @@ CREATE TABLE AdditionalParameters(
|
|
|
70
70
|
ParameterType VARCHAR(32) DEFAULT 'StringType',
|
|
71
71
|
PRIMARY KEY(TransformationID, ParameterName),
|
|
72
72
|
FOREIGN KEY(TransformationID) REFERENCES Transformations(TransformationID)
|
|
73
|
-
) ENGINE = InnoDB DEFAULT CHARSET =
|
|
73
|
+
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4;
|
|
74
74
|
|
|
75
75
|
-- -------------------------------------------------------------------------------
|
|
76
76
|
DROP TABLE IF EXISTS TransformationLog;
|
|
@@ -84,7 +84,7 @@ CREATE TABLE TransformationLog(
|
|
|
84
84
|
INDEX(TransformationID),
|
|
85
85
|
INDEX(MessageDate),
|
|
86
86
|
FOREIGN KEY(TransformationID) REFERENCES Transformations(TransformationID)
|
|
87
|
-
) ENGINE = InnoDB DEFAULT CHARSET =
|
|
87
|
+
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4;
|
|
88
88
|
|
|
89
89
|
-- -------------------------------------------------------------------------------
|
|
90
90
|
DROP TABLE IF EXISTS TransformationTasks;
|
|
@@ -100,7 +100,7 @@ CREATE TABLE TransformationTasks(
|
|
|
100
100
|
INDEX(ExternalStatus),
|
|
101
101
|
INDEX(TransformationID,ExternalStatus),
|
|
102
102
|
FOREIGN KEY(TransformationID) REFERENCES Transformations(TransformationID)
|
|
103
|
-
) ENGINE = InnoDB DEFAULT CHARSET =
|
|
103
|
+
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4;
|
|
104
104
|
|
|
105
105
|
-- This is required to mimic the AUTO_INCREMENT behavior of TaskID which was possible with MyISAM:
|
|
106
106
|
CREATE TRIGGER `TaskID_Generator` BEFORE INSERT ON TransformationTasks
|
|
@@ -125,7 +125,7 @@ CREATE TABLE TransformationFiles(
|
|
|
125
125
|
INDEX(TransformationID,Status),
|
|
126
126
|
FOREIGN KEY(TransformationID) REFERENCES Transformations(TransformationID),
|
|
127
127
|
FOREIGN KEY(FileID) REFERENCES DataFiles(FileID)
|
|
128
|
-
) ENGINE = InnoDB DEFAULT CHARSET =
|
|
128
|
+
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4;
|
|
129
129
|
|
|
130
130
|
-- -------------------------------------------------------------------------------
|
|
131
131
|
DROP TABLE IF EXISTS TransformationFileTasks;
|
|
@@ -137,7 +137,7 @@ CREATE TABLE TransformationFileTasks(
|
|
|
137
137
|
FOREIGN KEY(TransformationID) REFERENCES Transformations(TransformationID),
|
|
138
138
|
FOREIGN KEY(TransformationID, FileID) REFERENCES TransformationFiles(TransformationID, FileID),
|
|
139
139
|
FOREIGN KEY(TransformationID, TaskID) REFERENCES TransformationTasks(TransformationID, TaskID)
|
|
140
|
-
) ENGINE = InnoDB DEFAULT CHARSET =
|
|
140
|
+
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4;
|
|
141
141
|
|
|
142
142
|
-- -------------------------------------------------------------------------------
|
|
143
143
|
DROP TABLE IF EXISTS TaskInputs;
|
|
@@ -147,7 +147,7 @@ CREATE TABLE TaskInputs(
|
|
|
147
147
|
InputVector MEDIUMTEXT,
|
|
148
148
|
PRIMARY KEY(TransformationID, TaskID),
|
|
149
149
|
FOREIGN KEY(TransformationID, TaskID) REFERENCES TransformationTasks(TransformationID, TaskID)
|
|
150
|
-
) ENGINE = InnoDB DEFAULT CHARSET =
|
|
150
|
+
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4;
|
|
151
151
|
|
|
152
152
|
-- -------------------------------------------------------------------------------
|
|
153
153
|
DROP TABLE IF EXISTS TransformationMetaQueries;
|
|
@@ -159,6 +159,6 @@ CREATE TABLE TransformationMetaQueries(
|
|
|
159
159
|
QueryType ENUM('Input', 'Output') DEFAULT 'Input',
|
|
160
160
|
PRIMARY KEY(TransformationID, MetaDataName, QueryType),
|
|
161
161
|
FOREIGN KEY(TransformationID) REFERENCES Transformations(TransformationID)
|
|
162
|
-
) ENGINE = InnoDB DEFAULT CHARSET =
|
|
162
|
+
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4;
|
|
163
163
|
|
|
164
164
|
SET FOREIGN_KEY_CHECKS = 1;
|