Repository navigation
v2.3.0
chapkit mlproject run now serves any existing MLproject as a full chapkit service that chap-core can use: the model contract from the MLproject, typed user options validated the way chap-core validates them, and MLproject adapters. Point it at a YAML file and go; nothing is written to the project.
Added
chapkit mlproject runserves the fullMLServiceInfocontract from the MLproject (CLIM-1340, #133):- all of
meta_data: display name, description, author, author note, assessed status, contact email, organization, logo, citation and documentation URL; version,required_covariates,allow_free_additional_continuous_covariatesandrequires_geo;supported_period_type, with chap-core'sweek/monthspellings understood and a missing value meaningany;- the forecast horizon bounds under every spelling chap-core accepts (
min_prediction_periods,min_prediction_lengthand camelCase).
- all of
target(defaultdisease_cases) andhpo_search_spacefields onMLServiceInfo.user_optionsare read as JSON Schema, as chap-core reads them:- each MLproject gets a typed config class (
enum, arrays withitems, unions such as[array, integer],anyOf, nullable types, bounds), so OpenAPI and the console's config form show the real types; - every value is also validated with
jsonschema, the validator chap-core uses, so configs are accepted and rejected exactly as chap-core would, includingoneOf,allOf,not,constandpattern.
- each MLproject gets a typed config class (
ShellModelRunner(adapters=...)applies MLprojectadapterswith chap-core's rules: copy a column under a new name, or deriveyear/month/weekfromtime_period.mlproject runpasses the MLproject's adapters, so models such as ewars find columns likeCasesandE.chapkit mlproject runaccepts a path to the MLproject file as well as its directory, and stops with a clear message when the host or port cannot be bound.
Changed
chapkit mlproject migratereads the contract through the same code asrun. The generatedmain.py:- maps
week/monthcorrectly, and a missing period type becomesanyinstead ofmonthly; - carries the horizon bounds,
target,hpo_search_spaceandadapters; - drops a malformed contact email with a warning, instead of producing a
main.pythat fails to import; - keeps the default
prediction_periodsinside the declared horizon bounds.
- maps
- Migrated projects that use
adapters,targetorhpo_search_spacerequirechapkit>=2.3.0. - A user option without a
typeaccepts any value, as in JSON Schema and chap-core. It was previously coerced to a string. - Values that would not validate (a non-URL logo, a malformed email, an unknown assessed status or horizon bound, a default that does not fit its type) are printed as warnings at startup instead of stopping existing MLprojects from running.
- New runtime dependency:
jsonschema(which brings inreferencing,rpds-pyandattrs). - Dependency updates: Python and frontend dependency groups. (#131, #132)
Fixed
- chap-core rejected services started with
chapkit mlproject run, because they served a plainServiceInfowithoutmodel_metadataandperiod_type. They now serve a validMLServiceInfo. - Array user options were turned into strings in
config.yml; for example, ewarsn_lagsreached scripts as"[3]". They are now real lists.
Upgrading
- Model services: bump to
chapkit>=2.3.0,<3. No code changes needed. - chap-core 2.2.0 and later ignore the new
targetandhpo_search_spaceinfo fields until its schema reads them. - Re-running
chapkit mlproject migrateon an MLproject withoutsupported_period_typenow generatesPeriodType.any. Set it explicitly if the model only handles monthly or weekly data.
Known issue
chapkit mlproject rundoes not yet register itself with chap-core whenSERVICEKIT_ORCHESTRATOR_URLis set. Generated projects (chapkit init,chapkit mlproject migrate) are not affected. A fix is planned for 2.3.1.
What's Changed
- chore: bump version to 2.3.0.dev0 by @mortenoh in #130
- feat: serve the full MLproject contract, typed options and adapters from chapkit mlproject run (CLIM-1340) by @mortenoh in #133
- chore(deps): bump the python-dependencies group across 1 directory with 3 updates by @dependabot[bot] in #131
- chore(deps): bump the frontend-dependencies group in /frontend with 7 updates by @dependabot[bot] in #132
- chore: release 2.3.0 (CLIM-1340) by @mortenoh in #134
Full Changelog: v2.2.0...v2.3.0