# Hive Regression Tracking

Scripting for running assets against HIVE AI API and storing their results for reporting purposes.
Assets are perpetually stored in S3 and included in each run. Subsequent runs should illustrate how results may
change as model versions change.

At a high level it typically:
- Gets the list of assets in s3://prod-hive-regression-tracking/assets/
- Iterates over the listed assets and submits them to the HIVE AI API as tasks.
- Records JSON API responses under s3://prod-hive-regression-tracking/results/<run_timestamp>/raw/
- Records flattened CSV versions of the results under s3://prod-hive-regression-tracking/results/<run_timestamp>/flattened/
- imports the flattened results into a snowflake table via a snowflake stage

## Maintaining a set of assets for testing

The assets used in the scans will be stored in s3://prod-hive-regression-tracking/assets/ and are named `<asset_final_id>.flac`

To add assets to the set, copy them from the mezzanine bucket to the tracking bucket and rename them after their asset final id. e.g.

```bash
aws s3 cp s3://prod-orcd-mezzanine-assets/2966fc20_779c_4db7_abab_59e9198a6af3.flac s3://prod-hive-regression-tracking/assets/122239111.flac
```

## Scripts

Use [./generate-data](./generate-data) to generate new results and store them in S3.

Use [./load-data-snowflake](./load-data-snowflake/) to load those results into Snowflake.

See their README.mds for more info.
