DIRAC 9.0.0a68__py3-none-any.whl → 9.0.0a69__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.
@@ -17,7 +17,6 @@ Example:
17
17
  'LocalAccount': 'prod006',
18
18
  'LocalBatchID': '',
19
19
  'LocalJobID': '277821.ce.labmc.inf.utfsm.cl',
20
- 'MatcherServiceTime': '2.27646398544',
21
20
  'Memory(kB)': '858540kB',
22
21
  'ModelName': 'Intel(R)Xeon(R)CPU5110@1.60GHz',
23
22
  'NormCPUTime(s)': '1.02',
@@ -236,7 +236,6 @@ class JobAgent(AgentModule):
236
236
  jobGroup = matcherInfo["Group"]
237
237
  owner = matcherInfo["Owner"]
238
238
  ceDict = matcherInfo["CEDict"]
239
- matchTime = matcherInfo["matchTime"]
240
239
 
241
240
  optimizerParams = {}
242
241
  for key in matcherInfo:
@@ -263,9 +262,6 @@ class JobAgent(AgentModule):
263
262
  self.log.verbose("Job request successful: \n", jobRequest["Value"])
264
263
  self.log.info("Received", f"JobID={jobID}, JobType={jobType}, Owner={owner}, JobGroup={jobGroup}")
265
264
  self.jobCount += 1
266
- self.jobs[jobID]["JobReport"].setJobParameter(
267
- par_name="MatcherServiceTime", par_value=str(matchTime), sendFlag=False
268
- )
269
265
 
270
266
  self.jobs[jobID]["JobReport"].setJobStatus(minorStatus="Job Received by Agent", sendFlag=False)
271
267
  result_setupProxy = self._setupProxy(owner, jobGroup)
@@ -547,7 +543,7 @@ class JobAgent(AgentModule):
547
543
  jobRequest = MatcherClient().requestJob(ceDict)
548
544
  matchTime = time.time() - start
549
545
 
550
- self.log.info("MatcherTime", f"= {matchTime:.2f} (s)")
546
+ self.log.verbose("MatcherTime", f"= {matchTime:.2f} (s)")
551
547
  if jobRequest["OK"]:
552
548
  jobRequest["Value"]["matchTime"] = matchTime
553
549
  jobRequest["Value"]["CEDict"] = ceDict
@@ -1,4 +1,4 @@
1
- """ This agent syncs CS and pilot files to a web server of your choice
1
+ """This agent syncs CS and pilot files to a web server of your choice
2
2
 
3
3
  .. literalinclude:: ../ConfigTemplate.cfg
4
4
  :start-after: ##BEGIN PilotSyncAgent
@@ -7,6 +7,7 @@
7
7
  :caption: PilotsSyncAgent options
8
8
 
