diracx-db 0.0.1a8__py3-none-any.whl → 0.0.1a10__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.
- diracx/db/os/utils.py +3 -3
- diracx/db/sql/jobs/db.py +12 -10
- diracx/db/sql/jobs/schema.py +0 -14
- diracx/db/sql/sandbox_metadata/db.py +2 -1
- diracx/db/sql/sandbox_metadata/schema.py +1 -0
- {diracx_db-0.0.1a8.dist-info → diracx_db-0.0.1a10.dist-info}/METADATA +1 -1
- {diracx_db-0.0.1a8.dist-info → diracx_db-0.0.1a10.dist-info}/RECORD +10 -10
- {diracx_db-0.0.1a8.dist-info → diracx_db-0.0.1a10.dist-info}/WHEEL +0 -0
- {diracx_db-0.0.1a8.dist-info → diracx_db-0.0.1a10.dist-info}/entry_points.txt +0 -0
- {diracx_db-0.0.1a8.dist-info → diracx_db-0.0.1a10.dist-info}/top_level.txt +0 -0
diracx/db/os/utils.py
CHANGED
@@ -17,8 +17,6 @@ from diracx.core.exceptions import InvalidQueryError
|
|
17
17
|
from diracx.core.extensions import select_from_extension
|
18
18
|
from diracx.db.exceptions import DBUnavailable
|
19
19
|
|
20
|
-
OS_DATE_FORMAT = "%Y-%m-%dT%H:%M:%S.%f%z"
|
21
|
-
|
22
20
|
logger = logging.getLogger(__name__)
|
23
21
|
|
24
22
|
|
@@ -184,7 +182,9 @@ class BaseOSDB(metaclass=ABCMeta):
|
|
184
182
|
if field_name not in self.fields:
|
185
183
|
continue
|
186
184
|
if self.fields[field_name]["type"] == "date":
|
187
|
-
hit[field_name] = datetime.strptime(
|
185
|
+
hit[field_name] = datetime.strptime(
|
186
|
+
hit[field_name], "%Y-%m-%dT%H:%M:%S.%f%z"
|
187
|
+
)
|
188
188
|
|
189
189
|
return hits
|
190
190
|
|
diracx/db/sql/jobs/db.py
CHANGED
@@ -388,7 +388,7 @@ class JobDB(BaseSQLDB):
|
|
388
388
|
classAdJob.insertAttributeInt("JobID", job_id)
|
389
389
|
|
390
390
|
try:
|
391
|
-
result = self._checkAndPrepareJob(
|
391
|
+
result = await self._checkAndPrepareJob(
|
392
392
|
job_id,
|
393
393
|
classAdJob,
|
394
394
|
classAdReq,
|
@@ -421,11 +421,9 @@ class JobDB(BaseSQLDB):
|
|
421
421
|
|
422
422
|
jobAttrs["ApplicationStatus"] = "Unknown"
|
423
423
|
|
424
|
-
jobAttrs["
|
424
|
+
jobAttrs["LastUpdateTime"] = datetime.now(tz=timezone.utc)
|
425
425
|
|
426
|
-
jobAttrs["
|
427
|
-
|
428
|
-
jobAttrs["RescheduleTime"] = str(datetime.utcnow())
|
426
|
+
jobAttrs["RescheduleTime"] = datetime.now(tz=timezone.utc)
|
429
427
|
|
430
428
|
reqJDL = classAdReq.asJDL()
|
431
429
|
classAdJob.insertAttributeInt("JobRequirements", reqJDL)
|
@@ -435,9 +433,9 @@ class JobDB(BaseSQLDB):
|
|
435
433
|
# Replace the JobID placeholder if any
|
436
434
|
jobJDL = jobJDL.replace("%j", str(job_id))
|
437
435
|
|
438
|
-
result = self.setJobJDL(job_id, jobJDL)
|
436
|
+
result = await self.setJobJDL(job_id, jobJDL)
|
439
437
|
|
440
|
-
result = self.setJobAttributes(job_id, jobAttrs)
|
438
|
+
result = await self.setJobAttributes(job_id, jobAttrs)
|
441
439
|
|
442
440
|
retVal["InputData"] = classAdJob.lookupAttribute("InputData")
|
443
441
|
retVal["RescheduleCounter"] = reschedule_counter
|
@@ -669,9 +667,13 @@ class TaskQueueDB(BaseSQLDB):
|
|
669
667
|
"""
|
670
668
|
Get the task queue info for given jobs
|
671
669
|
"""
|
672
|
-
stmt =
|
673
|
-
|
674
|
-
|
670
|
+
stmt = (
|
671
|
+
select(
|
672
|
+
TaskQueues.TQId, TaskQueues.Owner, TaskQueues.OwnerGroup, TaskQueues.VO
|
673
|
+
)
|
674
|
+
.join(JobsQueue, TaskQueues.TQId == JobsQueue.TQId)
|
675
|
+
.where(JobsQueue.JobId.in_(job_ids))
|
676
|
+
)
|
675
677
|
return set(
|
676
678
|
(int(row[0]), str(row[1]), str(row[2]), str(row[3]))
|
677
679
|
for row in (await self.conn.execute(stmt)).all()
|
diracx/db/sql/jobs/schema.py
CHANGED
@@ -60,10 +60,6 @@ class Jobs(JobDBBase):
|
|
60
60
|
)
|
61
61
|
JobType = Column("JobType", String(32), default="user")
|
62
62
|
JobGroup = Column("JobGroup", String(32), default="00000000")
|
63
|
-
JobSplitType = Column(
|
64
|
-
"JobSplitType", Enum("Single", "Master", "Subjob", "DAGNode"), default="Single"
|
65
|
-
)
|
66
|
-
MasterJobID = Column("MasterJobID", Integer, default=0)
|
67
63
|
Site = Column("Site", String(100), default="ANY")
|
68
64
|
JobName = Column("JobName", String(128), default="Unknown")
|
69
65
|
Owner = Column("Owner", String(64), default="Unknown")
|
@@ -78,17 +74,9 @@ class Jobs(JobDBBase):
|
|
78
74
|
Status = Column("Status", String(32), default="Received")
|
79
75
|
MinorStatus = Column("MinorStatus", String(128), default="Unknown")
|
80
76
|
ApplicationStatus = Column("ApplicationStatus", String(255), default="Unknown")
|
81
|
-
ApplicationNumStatus = Column("ApplicationNumStatus", Integer, default=0)
|
82
77
|
UserPriority = Column("UserPriority", Integer, default=0)
|
83
|
-
SystemPriority = Column("SystemPriority", Integer, default=0)
|
84
78
|
RescheduleCounter = Column("RescheduleCounter", Integer, default=0)
|
85
79
|
VerifiedFlag = Column("VerifiedFlag", EnumBackedBool(), default=False)
|
86
|
-
DeletedFlag = Column("DeletedFlag", EnumBackedBool(), default=False)
|
87
|
-
KilledFlag = Column("KilledFlag", EnumBackedBool(), default=False)
|
88
|
-
FailedFlag = Column("FailedFlag", EnumBackedBool(), default=False)
|
89
|
-
ISandboxReadyFlag = Column("ISandboxReadyFlag", EnumBackedBool(), default=False)
|
90
|
-
OSandboxReadyFlag = Column("OSandboxReadyFlag", EnumBackedBool(), default=False)
|
91
|
-
RetrievedFlag = Column("RetrievedFlag", EnumBackedBool(), default=False)
|
92
80
|
# TODO: Should this be True/False/"Failed"? Or True/False/Null?
|
93
81
|
AccountedFlag = Column(
|
94
82
|
"AccountedFlag", Enum("True", "False", "Failed"), default="False"
|
@@ -97,7 +85,6 @@ class Jobs(JobDBBase):
|
|
97
85
|
__table_args__ = (
|
98
86
|
Index("JobType", "JobType"),
|
99
87
|
Index("JobGroup", "JobGroup"),
|
100
|
-
Index("JobSplitType", "JobSplitType"),
|
101
88
|
Index("Site", "Site"),
|
102
89
|
Index("Owner", "Owner"),
|
103
90
|
Index("OwnerGroup", "OwnerGroup"),
|
@@ -212,7 +199,6 @@ class TaskQueues(TaskQueueDBBase):
|
|
212
199
|
__tablename__ = "tq_TaskQueues"
|
213
200
|
TQId = Column(Integer, primary_key=True)
|
214
201
|
Owner = Column(String(255), nullable=False)
|
215
|
-
OwnerDN = Column(String(255))
|
216
202
|
OwnerGroup = Column(String(32), nullable=False)
|
217
203
|
VO = Column(String(32), nullable=False)
|
218
204
|
CPUTime = Column(BigInteger, nullable=False)
|
@@ -19,7 +19,7 @@ class SandboxMetadataDB(BaseSQLDB):
|
|
19
19
|
stmt = sqlalchemy.select(sb_Owners.OwnerID).where(
|
20
20
|
sb_Owners.Owner == user.preferred_username,
|
21
21
|
sb_Owners.OwnerGroup == user.dirac_group,
|
22
|
-
|
22
|
+
sb_Owners.VO == user.vo,
|
23
23
|
)
|
24
24
|
result = await self.conn.execute(stmt)
|
25
25
|
if owner_id := result.scalar_one_or_none():
|
@@ -28,6 +28,7 @@ class SandboxMetadataDB(BaseSQLDB):
|
|
28
28
|
stmt = sqlalchemy.insert(sb_Owners).values(
|
29
29
|
Owner=user.preferred_username,
|
30
30
|
OwnerGroup=user.dirac_group,
|
31
|
+
VO=user.vo,
|
31
32
|
)
|
32
33
|
result = await self.conn.execute(stmt)
|
33
34
|
return result.lastrowid
|
@@ -4,7 +4,7 @@ diracx/db/exceptions.py,sha256=-LSkEwsvjwU7vXqx-xeLvLKInTRAhjwB7K_AKfQcIH8,41
|
|
4
4
|
diracx/db/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
5
5
|
diracx/db/os/__init__.py,sha256=IZr6z6SefrRvuC8sTC4RmB3_wwOyEt1GzpDuwSMH8O4,112
|
6
6
|
diracx/db/os/job_parameters.py,sha256=Knca19uT2G-5FI7MOFlaOAXeHn4ecPVLIH30TiwhaTw,858
|
7
|
-
diracx/db/os/utils.py,sha256=
|
7
|
+
diracx/db/os/utils.py,sha256=E_Eoo-txg7YRvPFb3KQbPYOz23Lpg5aiqe6LRjlG9GA,9137
|
8
8
|
diracx/db/sql/__init__.py,sha256=R6tk5lo1EHbt8joGDesesYHcc1swIq9T4AaSixhh7lA,252
|
9
9
|
diracx/db/sql/utils.py,sha256=BuXjIuXN-_v8YkCoMoMhw2tHVUqG6lTBx-e4VEYWE8o,7857
|
10
10
|
diracx/db/sql/auth/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -14,14 +14,14 @@ diracx/db/sql/dummy/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSu
|
|
14
14
|
diracx/db/sql/dummy/db.py,sha256=5PIPv6aKY7CGIwmvnGKowjVr9ZQWpbjFSd2PIX7YOUw,1627
|
15
15
|
diracx/db/sql/dummy/schema.py,sha256=uEkGDNVZbmJecytkHY1CO-M1MiKxe5w1_h0joJMPC9E,680
|
16
16
|
diracx/db/sql/jobs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
17
|
-
diracx/db/sql/jobs/db.py,sha256
|
18
|
-
diracx/db/sql/jobs/schema.py,sha256=
|
17
|
+
diracx/db/sql/jobs/db.py,sha256=Y_2mx5kPTeuz6nxXVwGLzTssKsIH6nfnoTvWvilSgxA,29876
|
18
|
+
diracx/db/sql/jobs/schema.py,sha256=YkxIdjTkvLlEZ9IQt86nj80eMvOPbcrfk9aisjmNpqY,9275
|
19
19
|
diracx/db/sql/jobs/status_utility.py,sha256=0kAt623nh1O5wgsgktctdCmHEynO1nU0vn-7zakNeOA,10525
|
20
20
|
diracx/db/sql/sandbox_metadata/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
21
|
-
diracx/db/sql/sandbox_metadata/db.py,sha256=
|
22
|
-
diracx/db/sql/sandbox_metadata/schema.py,sha256=
|
23
|
-
diracx_db-0.0.
|
24
|
-
diracx_db-0.0.
|
25
|
-
diracx_db-0.0.
|
26
|
-
diracx_db-0.0.
|
27
|
-
diracx_db-0.0.
|
21
|
+
diracx/db/sql/sandbox_metadata/db.py,sha256=HjlbnsT4cRMuFAcTL_sK3IqCehA7zISzR_d7xIGZoNk,3498
|
22
|
+
diracx/db/sql/sandbox_metadata/schema.py,sha256=rngYYkJxBhjETBHGLD1CTipDGe44mRYR0wdaFoAJwp0,1400
|
23
|
+
diracx_db-0.0.1a10.dist-info/METADATA,sha256=gtBaCSlMCQtrRSTCG4__GHyJQwoAb1PHBnXuimpiQHI,681
|
24
|
+
diracx_db-0.0.1a10.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
25
|
+
diracx_db-0.0.1a10.dist-info/entry_points.txt,sha256=xEFGu_zgmPgQPlUeFtdahQfQIboJ1ugFOK8eMio9gtw,271
|
26
|
+
diracx_db-0.0.1a10.dist-info/top_level.txt,sha256=vJx10tdRlBX3rF2Psgk5jlwVGZNcL3m_7iQWwgPXt-U,7
|
27
|
+
diracx_db-0.0.1a10.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|