flux-batch 0.0.11__tar.gz → 0.0.12__tar.gz
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.
- {flux_batch-0.0.11/flux_batch.egg-info → flux_batch-0.0.12}/PKG-INFO +8 -7
- {flux_batch-0.0.11 → flux_batch-0.0.12}/README.md +7 -6
- {flux_batch-0.0.11 → flux_batch-0.0.12}/flux_batch/service/scribe/__main__.py +2 -0
- {flux_batch-0.0.11 → flux_batch-0.0.12}/flux_batch/service/scribe/database.py +1 -0
- {flux_batch-0.0.11 → flux_batch-0.0.12}/flux_batch/service/scribe/models.py +5 -1
- {flux_batch-0.0.11 → flux_batch-0.0.12}/flux_batch/version.py +1 -1
- {flux_batch-0.0.11 → flux_batch-0.0.12/flux_batch.egg-info}/PKG-INFO +8 -7
- {flux_batch-0.0.11 → flux_batch-0.0.12}/LICENSE +0 -0
- {flux_batch-0.0.11 → flux_batch-0.0.12}/MANIFEST.in +0 -0
- {flux_batch-0.0.11 → flux_batch-0.0.12}/NOTICE +0 -0
- {flux_batch-0.0.11 → flux_batch-0.0.12}/flux_batch/__init__.py +0 -0
- {flux_batch-0.0.11 → flux_batch-0.0.12}/flux_batch/jobspec.py +0 -0
- {flux_batch-0.0.11 → flux_batch-0.0.12}/flux_batch/logger/__init__.py +0 -0
- {flux_batch-0.0.11 → flux_batch-0.0.12}/flux_batch/logger/generate.py +0 -0
- {flux_batch-0.0.11 → flux_batch-0.0.12}/flux_batch/logger/logger.py +0 -0
- {flux_batch-0.0.11 → flux_batch-0.0.12}/flux_batch/models.py +0 -0
- {flux_batch-0.0.11 → flux_batch-0.0.12}/flux_batch/script/__init__.py +0 -0
- {flux_batch-0.0.11 → flux_batch-0.0.12}/flux_batch/script/save_logs.sh +0 -0
- {flux_batch-0.0.11 → flux_batch-0.0.12}/flux_batch/service/__init__.py +0 -0
- {flux_batch-0.0.11 → flux_batch-0.0.12}/flux_batch/service/scribe/__init__.py +0 -0
- {flux_batch-0.0.11 → flux_batch-0.0.12}/flux_batch/service/scribe/template.py +0 -0
- {flux_batch-0.0.11 → flux_batch-0.0.12}/flux_batch/submit.py +0 -0
- {flux_batch-0.0.11 → flux_batch-0.0.12}/flux_batch/utils/__init__.py +0 -0
- {flux_batch-0.0.11 → flux_batch-0.0.12}/flux_batch/utils/fileio.py +0 -0
- {flux_batch-0.0.11 → flux_batch-0.0.12}/flux_batch/utils/text.py +0 -0
- {flux_batch-0.0.11 → flux_batch-0.0.12}/flux_batch/utils/timer.py +0 -0
- {flux_batch-0.0.11 → flux_batch-0.0.12}/flux_batch.egg-info/SOURCES.txt +0 -0
- {flux_batch-0.0.11 → flux_batch-0.0.12}/flux_batch.egg-info/dependency_links.txt +0 -0
- {flux_batch-0.0.11 → flux_batch-0.0.12}/flux_batch.egg-info/entry_points.txt +0 -0
- {flux_batch-0.0.11 → flux_batch-0.0.12}/flux_batch.egg-info/not-zip-safe +0 -0
- {flux_batch-0.0.11 → flux_batch-0.0.12}/flux_batch.egg-info/requires.txt +0 -0
- {flux_batch-0.0.11 → flux_batch-0.0.12}/flux_batch.egg-info/top_level.txt +0 -0
- {flux_batch-0.0.11 → flux_batch-0.0.12}/pyproject.toml +0 -0
- {flux_batch-0.0.11 → flux_batch-0.0.12}/setup.cfg +0 -0
- {flux_batch-0.0.11 → flux_batch-0.0.12}/setup.py +0 -0
- {flux_batch-0.0.11 → flux_batch-0.0.12}/tests/test_flux_batch.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: flux-batch
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.12
|
|
4
4
|
Summary: Python SDK for flux batch jobs and services
|
|
5
5
|
Home-page: https://github.com/converged-computing/flux-batch
|
|
6
6
|
Author: Vanessa Sochat
|
|
@@ -135,7 +135,7 @@ batch.add_job(["sleep", "5"])
|
|
|
135
135
|
batch.add_job(["echo", "Job 2 finished"])
|
|
136
136
|
|
|
137
137
|
# Wrap it up into a jobspec
|
|
138
|
-
|
|
138
|
+
spec = flux_batch.BatchJobspecV1.from_jobs(
|
|
139
139
|
batch,
|
|
140
140
|
nodes=1,
|
|
141
141
|
nslots=1,
|
|
@@ -146,14 +146,15 @@ jobspec = flux_batch.BatchJobspecV1.from_jobs(
|
|
|
146
146
|
)
|
|
147
147
|
|
|
148
148
|
# Add a prolog and epilog
|
|
149
|
-
|
|
150
|
-
|
|
149
|
+
spec.add_prolog("echo 'Batch Wrapper Starting'")
|
|
150
|
+
spec.add_epilog("echo 'Batch Wrapper Finished'")
|
|
151
151
|
|
|
152
152
|
# Add a service (this assumes user level that exists)
|
|
153
|
-
|
|
153
|
+
spec.add_service("flux-scribe")
|
|
154
154
|
|
|
155
|
-
# Preview it
|
|
156
|
-
print(flux_batch.submit(handle,
|
|
155
|
+
# Preview it (batch wrapper), or generate the jobspec (json)
|
|
156
|
+
print(flux_batch.submit(handle, spec, dry_run=True))
|
|
157
|
+
jobspec = flux_batch.jobspec(spec)
|
|
157
158
|
|
|
158
159
|
# Submit that bad boi.
|
|
159
160
|
jobid = flux_batch.submit(handle, jobspec)
|
|
@@ -101,7 +101,7 @@ batch.add_job(["sleep", "5"])
|
|
|
101
101
|
batch.add_job(["echo", "Job 2 finished"])
|
|
102
102
|
|
|
103
103
|
# Wrap it up into a jobspec
|
|
104
|
-
|
|
104
|
+
spec = flux_batch.BatchJobspecV1.from_jobs(
|
|
105
105
|
batch,
|
|
106
106
|
nodes=1,
|
|
107
107
|
nslots=1,
|
|
@@ -112,14 +112,15 @@ jobspec = flux_batch.BatchJobspecV1.from_jobs(
|
|
|
112
112
|
)
|
|
113
113
|
|
|
114
114
|
# Add a prolog and epilog
|
|
115
|
-
|
|
116
|
-
|
|
115
|
+
spec.add_prolog("echo 'Batch Wrapper Starting'")
|
|
116
|
+
spec.add_epilog("echo 'Batch Wrapper Finished'")
|
|
117
117
|
|
|
118
118
|
# Add a service (this assumes user level that exists)
|
|
119
|
-
|
|
119
|
+
spec.add_service("flux-scribe")
|
|
120
120
|
|
|
121
|
-
# Preview it
|
|
122
|
-
print(flux_batch.submit(handle,
|
|
121
|
+
# Preview it (batch wrapper), or generate the jobspec (json)
|
|
122
|
+
print(flux_batch.submit(handle, spec, dry_run=True))
|
|
123
|
+
jobspec = flux_batch.jobspec(spec)
|
|
123
124
|
|
|
124
125
|
# Submit that bad boi.
|
|
125
126
|
jobid = flux_batch.submit(handle, jobspec)
|
|
@@ -38,6 +38,8 @@ class JournalScribe:
|
|
|
38
38
|
logger.critical(f"Failed to connect to Flux: {e}")
|
|
39
39
|
sys.exit(1)
|
|
40
40
|
|
|
41
|
+
logger.info(f"🍳 Handle: {self.handle.attr_get('local-uri')}")
|
|
42
|
+
|
|
41
43
|
# Initialize Journal Consumer
|
|
42
44
|
# This consumes the global event log for the entire instance
|
|
43
45
|
self.consumer = flux.job.JournalConsumer(self.handle)
|
|
@@ -18,6 +18,7 @@ def _record_event_internal(session, cluster: str, event: Dict[str, Any]):
|
|
|
18
18
|
data = event.get("payload", {})
|
|
19
19
|
timestamp = event.get("timestamp", time.time())
|
|
20
20
|
|
|
21
|
+
# Add the new event with all metadata
|
|
21
22
|
new_event = EventModel(
|
|
22
23
|
job_id=job_id,
|
|
23
24
|
cluster=cluster,
|
|
@@ -90,5 +90,9 @@ class EventModel(Base):
|
|
|
90
90
|
Helper to convert ORM model to public DTO
|
|
91
91
|
"""
|
|
92
92
|
return EventRecord(
|
|
93
|
-
timestamp=self.timestamp,
|
|
93
|
+
timestamp=self.timestamp,
|
|
94
|
+
event_type=self.event_type,
|
|
95
|
+
payload=self.payload,
|
|
96
|
+
cluster=self.cluster,
|
|
97
|
+
job_id=self.job_id,
|
|
94
98
|
)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: flux-batch
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.12
|
|
4
4
|
Summary: Python SDK for flux batch jobs and services
|
|
5
5
|
Home-page: https://github.com/converged-computing/flux-batch
|
|
6
6
|
Author: Vanessa Sochat
|
|
@@ -135,7 +135,7 @@ batch.add_job(["sleep", "5"])
|
|
|
135
135
|
batch.add_job(["echo", "Job 2 finished"])
|
|
136
136
|
|
|
137
137
|
# Wrap it up into a jobspec
|
|
138
|
-
|
|
138
|
+
spec = flux_batch.BatchJobspecV1.from_jobs(
|
|
139
139
|
batch,
|
|
140
140
|
nodes=1,
|
|
141
141
|
nslots=1,
|
|
@@ -146,14 +146,15 @@ jobspec = flux_batch.BatchJobspecV1.from_jobs(
|
|
|
146
146
|
)
|
|
147
147
|
|
|
148
148
|
# Add a prolog and epilog
|
|
149
|
-
|
|
150
|
-
|
|
149
|
+
spec.add_prolog("echo 'Batch Wrapper Starting'")
|
|
150
|
+
spec.add_epilog("echo 'Batch Wrapper Finished'")
|
|
151
151
|
|
|
152
152
|
# Add a service (this assumes user level that exists)
|
|
153
|
-
|
|
153
|
+
spec.add_service("flux-scribe")
|
|
154
154
|
|
|
155
|
-
# Preview it
|
|
156
|
-
print(flux_batch.submit(handle,
|
|
155
|
+
# Preview it (batch wrapper), or generate the jobspec (json)
|
|
156
|
+
print(flux_batch.submit(handle, spec, dry_run=True))
|
|
157
|
+
jobspec = flux_batch.jobspec(spec)
|
|
157
158
|
|
|
158
159
|
# Submit that bad boi.
|
|
159
160
|
jobid = flux_batch.submit(handle, jobspec)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|