9
9
  """
10
+
10
11
  import os
11
12
  import json
12
13
  import shutil
@@ -38,8 +39,8 @@ class PilotSyncAgent(AgentModule):
38
39
  self.workingDirectory = self.am_getOption("WorkDirectory")
39
40
  self.saveDir = self.am_getOption("SaveDirectory", self.saveDir)
40
41
  self.uploadLocations = self.am_getOption("UploadLocations", self.uploadLocations)
41
- includeMasterCS = self.am_getOption("IncludeMasterCS", self.includeMasterCS)
42
- if isinstance(includeMasterCS, str) and includeMasterCS.lower() in ["n", "no", "false"]:
42
+ self.includeMasterCS = self.am_getOption("IncludeMasterCS", self.includeMasterCS)
43
+ if isinstance(self.includeMasterCS, str) and self.includeMasterCS.lower() in ["n", "no", "false"]:
43
44
  self.includeMasterCS = False
44
45
 
45
46
  self.certAndKeyLocation = getHostCertificateAndKeyLocation()
@@ -285,7 +285,6 @@ class PushJobAgent(JobAgent):
285
285
  jobGroup = matcherInfo["Group"]
286
286
  owner = matcherInfo["Owner"]
287
287
  ceDict = matcherInfo["CEDict"]
288
- matchTime = matcherInfo["matchTime"]
289
288
 
290
289
  optimizerParams = {}
291
290
  for key in matcherInfo:
@@ -313,9 +312,6 @@ class PushJobAgent(JobAgent):
313
312
  self.log.verbose("Job request successful: \n", jobRequest["Value"])
314
313
  self.log.info("Received", f"JobID={jobID}, JobType={jobType}, Owner={owner}, JobGroup={jobGroup}")
315
314
 
316
- self.jobs[jobID]["JobReport"].setJobParameter(
317
- par_name="MatcherServiceTime", par_value=str(matchTime), sendFlag=False
318
- )
319
315
  self.jobs[jobID]["JobReport"].setJobStatus(
320
316
  status=JobStatus.MATCHED, minorStatus="Job Received by Agent", sendFlag=False
321
317
  )
@@ -1,9 +1,10 @@
1
- """ CStoJSONSynchronizer
2
- Module that keeps the pilot parameters file synchronized with the information
3
- in the Operations/Pilot section of the CS. If there are additions in the CS,
4
- these are incorporated to the file.
5
- The module uploads to a web server the latest version of the pilot scripts.
1
+ """CStoJSONSynchronizer
2
+ Module that keeps the pilot parameters file synchronized with the information
3
+ in the Operations/Pilot section of the CS. If there are additions in the CS,
4
+ these are incorporated to the file.
5
+ The module uploads to a web server the latest version of the pilot scripts.
6
6
  """
7
+
7
8
  import datetime
8
9
  import glob
9
10
  import os
@@ -19,6 +20,67 @@ from DIRAC.ConfigurationSystem.Client.Helpers.Operations import Operations
19
20
  from DIRAC.ConfigurationSystem.Client.Helpers.Path import cfgPath
20
21
  from DIRAC.Core.Utilities.ReturnValues import DOKReturnType, DReturnType
21
22
 
23
+ import socket
24
+ from urllib.parse import urlparse
25
+
26
+
27
+ def exclude_master_cs_aliases(urls: list[str], master_cs_url: str) -> list[str]:
28
+ """
29
+ Excludes URLs that are DNS aliases of the given MasterCS server URL.
30
+
31
+ This function resolves the IP addresses of the MasterCS server and each URL in the input list.
32
+ It returns a new list containing only those URLs whose hostnames do not resolve to any of the
33
+ MasterCS server's IP addresses, effectively excluding all DNS aliases of the MasterCS server.
34
+
35
+ Args:
36
+ urls (list[str]): A list of URLs to filter. Each URL should be a string in a valid URL format.
37
+ master_cs_url (str): The reference URL (e.g., MasterCS server URL) whose DNS aliases are to be excluded.
38
+
39
+ Returns:
40
+ list[str]: A new list of URLs with all aliases of the MasterCS server removed.
41
+ If the MasterCS hostname cannot be resolved, the original list is returned unchanged.
42
+
43
+ Example:
44
+ >>> urls = [
45
+ ... 'dips://lbvobox303.cern.ch:9135/Configuration/Server',
46
+ ... 'dips://ccwlcglhcb02.in2p3.fr:9135/Configuration/Server',
47
+ ... 'dips://lbvobox302.cern.ch:9135/Configuration/Server',
48
+ ... ]
49
+ >>> master_cs_url = "dips://mastercs.cern.ch:9135/Configuration/Server"
50
+ >>> exclude_master_cs_aliases(urls, master_cs_url)
51
+ ['dips://ccwlcglhcb02.in2p3.fr:9135/Configuration/Server']
52
+
53
+ Notes:
54
+ - If the MasterCS hostname cannot be resolved, the function returns the original list.
55
+ - If a hostname in the input list cannot be resolved, it is included in the result.
56
+ - The comparison is based on IP addresses, not hostnames.
57
+ """
58
+ master_cs_hostname = urlparse(master_cs_url).hostname
59
+ if not master_cs_hostname:
60
+ return urls
61
+
62
+ # Resolve IP addresses for the MasterCS hostname
63
+ try:
64
+ master_cs_ips = set(socket.gethostbyname_ex(master_cs_hostname)[2])
65
+ except socket.gaierror:
66
+ return urls
67
+
68
+ # Function to get IPs for a hostname
69
+ def get_ips(hostname):
70
+ try:
71
+ return set(socket.gethostbyname_ex(hostname)[2])
72
+ except socket.gaierror:
73
+ return set()
74
+
75
+ filtered_urls = []
76
+ for url in urls:
77
+ hostname = urlparse(url).hostname
78
+ ips = get_ips(hostname)
79
+ if not ips & master_cs_ips:
80
+ filtered_urls.append(url)
81
+
82
+ return filtered_urls
83
+
22
84
 
