@alwaysai/model-configuration-schemas v0.11.2
Overview
The interfaces for each model configuration can be found in src/model_params/. The schemas are located in src/schemas/ and are written in json-schema format using draft 2019-09. The schemas are imported into model.ts where the overall JSONSchemaType as well as the validation methods & sub-types are created. Validation methods are used to type-guard each of the model configurations, while the interfaces are used to type-guard at development time. This repository is configured as an npm package -- while under local development you can use npm install --save along with the path to this repo to use it with the device agent. Additionally, the schemas are also used in model.py to create validation function for use in python.
To Create New Schemas and Validation Methods
- Add a new model config's subschema to
src/schemas/modelParameters.jsonor create a new.jsonsubschema file. - Add a new model config's interface to
src/model_params/modelParameters.tsor create a new.tsinterface file. Note: If you create new files instead of appendingmodelParameters.*, make sure to reference the new files in bothmodelParameters.* - Import and add the new subschemas to
jschoninmodel.py, and subschemas and interfaces toajvinmodel.ts. - Add new tests to
tests/model.test.tsthat reflect changes you've made. - Generate python package to be included in edgeIQ by running
npm run build:python. Copy these files to<edgeiq_root>/edgeiq/model_configand<edgeiq_root/tools/build-trt-model/model_config. - After release, update the CLI with the latest model schema version.
More notes on the development of this repo can be found here: https://alwaysai.atlassian.net/l/c/RdjVyG1d
To Run Tests
Run npm run test:unit to run the types.test.ts file. You can add valid and invalid data structures to new instances of the test cases. They're divided in correct and incorrect structures and validated against the schemas.
Release Process
NOTE: Ensure unit tests are passing and new functionality is verified prior to release!
Release procedure
To release the package to npmjs.org follow the steps:
- publish new version: npm run publish:<major|minor|patch>
- watch the bitbucket pipeline running, if successful a new version will be created and published to npmjs.org
- to get the auto-generated commit and tags, simply pull: git pull
Pipeline is linting, unit testing and building package on:
- Node.js: 16.x, 18.x, 20.x
1 year ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago