shareddata 6.99.0__tar.gz → 6.100.0__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.
Potentially problematic release.
This version of shareddata might be problematic. Click here for more details.
- {shareddata-6.99.0/src/shareddata.egg-info → shareddata-6.100.0}/PKG-INFO +1 -1
- {shareddata-6.99.0 → shareddata-6.100.0}/setup.py +1 -1
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/API/apidocs.yml +1 -1
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/API/routes/operations.py +33 -0
- shareddata-6.100.0/src/SharedData/Routines/ClusterPowerGovernor.py +402 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/SharedData.py +4 -2
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/SharedNumpy.py +72 -8
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Table.py +79 -6
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/TableDisk.py +6 -11
- shareddata-6.100.0/src/SharedData/TableDocuments.py +310 -0
- shareddata-6.100.0/src/SharedData/TableLayout.py +76 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/TableProtocol.py +6 -2
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/TableRead.py +42 -3
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/TableRewrite.py +28 -4
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Utils.py +149 -1
- shareddata-6.100.0/src/SharedData/fleet_power.py +290 -0
- {shareddata-6.99.0 → shareddata-6.100.0/src/shareddata.egg-info}/PKG-INFO +1 -1
- {shareddata-6.99.0 → shareddata-6.100.0}/src/shareddata.egg-info/SOURCES.txt +4 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/LICENSE +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/MANIFEST.in +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/README.md +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/pyproject.toml +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/setup.cfg +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/API/ServerGunicorn.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/API/ServerWaitress.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/API/__init__.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/API/access_log.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/API/apidocs-dark.css +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/API/auth.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/API/constants.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/API/download_paths.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/API/download_slots.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/API/install/worker.ps1 +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/API/install/worker.sh +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/API/listcache.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/API/routes/__init__.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/API/routes/cache.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/API/routes/collections.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/API/routes/data.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/API/routes/downloads.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/API/routes/metadata.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/API/routes/schedules.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/API/routes/sqlite.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/API/routes/system.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/API/routes/tables.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/API/routes/timeseries.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/API/routes/web_routes.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/API/routes/workers.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/API/utils.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Auth/__init__.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Auth/bootstrap.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Auth/migrate.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Auth/store.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Auth/workers.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/CacheRedis.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Charts/Server.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Charts/__init__.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Charts/auth.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Charts/cache.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Charts/errors.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Charts/index.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Charts/lifecycle.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Charts/memory.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Charts/periods.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Charts/schedule.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Charts/series.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Charts/service.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Charts/templates/tradingview.html +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Charts/tradingview.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/CollectionMongoDB.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/ConsensusGraph.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/DataAPI/__init__.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/DataAPI/catalog.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/DataAPI/config.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/DataAPI/errors.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/DataAPI/indexes.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/DataAPI/readers.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/DataAPI/resolve.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/DataAPI/service.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Database.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Defaults.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/IO/AWSEC2.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/IO/AWSS3.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/IO/AutoDocstrings.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/IO/ClientAPI.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/IO/ClientSocket.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/IO/ClientWebSocket.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/IO/LogHandlerAPI.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/IO/LogReader.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/IO/MongoDBClient.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/IO/SaveTables.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/IO/ServerSocket.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/IO/ServerWebSocket.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/IO/StreamsCache.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/IO/StreamsPersist.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/IO/SyncTable.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/IO/TunnelWebSocket.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/IO/__init__.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/KnowledgeBase.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/KnowledgeContract.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/KnowledgeEvaluation.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/KnowledgeExperiment.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/KnowledgeGraph.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/KnowledgeLookup.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/KnowledgeMarket.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/KnowledgeOntology.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/KnowledgeResearch.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/KnowledgeScenario.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/KnowledgeXBRL.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Listing.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/LockWaiters.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Logger.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/MCP/__init__.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/MCP/__main__.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/MCP/client.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/MCP/server.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Metadata.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/MultiProc.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/OpenFIGI.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Redaction.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/ResearchMCP.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Routines/ArchiveOldCollections.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Routines/BatchJob.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Routines/ContainerHealth.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Routines/HealthProbe.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Routines/JobStore.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Routines/PackageRoutine.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Routines/RoutineCommand.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Routines/RoutineOrigin.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Routines/Schedule.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Routines/ScheduleMirror.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Routines/ScheduleMonitor.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Routines/ScheduleStore.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Routines/Scheduler.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Routines/UpdateActiveJobs.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Routines/Worker.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Routines/WorkerBootstrap.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Routines/WorkerLib.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Routines/WorkerPool.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Routines/__init__.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/SQLite.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/StreamKafka.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Symbol.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/TableIndex.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/TableIndexJitFunctions.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/TableIndexJitFunctionsManual.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/TableIndexJitGenerate.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/TableIndexJitHash.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/TableIndexJitLoc.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/TableVector.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/TimeSeriesDisk.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/TimeseriesContainer.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Users.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Web/ADDING_A_PAGE.md +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Web/__init__.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Web/activity_logger.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Web/app.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Web/assets/dashAgGridComponentFunctions.js +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Web/assets/dashAgGridFunctions.js +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Web/assets/google_logo.png +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Web/assets/kafka_keys.js +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Web/assets/logs.css +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Web/assets/sched.css +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Web/assets/styles.css +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Web/auth.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Web/backends.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Web/config.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Web/containers.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Web/identity.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Web/kafka_view.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Web/mongo_view.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Web/proc.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Web/redis_view.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Web/route_health.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Web/route_registry.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Web/sched.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Web/schedule_editor.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Web/server.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Web/services.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Web/shell.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Web/standalone.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Web/static/account.js +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Web/static/custom.css +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Web/static/favicon.ico +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Web/static/favicon.png +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Web/static/logo.png +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Web/static/logo_96x96.png +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Web/static/shareddata-mark.svg +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Web/static/shell.css +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Web/static/shell.js +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Web/static/standalone.css +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Web/static/standalone.js +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Web/suggest.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Web/templates/account.html +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Web/templates/base.html +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Web/templates/claim.html +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Web/templates/claim_done.html +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Web/templates/dash.html +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Web/templates/index.html +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Web/templates/login.html +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Web/templates/login_2fa.html +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Web/templates/partials/navbar.html +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Web/templates/partials/scripts.html +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Web/templates/recovery_codes.html +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Web/templates/shell.html +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Web/templates/standalone.html +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Web/twofactor.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Web/utils.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/Web/workerpool.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/__init__.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/build_info.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/fleet.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/preflight.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/private_files.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/release_backup.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/server.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/services.py +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/SharedData/sharedmutexwin.pyd +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/shareddata.egg-info/dependency_links.txt +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/shareddata.egg-info/entry_points.txt +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/shareddata.egg-info/requires.txt +0 -0
- {shareddata-6.99.0 → shareddata-6.100.0}/src/shareddata.egg-info/top_level.txt +0 -0
|
@@ -66,7 +66,7 @@ test_requires = [
|
|
|
66
66
|
|
|
67
67
|
setup(
|
|
68
68
|
name='shareddata',
|
|
69
|
-
version='6.
|
|
69
|
+
version='6.100.0',
|
|
70
70
|
description='Memory-mapped record and time-series store with an HTTP API and a distributed scheduler',
|
|
71
71
|
author='shareddata',
|
|
72
72
|
author_email='admin@shareddata.net',
|
|
@@ -79,4 +79,37 @@ def init_operations_routes(shdata, authenticate_fn):
|
|
|
79
79
|
args = request.args
|
|
80
80
|
return jsonify(sched.jobs_groups(shdata, by=args.get('by') or 'time', limit=int(args.get('limit', sched.GROUPS_SHOWN)), **_filters(args)))
|
|
81
81
|
|
|
82
|
+
@bp.get('/fleet/power')
|
|
83
|
+
@master_only
|
|
84
|
+
def fleet_power_status():
|
|
85
|
+
"""Hardware power status, online states, and active demand leases across the fleet."""
|
|
86
|
+
from SharedData.fleet_power import get_fleet_power_status
|
|
87
|
+
from SharedData.Routines.ClusterPowerGovernor import LeaseRegistry
|
|
88
|
+
reg = LeaseRegistry()
|
|
89
|
+
demanded, leases = reg.get_active_demanded_servers()
|
|
90
|
+
return jsonify(hosts=get_fleet_power_status(), demanded_hosts=sorted(list(demanded)), active_leases=leases)
|
|
91
|
+
|
|
92
|
+
@bp.post('/fleet/power/demand')
|
|
93
|
+
@master_only
|
|
94
|
+
def fleet_power_demand():
|
|
95
|
+
"""Register, renew, or release a renewable demand lease for compute nodes."""
|
|
96
|
+
from SharedData.Routines.ClusterPowerGovernor import LeaseRegistry
|
|
97
|
+
body = request.get_json(silent=True) or {}
|
|
98
|
+
lease_id = body.get('lease_id')
|
|
99
|
+
if not lease_id:
|
|
100
|
+
raise ValueError('lease_id is required')
|
|
101
|
+
action = body.get('action', 'acquire').lower()
|
|
102
|
+
reg = LeaseRegistry()
|
|
103
|
+
if action == 'release':
|
|
104
|
+
released = reg.release(lease_id)
|
|
105
|
+
return jsonify(status='released' if released else 'not_found', lease_id=lease_id)
|
|
106
|
+
|
|
107
|
+
caller = body.get('caller', 'unknown')
|
|
108
|
+
servers = body.get('servers', [])
|
|
109
|
+
ttl_seconds = int(body.get('ttl_seconds', 300))
|
|
110
|
+
reason = body.get('reason', '')
|
|
111
|
+
lease = reg.acquire_or_renew(lease_id, caller, servers, ttl_seconds, reason)
|
|
112
|
+
return jsonify(status='accepted', lease=lease)
|
|
113
|
+
|
|
114
|
+
|
|
82
115
|
return bp
|
|
@@ -0,0 +1,402 @@
|
|
|
1
|
+
"""Cluster Power Governor routine for dynamic compute fleet management.
|
|
2
|
+
|
|
3
|
+
Manages automated wake and power-off for the non-core hosts of the fleet inventory ("managed": true)
|
|
4
|
+
while guaranteeing 100% uptime for the core baseline hosts ("protected": true); see fleet_power.inventory_path.
|
|
5
|
+
|
|
6
|
+
Implements:
|
|
7
|
+
1. Anti-flapping batch bridging (gap <= 45m between 30m recurring batch jobs).
|
|
8
|
+
2. Four-stage lifecycle: READY -> DRAINING -> STOPPING -> OFF.
|
|
9
|
+
3. Renewable demand lease registry (Inversion of Control for rtxclaw_vllm or custom workloads).
|
|
10
|
+
4. Observation mode (--mode observe) for zero-risk dry-run monitoring.
|
|
11
|
+
5. Control plane quorum fail-closed protection.
|
|
12
|
+
"""
|
|
13
|
+
import argparse
|
|
14
|
+
import json
|
|
15
|
+
import logging
|
|
16
|
+
import os
|
|
17
|
+
import sys
|
|
18
|
+
import time
|
|
19
|
+
from datetime import datetime, timezone
|
|
20
|
+
from pathlib import Path
|
|
21
|
+
from typing import Dict, List, Optional, Set, Tuple
|
|
22
|
+
|
|
23
|
+
import pytz
|
|
24
|
+
from tzlocal import get_localzone
|
|
25
|
+
|
|
26
|
+
local_tz = pytz.timezone(str(get_localzone()))
|
|
27
|
+
|
|
28
|
+
# PROPRIETARY LIBS
|
|
29
|
+
from SharedData.fleet_power import (
|
|
30
|
+
PROTECTED_BASELINE,
|
|
31
|
+
INVENTORY,
|
|
32
|
+
STATIC_HOST_INVENTORY,
|
|
33
|
+
get_fleet_power_status,
|
|
34
|
+
is_host_online,
|
|
35
|
+
is_protected_baseline,
|
|
36
|
+
normalize_hostname,
|
|
37
|
+
poweroff_host,
|
|
38
|
+
wake_host,
|
|
39
|
+
)
|
|
40
|
+
from SharedData.Logger import Logger
|
|
41
|
+
try:
|
|
42
|
+
if Logger.log is None:
|
|
43
|
+
Logger.connect("SharedData.Routines.ClusterPowerGovernor")
|
|
44
|
+
log = Logger.log
|
|
45
|
+
except Exception:
|
|
46
|
+
import logging
|
|
47
|
+
log = logging.getLogger("SharedData.Routines.ClusterPowerGovernor")
|
|
48
|
+
from SharedData.Routines import ScheduleStore
|
|
49
|
+
from SharedData.Routines.Schedule import Schedule
|
|
50
|
+
|
|
51
|
+
# Defaults and Constants
|
|
52
|
+
LEAD_TIME_SECONDS = 20 * 60 # Wake 20m before scheduled batch job
|
|
53
|
+
COOLDOWN_SECONDS = 20 * 60 # Wait 20m of silence post-job before powering off
|
|
54
|
+
MAX_BRIDGE_GAP_SECONDS = 45 * 60 # Bridge gaps <= 45m between recurring batch jobs
|
|
55
|
+
MIN_USABLE_OFF_SECONDS = 15 * 60 # Usable off duration D must be >= 15m to justify shutdown
|
|
56
|
+
ESTIMATED_READY_SECONDS = 85 # Boot & model warmup latency
|
|
57
|
+
ESTIMATED_SHUTDOWN_SECONDS = 30 # ACPI shutdown latency
|
|
58
|
+
|
|
59
|
+
# Dynamic non-core compute servers managed by governor (inventory "managed": true)
|
|
60
|
+
MANAGED_COMPUTE_SERVERS: List[str] = [
|
|
61
|
+
name for name, info in STATIC_HOST_INVENTORY.items() if info.get("managed")]
|
|
62
|
+
# Permanent baseline, always online (inventory "protected": true)
|
|
63
|
+
BASELINE_SERVERS: Set[str] = {
|
|
64
|
+
name for name, info in STATIC_HOST_INVENTORY.items() if info.get("protected")}
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
class LeaseRegistry:
|
|
68
|
+
"""Manages renewable demand leases in DATABASE_FOLDER/master/power_leases.json."""
|
|
69
|
+
|
|
70
|
+
def __init__(self, db_folder: Optional[str] = None):
|
|
71
|
+
self.db_folder = db_folder or os.environ["DATABASE_FOLDER"]
|
|
72
|
+
self.leases_file = Path(self.db_folder) / "master" / "power_leases.json"
|
|
73
|
+
self._ensure_dir()
|
|
74
|
+
|
|
75
|
+
def _ensure_dir(self):
|
|
76
|
+
try:
|
|
77
|
+
self.leases_file.parent.mkdir(parents=True, exist_ok=True)
|
|
78
|
+
except Exception as e:
|
|
79
|
+
log.warning(f"Could not create master lease folder: {e}")
|
|
80
|
+
|
|
81
|
+
def load_leases(self) -> Dict[str, dict]:
|
|
82
|
+
if not self.leases_file.exists():
|
|
83
|
+
return {}
|
|
84
|
+
try:
|
|
85
|
+
with open(self.leases_file, "r") as f:
|
|
86
|
+
return json.load(f)
|
|
87
|
+
except Exception as e:
|
|
88
|
+
log.error(f"Error reading power leases from {self.leases_file}: {e}")
|
|
89
|
+
return {}
|
|
90
|
+
|
|
91
|
+
def save_leases(self, leases: Dict[str, dict]):
|
|
92
|
+
try:
|
|
93
|
+
temp_file = self.leases_file.with_suffix(".tmp")
|
|
94
|
+
with open(temp_file, "w") as f:
|
|
95
|
+
json.dump(leases, f, indent=2)
|
|
96
|
+
temp_file.replace(self.leases_file)
|
|
97
|
+
except Exception as e:
|
|
98
|
+
log.error(f"Error saving power leases to {self.leases_file}: {e}")
|
|
99
|
+
|
|
100
|
+
def acquire_or_renew(self, lease_id: str, caller: str, servers: List[str], ttl_seconds: int, reason: str = "") -> dict:
|
|
101
|
+
leases = self.load_leases()
|
|
102
|
+
now = time.time()
|
|
103
|
+
canonical_servers = [normalize_hostname(s) for s in servers]
|
|
104
|
+
expires_at = now + ttl_seconds
|
|
105
|
+
|
|
106
|
+
leases[lease_id] = {
|
|
107
|
+
"lease_id": lease_id,
|
|
108
|
+
"caller": caller,
|
|
109
|
+
"servers": canonical_servers,
|
|
110
|
+
"created_at": leases.get(lease_id, {}).get("created_at", now),
|
|
111
|
+
"updated_at": now,
|
|
112
|
+
"expires_at": expires_at,
|
|
113
|
+
"ttl_seconds": ttl_seconds,
|
|
114
|
+
"reason": reason,
|
|
115
|
+
}
|
|
116
|
+
self.save_leases(leases)
|
|
117
|
+
return leases[lease_id]
|
|
118
|
+
|
|
119
|
+
def release(self, lease_id: str) -> bool:
|
|
120
|
+
leases = self.load_leases()
|
|
121
|
+
if lease_id in leases:
|
|
122
|
+
del leases[lease_id]
|
|
123
|
+
self.save_leases(leases)
|
|
124
|
+
return True
|
|
125
|
+
return False
|
|
126
|
+
|
|
127
|
+
def get_active_demanded_servers(self) -> Tuple[Set[str], Dict[str, dict]]:
|
|
128
|
+
leases = self.load_leases()
|
|
129
|
+
now = time.time()
|
|
130
|
+
active_leases = {}
|
|
131
|
+
demanded_servers = set()
|
|
132
|
+
|
|
133
|
+
for lid, lease in list(leases.items()):
|
|
134
|
+
if lease.get("expires_at", 0) > now:
|
|
135
|
+
active_leases[lid] = lease
|
|
136
|
+
for s in lease.get("servers", []):
|
|
137
|
+
demanded_servers.add(normalize_hostname(s))
|
|
138
|
+
else:
|
|
139
|
+
# Expired lease
|
|
140
|
+
pass
|
|
141
|
+
|
|
142
|
+
return demanded_servers, active_leases
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
class ClusterPowerGovernor:
|
|
146
|
+
"""Core governor evaluating schedules, leases, and hardware state machines."""
|
|
147
|
+
|
|
148
|
+
def __init__(self, mode: str = "observe"):
|
|
149
|
+
self.mode = mode.lower() # 'observe' (dry-run) or 'control' (active power actuation)
|
|
150
|
+
self.lease_registry = LeaseRegistry()
|
|
151
|
+
self.state_file = Path(self.lease_registry.db_folder) / "master" / "power_state.json"
|
|
152
|
+
|
|
153
|
+
# State tracking: {canonical_host: {"state": "READY|DRAINING|STOPPING|OFF", "last_job_finish": ts, "drain_start": ts}}
|
|
154
|
+
self.node_states: Dict[str, dict] = self._load_node_states()
|
|
155
|
+
|
|
156
|
+
def _load_node_states(self) -> Dict[str, dict]:
|
|
157
|
+
if self.state_file.exists():
|
|
158
|
+
try:
|
|
159
|
+
with open(self.state_file, "r") as f:
|
|
160
|
+
return json.load(f)
|
|
161
|
+
except Exception:
|
|
162
|
+
pass
|
|
163
|
+
return {
|
|
164
|
+
h: {"state": "READY", "last_job_finish": time.time(), "drain_start": None}
|
|
165
|
+
for h in MANAGED_COMPUTE_SERVERS
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
def _save_node_states(self):
|
|
169
|
+
try:
|
|
170
|
+
temp = self.state_file.with_suffix(".tmp")
|
|
171
|
+
with open(temp, "w") as f:
|
|
172
|
+
json.dump(self.node_states, f, indent=2)
|
|
173
|
+
temp.replace(self.state_file)
|
|
174
|
+
except Exception as e:
|
|
175
|
+
log.warning(f"Could not save power state: {e}")
|
|
176
|
+
|
|
177
|
+
def evaluate_schedules(self, now_dt: datetime) -> Tuple[Set[str], Optional[float]]:
|
|
178
|
+
"""Scan master schedules for jobs due within lead time and calculate next upcoming run."""
|
|
179
|
+
needed_servers = set()
|
|
180
|
+
next_job_time = None
|
|
181
|
+
now_ts = now_dt.timestamp()
|
|
182
|
+
|
|
183
|
+
try:
|
|
184
|
+
schedule_names = ScheduleStore.names()
|
|
185
|
+
except Exception as e:
|
|
186
|
+
log.error(f"Failed to query ScheduleStore: {e}")
|
|
187
|
+
schedule_names = list(INVENTORY.get("fallback_schedules", ["MASTER"]))
|
|
188
|
+
|
|
189
|
+
for sname in schedule_names:
|
|
190
|
+
try:
|
|
191
|
+
sched = Schedule(sname)
|
|
192
|
+
sched.load()
|
|
193
|
+
sched_data = sched.schedule
|
|
194
|
+
runtimes = sched_data.get("runtimes", [])
|
|
195
|
+
|
|
196
|
+
for rtime in runtimes:
|
|
197
|
+
if hasattr(rtime, "timestamp"):
|
|
198
|
+
r_ts = rtime.timestamp()
|
|
199
|
+
else:
|
|
200
|
+
continue
|
|
201
|
+
|
|
202
|
+
# Update earliest future job
|
|
203
|
+
if r_ts > now_ts:
|
|
204
|
+
if next_job_time is None or r_ts < next_job_time:
|
|
205
|
+
next_job_time = r_ts
|
|
206
|
+
|
|
207
|
+
# Check if due within lead time window (20m)
|
|
208
|
+
time_until = r_ts - now_ts
|
|
209
|
+
if 0 <= time_until <= LEAD_TIME_SECONDS:
|
|
210
|
+
# Inspect routines in schedule
|
|
211
|
+
routines = sched_data.get("routines", [])
|
|
212
|
+
for r in routines:
|
|
213
|
+
host_target = r.get("host") or r.get("server") or "ALL"
|
|
214
|
+
if host_target.upper() == "ALL":
|
|
215
|
+
needed_servers.update(MANAGED_COMPUTE_SERVERS)
|
|
216
|
+
else:
|
|
217
|
+
needed_servers.add(normalize_hostname(host_target))
|
|
218
|
+
except Exception as e:
|
|
219
|
+
log.warning(f"Error inspecting schedule '{sname}': {e}")
|
|
220
|
+
|
|
221
|
+
return needed_servers, next_job_time
|
|
222
|
+
|
|
223
|
+
def get_servers_needed_online(self, now_dt: Optional[datetime] = None) -> Dict[str, any]:
|
|
224
|
+
"""Core decision contract returning full online list and operational reasoning."""
|
|
225
|
+
now_dt = now_dt or datetime.now(timezone.utc)
|
|
226
|
+
now_ts = now_dt.timestamp()
|
|
227
|
+
|
|
228
|
+
# 1. Permanent Baseline (Always Online)
|
|
229
|
+
baseline_hosts = set(BASELINE_SERVERS)
|
|
230
|
+
|
|
231
|
+
# 2. Demand from Active Renewable Leases
|
|
232
|
+
demanded_hosts, active_leases = self.lease_registry.get_active_demanded_servers()
|
|
233
|
+
|
|
234
|
+
# 3. Demand from Scheduled Batch Jobs
|
|
235
|
+
scheduled_hosts, next_job_ts = self.evaluate_schedules(now_dt)
|
|
236
|
+
|
|
237
|
+
# Active dynamic requirement
|
|
238
|
+
active_dynamic = demanded_hosts.union(scheduled_hosts).intersection(set(MANAGED_COMPUTE_SERVERS))
|
|
239
|
+
|
|
240
|
+
# Union of baseline + active dynamic compute
|
|
241
|
+
all_needed = baseline_hosts.union(active_dynamic)
|
|
242
|
+
|
|
243
|
+
# 4. Anti-flapping bridging & Draining checks for each managed server
|
|
244
|
+
final_online_set = set(baseline_hosts)
|
|
245
|
+
actions_proposed = []
|
|
246
|
+
|
|
247
|
+
for host in MANAGED_COMPUTE_SERVERS:
|
|
248
|
+
host_state = self.node_states.setdefault(
|
|
249
|
+
host, {"state": "READY", "last_job_finish": now_ts, "drain_start": None}
|
|
250
|
+
)
|
|
251
|
+
is_demanded = host in active_dynamic
|
|
252
|
+
|
|
253
|
+
if is_demanded:
|
|
254
|
+
# Reset draining; host must be READY
|
|
255
|
+
host_state["state"] = "READY"
|
|
256
|
+
host_state["drain_start"] = None
|
|
257
|
+
host_state["last_job_finish"] = now_ts
|
|
258
|
+
final_online_set.add(host)
|
|
259
|
+
if not is_host_online(host, timeout=0.2):
|
|
260
|
+
actions_proposed.append({"action": "WAKE", "host": host, "reason": "demanded by schedule/lease"})
|
|
261
|
+
continue
|
|
262
|
+
|
|
263
|
+
# Host is not currently demanded. Evaluate anti-flapping gap bridging:
|
|
264
|
+
time_since_finish = now_ts - host_state.get("last_job_finish", now_ts)
|
|
265
|
+
|
|
266
|
+
# Anti-flapping check: if next batch job is scheduled soon
|
|
267
|
+
gap_to_next = (next_job_ts - now_ts) if next_job_ts else float("inf")
|
|
268
|
+
usable_off = (
|
|
269
|
+
gap_to_next - ESTIMATED_READY_SECONDS - ESTIMATED_SHUTDOWN_SECONDS
|
|
270
|
+
if next_job_ts else float("inf")
|
|
271
|
+
)
|
|
272
|
+
|
|
273
|
+
# Bridging conditions:
|
|
274
|
+
# A) Gap between jobs is <= 45 minutes
|
|
275
|
+
# B) Usable off duration D is < 15 minutes
|
|
276
|
+
# C) Cooldown timer (20 minutes) has not yet elapsed
|
|
277
|
+
should_bridge = (
|
|
278
|
+
gap_to_next <= MAX_BRIDGE_GAP_SECONDS or
|
|
279
|
+
usable_off < MIN_USABLE_OFF_SECONDS or
|
|
280
|
+
time_since_finish < COOLDOWN_SECONDS
|
|
281
|
+
)
|
|
282
|
+
|
|
283
|
+
if should_bridge:
|
|
284
|
+
# Keep host awake in READY state
|
|
285
|
+
host_state["state"] = "READY"
|
|
286
|
+
host_state["drain_start"] = None
|
|
287
|
+
final_online_set.add(host)
|
|
288
|
+
continue
|
|
289
|
+
|
|
290
|
+
# Host is idle, cooldown satisfied, and gap > 45m: enter 4-stage lifecycle
|
|
291
|
+
current_lifecycle = host_state.get("state", "READY")
|
|
292
|
+
|
|
293
|
+
if current_lifecycle == "READY":
|
|
294
|
+
# Transition READY -> DRAINING
|
|
295
|
+
host_state["state"] = "DRAINING"
|
|
296
|
+
host_state["drain_start"] = now_ts
|
|
297
|
+
final_online_set.add(host)
|
|
298
|
+
log.info(f"Host {host} entered DRAINING state (cooldown satisfied: {time_since_finish:.0f}s)")
|
|
299
|
+
|
|
300
|
+
elif current_lifecycle == "DRAINING":
|
|
301
|
+
# Verify drain window (wait 30s to allow in-flight streaming requests to finish)
|
|
302
|
+
drain_elapsed = now_ts - host_state.get("drain_start", now_ts)
|
|
303
|
+
if drain_elapsed < 30:
|
|
304
|
+
final_online_set.add(host)
|
|
305
|
+
else:
|
|
306
|
+
# Transition DRAINING -> STOPPING
|
|
307
|
+
host_state["state"] = "STOPPING"
|
|
308
|
+
actions_proposed.append({
|
|
309
|
+
"action": "POWEROFF",
|
|
310
|
+
"host": host,
|
|
311
|
+
"reason": f"idle gap={gap_to_next/60:.1f}m, cooldown={time_since_finish/60:.1f}m"
|
|
312
|
+
})
|
|
313
|
+
|
|
314
|
+
elif current_lifecycle == "STOPPING":
|
|
315
|
+
# Check if host has turned off
|
|
316
|
+
if not is_host_online(host, timeout=0.2):
|
|
317
|
+
host_state["state"] = "OFF"
|
|
318
|
+
log.info(f"Host {host} is confirmed OFF")
|
|
319
|
+
else:
|
|
320
|
+
# Host is still shutting down
|
|
321
|
+
actions_proposed.append({
|
|
322
|
+
"action": "POWEROFF_WAIT",
|
|
323
|
+
"host": host,
|
|
324
|
+
"reason": "awaiting ACPI shutdown"
|
|
325
|
+
})
|
|
326
|
+
|
|
327
|
+
self._save_node_states()
|
|
328
|
+
|
|
329
|
+
return {
|
|
330
|
+
"timestamp": now_dt.isoformat(),
|
|
331
|
+
"mode": self.mode,
|
|
332
|
+
"baseline_servers": sorted(list(baseline_hosts)),
|
|
333
|
+
"demanded_servers": sorted(list(demanded_hosts)),
|
|
334
|
+
"scheduled_servers": sorted(list(scheduled_hosts)),
|
|
335
|
+
"active_leases_count": len(active_leases),
|
|
336
|
+
"next_scheduled_job": datetime.fromtimestamp(next_job_ts, tz=local_tz).isoformat() if next_job_ts else None,
|
|
337
|
+
"servers_needed_online": sorted(list(final_online_set)),
|
|
338
|
+
"actions_proposed": actions_proposed,
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
def execute_cycle(self) -> Dict[str, any]:
|
|
342
|
+
"""Execute one evaluation cycle, actuating or logging based on mode."""
|
|
343
|
+
decision = self.get_servers_needed_online()
|
|
344
|
+
actions = decision.get("actions_proposed", [])
|
|
345
|
+
|
|
346
|
+
dry_run = (self.mode == "observe")
|
|
347
|
+
|
|
348
|
+
for act in actions:
|
|
349
|
+
action_type = act["action"]
|
|
350
|
+
host = act["host"]
|
|
351
|
+
reason = act.get("reason", "")
|
|
352
|
+
|
|
353
|
+
if action_type == "WAKE":
|
|
354
|
+
log.info(f"[{'OBSERVE' if dry_run else 'ACTUATE'}] Waking {host} ({reason})")
|
|
355
|
+
if not dry_run:
|
|
356
|
+
wake_host(host)
|
|
357
|
+
|
|
358
|
+
elif action_type == "POWEROFF":
|
|
359
|
+
log.info(f"[{'OBSERVE' if dry_run else 'ACTUATE'}] Powering off {host} ({reason})")
|
|
360
|
+
poweroff_host(host, dry_run=dry_run, reason=reason)
|
|
361
|
+
|
|
362
|
+
return decision
|
|
363
|
+
|
|
364
|
+
|
|
365
|
+
def main():
|
|
366
|
+
parser = argparse.ArgumentParser(description=__doc__)
|
|
367
|
+
parser.add_argument("--mode", choices=["observe", "control"], default="observe",
|
|
368
|
+
help="observe (dry-run) or control (active hardware power actuation)")
|
|
369
|
+
parser.add_argument("--interval", type=int, default=15, help="Loop interval in seconds (default: 15)")
|
|
370
|
+
parser.add_argument("--once", action="store_true", help="Run a single evaluation cycle and exit")
|
|
371
|
+
args = parser.parse_args()
|
|
372
|
+
|
|
373
|
+
governor = ClusterPowerGovernor(mode=args.mode)
|
|
374
|
+
log.info(f"ClusterPowerGovernor starting in mode='{args.mode}', interval={args.interval}s")
|
|
375
|
+
log.info("ROUTINE STARTED!")
|
|
376
|
+
|
|
377
|
+
if args.once:
|
|
378
|
+
decision = governor.execute_cycle()
|
|
379
|
+
print(json.dumps(decision, indent=2))
|
|
380
|
+
return 0
|
|
381
|
+
|
|
382
|
+
last_heartbeat = 0
|
|
383
|
+
while True:
|
|
384
|
+
try:
|
|
385
|
+
governor.execute_cycle()
|
|
386
|
+
now = time.time()
|
|
387
|
+
if now - last_heartbeat >= 15:
|
|
388
|
+
log.debug(f"#heartbeat#mode={args.mode}#nodes={len(governor.node_states)}")
|
|
389
|
+
last_heartbeat = now
|
|
390
|
+
time.sleep(args.interval)
|
|
391
|
+
except KeyboardInterrupt:
|
|
392
|
+
log.info("ClusterPowerGovernor stopped by user.")
|
|
393
|
+
break
|
|
394
|
+
except Exception as e:
|
|
395
|
+
log.error(f"ClusterPowerGovernor loop exception: {e}")
|
|
396
|
+
time.sleep(args.interval)
|
|
397
|
+
|
|
398
|
+
return 0
|
|
399
|
+
|
|
400
|
+
|
|
401
|
+
if __name__ == "__main__":
|
|
402
|
+
raise SystemExit(main())
|
|
@@ -275,11 +275,13 @@ class SharedData:
|
|
|
275
275
|
elif len(partitioningstr) == 8:
|
|
276
276
|
partitioning = 'daily'
|
|
277
277
|
else:
|
|
278
|
-
#
|
|
278
|
+
# Date-keyed intraday tables must be partitioned. Entity-keyed
|
|
279
|
+
# latest-state tables (e.g. Symbols/RT) have no time history.
|
|
280
|
+
# Opening an existing
|
|
279
281
|
# one (no schema given) is not creating: legacy unpartitioned tables stay readable and savable.
|
|
280
282
|
creating = (names is not None or formats is not None or value is not None
|
|
281
283
|
or is_schemaless or size is not None)
|
|
282
|
-
if hasindex and creating:
|
|
284
|
+
if hasindex and creating and 'date' in DATABASE_PKEYS[database]:
|
|
283
285
|
if period != 'D1':
|
|
284
286
|
raise Exception(f'Please specify partitioning for {period} tables')
|
|
285
287
|
|