23
85
  class PilotCStoJSONSynchronizer:
24
86
  """
@@ -151,7 +213,8 @@ class PilotCStoJSONSynchronizer:
151
213
  configurationServers = gConfig.getServersList()
152
214
  if not includeMasterCS:
153
215
  masterCS = gConfigurationData.getMasterServer()
154
- configurationServers = list(set(configurationServers) - {masterCS})
216
+ configurationServers = exclude_master_cs_aliases(configurationServers, masterCS)
217
+
155
218
  pilotDict["ConfigurationServers"] = configurationServers
156
219
 
157
220
  self.log.debug("Got pilotDict", str(pilotDict))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: DIRAC
3
- Version: 9.0.0a68
3
+ Version: 9.0.0a69
4
4
  Summary: DIRAC is an interware, meaning a software framework for distributed computing.
5
5
  Home-page: https://github.com/DIRACGrid/DIRAC/
6
6
  License: GPL-3.0-only
@@ -19,7 +19,7 @@ Requires-Dist: cachetools
19
19
  Requires-Dist: certifi
20
20
  Requires-Dist: cwltool
21
21
  Requires-Dist: diraccfg
22
- Requires-Dist: DIRACCommon==v9.0.0a68
22
+ Requires-Dist: DIRACCommon==v9.0.0a69
23
23
  Requires-Dist: diracx-client>=v0.0.1a18
24
24
  Requires-Dist: diracx-core>=v0.0.1a18
25
25
  Requires-Dist: db12
@@ -654,7 +654,7 @@ DIRAC/Interfaces/scripts/dirac_wms_job_get_output.py,sha256=GknZloaQFv8suW5U_vYS
654
654
  DIRAC/Interfaces/scripts/dirac_wms_job_get_output_data.py,sha256=ohn1CLgqUceDsHxdAIRrQs4t_k-ZyDk66whGm-RIPh0,1287
655
655
  DIRAC/Interfaces/scripts/dirac_wms_job_kill.py,sha256=tCbozyC_XEPmbvL9uIhSA7eg9fCzyRKl1AWQoecO7So,1493
656
656
  DIRAC/Interfaces/scripts/dirac_wms_job_logging_info.py,sha256=uzF3JkOUymGIKZCe93-n_drx7wi_hZgFsm5xOMFW3WE,2838
657
- DIRAC/Interfaces/scripts/dirac_wms_job_parameters.py,sha256=x2GXOL0_mL0YT6py49tXXdE1V1957RXQ8rdeNeAgYkI,1914
657
+ DIRAC/Interfaces/scripts/dirac_wms_job_parameters.py,sha256=fpZMjl0JAxRNzBm3XyU_ThYT100wzFxks26SedC1zyo,1872
658
658
  DIRAC/Interfaces/scripts/dirac_wms_job_peek.py,sha256=OAEMRuFLB-_TwaCefnQ-PKYPOkMpjJjKAX3WFm1x-A4,1042
659
659
  DIRAC/Interfaces/scripts/dirac_wms_job_reschedule.py,sha256=hufLR9CKLABzXUPovm15imf_jha55KDe-3XPtQ_g70Q,1155
660
660
  DIRAC/Interfaces/scripts/dirac_wms_job_status.py,sha256=vFcKh5EPlJ7tp9Pwz4orsspgp9_lvgxztYyyKmXWdYk,2208
@@ -1119,12 +1119,12 @@ DIRAC/Workflow/Utilities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZ
1119
1119
  DIRAC/Workflow/Utilities/test/Test_Utilities.py,sha256=DNjFPpBmpojwCWhZSUSoG3AIhMQvqyiZdSuVkrHkOtk,2595
1120
1120
  DIRAC/WorkloadManagementSystem/ConfigTemplate.cfg,sha256=EpXTiHV-omMuMcWDzQzWZ_LmAZFMRTabfJpfZmVfzEA,9065
1121
1121
  DIRAC/WorkloadManagementSystem/__init__.py,sha256=9-_-HOT_8S3i-TMmTR_gFVVlNyktBRk-S2qSuOBKoIc,50
1122
- DIRAC/WorkloadManagementSystem/Agent/JobAgent.py,sha256=Hi3zPfK9h7CwNO2pK4IABCqO_uShCIaKvZGlUdgsWPA,41034
1122
+ DIRAC/WorkloadManagementSystem/Agent/JobAgent.py,sha256=LzLypd3m4a6M-J5_nmUMsMqgflb_1Xm77eONDE6G1Vg,40843
1123
1123
  DIRAC/WorkloadManagementSystem/Agent/JobCleaningAgent.py,sha256=TR8nDO43DuJxOQVIdOUrqpWjRjJp52dVzOKUUewL9U4,14708
1124
1124
  DIRAC/WorkloadManagementSystem/Agent/PilotLoggingAgent.py,sha256=ZIgvFpasGTh76GW3G7O4hKC_Kkm31uWymlH-MTT3AXg,10541
1125
1125
  DIRAC/WorkloadManagementSystem/Agent/PilotStatusAgent.py,sha256=qY6TbYCPOFFXhHffmRJLNEbWvZPyg5Lc5B_8BbyQ7zc,9711
1126
- DIRAC/WorkloadManagementSystem/Agent/PilotSyncAgent.py,sha256=Q50axgfx_D9iF2hT0aNaJ1KA85idOluBeBWDcjR6j8c,4845
1127
- DIRAC/WorkloadManagementSystem/Agent/PushJobAgent.py,sha256=OkIIFnJrwUYCroWEc5bgAfsnGks98y0gO1GLKamBXO0,38820
1126
+ DIRAC/WorkloadManagementSystem/Agent/PilotSyncAgent.py,sha256=qzDFCGZ8EtjxDUaPgyFDlSmJfyF2KLuyXTC7au3-p2Q,4860
1127
+ DIRAC/WorkloadManagementSystem/Agent/PushJobAgent.py,sha256=IvHshnw2xN0AZrruEu86C47GDez8enBD6jjNIZd6QcA,38594
1128
1128
  DIRAC/WorkloadManagementSystem/Agent/SiteDirector.py,sha256=ZnbjKca8tWLekObALrsFXm7EoXAYxEpHSGRAbrqU5mk,45229
1129
1129
  DIRAC/WorkloadManagementSystem/Agent/StalledJobAgent.py,sha256=foEbmRotEmfeQG6nyIsJv1kSJkm4flkQsPYbSylS3SM,24572
1130
1130
  DIRAC/WorkloadManagementSystem/Agent/StatesAccountingAgent.py,sha256=iNIlWQEDBk6R1S8oHOIusZUwxOwLtgwuzR_4s32-o5w,8707
@@ -1240,7 +1240,7 @@ DIRAC/WorkloadManagementSystem/Utilities/JobModel.py,sha256=jN9sFbzMZo9tab6Kp7Oe
1240
1240
  DIRAC/WorkloadManagementSystem/Utilities/JobParameters.py,sha256=JW3AAEtBJn1gIO_rm2Ft5qqjfLteIo3HpQtGNZBfhxE,8365
1241
1241
  DIRAC/WorkloadManagementSystem/Utilities/JobStatusUtility.py,sha256=WtGJzC7fHvydANh8JH6e1Kk_jebrCMPr2c5cw3ufjm8,7826
1242
1242
  DIRAC/WorkloadManagementSystem/Utilities/ParametricJob.py,sha256=FNUsGhvsFVrtmA7r8G-sd4QTMeBkqG1sdtwiBUKQyd0,605
1243
- DIRAC/WorkloadManagementSystem/Utilities/PilotCStoJSONSynchronizer.py,sha256=aJr2YdE5fb_gieejEyqOg_zcB9MFW5ikzVyKVjnGBN4,9838
1243
+ DIRAC/WorkloadManagementSystem/Utilities/PilotCStoJSONSynchronizer.py,sha256=sjOOWeKLZMpYD2GJVU-EOkZAfmRpAwIcJntAAcalE20,12244
1244
1244
  DIRAC/WorkloadManagementSystem/Utilities/PilotWrapper.py,sha256=VcvQTpeyTbVYqSsPQDyAt37N2CaEAnIuvbR6yk4kYk8,15465
1245
1245
  DIRAC/WorkloadManagementSystem/Utilities/QueueUtilities.py,sha256=J5-n_lvWbW_TRjrlqp8hx1SHEaXDW2Dxp3R1hBBrWnE,12082
1246
1246
  DIRAC/WorkloadManagementSystem/Utilities/RemoteRunner.py,sha256=7FcEtlYSJMzdbLIFBUKD-j_wqRHya-ISqk8w-JRy3kw,12159
@@ -1294,9 +1294,9 @@ DIRAC/tests/Workflow/Integration/exe-script.py,sha256=B_slYdTocEzqfQLRhwuPiLyYUn
1294
1294
  DIRAC/tests/Workflow/Integration/helloWorld.py,sha256=tBgEHH3ZF7ZiTS57gtmm3DW-Qxgm_57HWHpM-Y8XSws,205
1295
1295
  DIRAC/tests/Workflow/Regression/helloWorld.py,sha256=69eCgFuVSYo-mK3Dj2dw1c6g86sF5FksKCf8V2aGVoM,509
1296
1296
  DIRAC/tests/Workflow/Regression/helloWorld.xml,sha256=xwydIcFTAHIX-YPfQfyxuQ7hzvIO3IhR3UAF7ORgkGg,5310
1297
- dirac-9.0.0a68.dist-info/licenses/LICENSE,sha256=uyr4oV6jmjUeepXZPPjkJRwa5q5MrI7jqJz5sVXNblQ,32452
1298
- dirac-9.0.0a68.dist-info/METADATA,sha256=lajHXRmL_O4jHTBhxb0BnpTkzbY-Fvco4bJO9j0puvg,10020
1299
- dirac-9.0.0a68.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
1300
- dirac-9.0.0a68.dist-info/entry_points.txt,sha256=hupzIL8aVmjK3nn7RLKdhcaiPmLOiD3Kulh3CSDHKmw,16492
1301
- dirac-9.0.0a68.dist-info/top_level.txt,sha256=RISrnN9kb_mPqmVu8_o4jF-DSX8-h6AcgfkO9cgfkHA,6
1302
- dirac-9.0.0a68.dist-info/RECORD,,
1297
+ dirac-9.0.0a69.dist-info/licenses/LICENSE,sha256=uyr4oV6jmjUeepXZPPjkJRwa5q5MrI7jqJz5sVXNblQ,32452
1298
+ dirac-9.0.0a69.dist-info/METADATA,sha256=lwVvrzXbmTIFjg9IJOC_gG9_f6QU_z7yEG8NGsedvus,10020
1299
+ dirac-9.0.0a69.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
1300
+ dirac-9.0.0a69.dist-info/entry_points.txt,sha256=hupzIL8aVmjK3nn7RLKdhcaiPmLOiD3Kulh3CSDHKmw,16492
1301
+ dirac-9.0.0a69.dist-info/top_level.txt,sha256=RISrnN9kb_mPqmVu8_o4jF-DSX8-h6AcgfkO9cgfkHA,6
1302
+ dirac-9.0.0a69.dist-info/RECORD,,