From 64bcbe2e83e572f583e4c1ed90be18a056ee86a5 Mon Sep 17 00:00:00 2001 From: yuema137 <3124558229@qq.com> Date: Fri, 19 Apr 2024 18:30:28 -0500 Subject: [PATCH 1/3] add partition info in test --- tests/test_batchq.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/test_batchq.py b/tests/test_batchq.py index b99e1f3..bb75a90 100644 --- a/tests/test_batchq.py +++ b/tests/test_batchq.py @@ -11,6 +11,7 @@ def valid_job_submission() -> JobSubmission: return JobSubmission( jobstring="Hello World", + partition="xenon1t", qos="xenon1t", hours=10, container="xenonnt-development.simg", @@ -151,3 +152,5 @@ def test_submit_job_arguments(): assert ( len(missing_params) == 0 ), f"Missing parameters in submit_job: {', '.join(missing_params)}" + + \ No newline at end of file From 82a36ce65ceacd7c4c831f154dae83a257fcbbb5 Mon Sep 17 00:00:00 2001 From: yuema137 <3124558229@qq.com> Date: Fri, 19 Apr 2024 18:31:16 -0500 Subject: [PATCH 2/3] put bind in front of partition --- utilix/batchq.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/utilix/batchq.py b/utilix/batchq.py index e72afd0..dd43ae2 100644 --- a/utilix/batchq.py +++ b/utilix/batchq.py @@ -123,6 +123,10 @@ class JobSubmission(BaseModel): False, description="Exclude the loosely coupled nodes" ) log: str = Field("job.log", description="Where to store the log file of the job") + bind: List[str] = Field( + default_factory=lambda: DEFAULT_BIND, + description="Paths to add to the container. Immutable when specifying dali as partition", + ) partition: Literal[ "dali", "lgrandi", "xenon1t", "broadwl", "kicp", "caslake", "build" ] = Field("xenon1t", description="Partition to submit the job to") @@ -137,10 +141,6 @@ class JobSubmission(BaseModel): container: str = Field( "xenonnt-development.simg", description="Name of the container to activate" ) - bind: List[str] = Field( - default_factory=lambda: DEFAULT_BIND, - description="Paths to add to the container. Immutable when specifying dali as partition", - ) cpus_per_task: int = Field(1, description="CPUs requested for job") hours: Optional[float] = Field(None, description="Max hours of a job") node: Optional[str] = Field( From fa033b35a2827eefe6f482265d5e6b195b0d8867 Mon Sep 17 00:00:00 2001 From: yuema137 <3124558229@qq.com> Date: Thu, 6 Jun 2024 19:48:35 -0500 Subject: [PATCH 3/3] change read preference to secondary only --- utilix/rundb.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utilix/rundb.py b/utilix/rundb.py index 8032fca..97dc379 100644 --- a/utilix/rundb.py +++ b/utilix/rundb.py @@ -535,7 +535,7 @@ def pymongo_collection(collection='runs', **kwargs): if not database: database = uconfig.get('RunDB', 'pymongo_database') uri = uri.format(user=user, pw=pw, url=url) - c = pymongo.MongoClient(uri, readPreference='secondaryPreferred') + c = pymongo.MongoClient(uri, readPreference='secondary') DB = c[database] coll = DB[collection] # Checkout the collection we are returning and raise errors if you want