m3flow_provider¶
Shared protocol runtime implementing
m3flow-provider/1. Every provider process is an
executable m3flow-<name> with describe / validate / execute /
diagnose subcommands emitting a single JSON document on stdout.
m3flow_provider
¶
Shared m3flow-provider/1 protocol runtime (docs/provider-protocol.md).
A provider is an executable m3flow-<name> with subcommands:
describe [config.json]
-> provider/task/engine descriptor JSON; with the optional
engine-config file, the engine probe describes the engine
that execute would use under that config
validate -> cheap request validation (no execution)
execute -> run one task; success or structured error JSON on stdout
diagnose -> describe + environment checks
All output is a single JSON document on stdout. Logs go to stderr or files.
ProviderFailure
¶
Bases: Exception
Structured, protocol-level failure.
Source code in providers/src/m3flow_provider/__init__.py
Provider
¶
Source code in providers/src/m3flow_provider/__init__.py
171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 | |
__init__(name, version, engine, tasks, checks=None, scheduling_config_keys=())
¶
name: provider name ("autopoly")
version: provider version string
engine: callable([request]) -> {"name": ..., "version": ...}; every
field joins cache keys. Callables taking one argument receive
{"config":
Source code in providers/src/m3flow_provider/__init__.py
artifact(artifact_type, files, metadata=None, data=None)
¶
A StagedArtifact: files are workdir-relative paths.
input_files(req, name)
¶
Absolute file paths of an input artifact (or list for many-inputs).
Source code in providers/src/m3flow_provider/__init__.py
quantity_value(value, dimension, name='quantity')
¶
Canonical float of a quantity given as {value, unit}, "4 nm" or a bare number (already canonical). None stays None; an unknown unit is an input error rather than a silently misread number.
Source code in providers/src/m3flow_provider/__init__.py
quantity(params, name, default=None)
¶
Canonical {value, unit} quantity parameter -> (value, unit).
find_nonfinite(value, path='$')
¶
JSON path of the first NaN/Infinity float in value, or None.
Standard JSON has no NaN/Infinity; the runtime would reject the whole response. Providers must report missing statistics explicitly instead.