model-registry
model-registry copied to clipboard
Refactor envtest mocks & client logic for catalog-source ConfigMap handling
Description
This PR is a starting point for refactoring based on my conversations with @ppadti. I left a considerable number of TODOs that will be addressed by @ppadti in a FUP PR.
This change aligns our handling of the model-catalog-default-sources and model-catalog-sources ConfigMaps and aligns our test/mock environment (envtest).
In this PR:
- Reverted modelCatalogSettingsRepository mock creation to align with your k8s mock strategy
- Implemented GetAllCatalogSourceConfigs for the default catalog
- Setup env test for model-catalog-source-config
Next steps:
FUP PR from @ppadti to write the full implementation
How Has This Been Tested?
run the application in mock mode
make dev-start
try these curl commands:
get all source configs:
curl -X GET "http://localhost:4000/api/v1/settings/model_catalog/source_configs?namespace=kubeflow" -H "kubeflow-userid: [email protected]"
add a catalog source config:
curl -X POST "http://localhost:4000/api/v1/settings/model_catalog/source_configs?namespace=kubeflow" -H "kubeflow-userid: [email protected]" -H "Content-Type: application/json" -d '{"data":{"id":"test-catalog","name":"Test Catalog","type":"yaml"}}'
get a catalog source config:
curl -s "http://localhost:4000/api/v1/settings/model_catalog/source_configs/test-catalog?namespace=kubeflow" -H "kubeflow-userid: [email protected]"
Update a catalog source config:
curl -X PATCH "http://localhost:4000/api/v1/settings/model_catalog/source_configs/test-catalog?namespace=kubeflow" -H "kubeflow-userid: [email protected]" -H "Content-Type: application/json" -d '{"data":{"id":"test-catalog","name":"Updated Catalog","type":"yaml"}}'
Delete a catalog source config:
curl -X DELETE "http://localhost:4000/api/v1/settings/model_catalog/source_configs/test-catalog?namespace=kubeflow" -H "kubeflow-userid: [email protected]"
Merge criteria:
- All the commits have been signed-off (To pass the
DCOcheck)
- [X] The commits have meaningful messages
- [ ] Automated tests are provided as part of the PR for major new functionalities; testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious).
- [X] The developer has manually tested the changes and verified that the changes work.
- [X] Code changes follow the kubeflow contribution guidelines.