0.11.2 • Published 10 months ago

@alwaysai/model-configuration-schemas v0.11.2

Weekly downloads
-
License
SEE LICENSE IN LI...
Repository
-
Last release
10 months ago

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

  1. Add a new model config's subschema to src/schemas/modelParameters.json or create a new .json subschema file.
  2. Add a new model config's interface to src/model_params/modelParameters.ts or create a new .ts interface file. Note: If you create new files instead of appending modelParameters.*, make sure to reference the new files in both modelParameters.*
  3. Import and add the new subschemas to jschon in model.py, and subschemas and interfaces to ajv in model.ts.
  4. Add new tests to tests/model.test.ts that reflect changes you've made.
  5. Generate python package to be included in edgeIQ by running npm run build:python. Copy these files to <edgeiq_root>/edgeiq/model_config and <edgeiq_root/tools/build-trt-model/model_config.
  6. 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
0.11.2

10 months ago

0.11.0

1 year ago

0.11.1

12 months ago

0.10.10

1 year ago

0.10.9

1 year ago

0.10.7

1 year ago

0.10.6

1 year ago

0.10.5

1 year ago

0.10.4

2 years ago

0.10.3

2 years ago

0.10.2

2 years ago

0.10.0

2 years ago

0.10.1

2 years ago

0.9.0

2 years ago

0.8.0

2 years ago

0.9.1

2 years ago

0.5.0

2 years ago

0.7.0

2 years ago

0.6.1

2 years ago

0.6.0

2 years ago

0.4.0

3 years ago

0.3.0

3 years ago

0.1.0

3 years ago

0.2.0

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago