mistkml / mistk

Model Integration Software Development Kit
20 stars 12 forks source link

[question] is it possible to set an application context dynamically? #3

Closed andrewzah closed 4 years ago

andrewzah commented 4 years ago

i.e. instead of /v1/mistk would it be possible to have /$CONTEXT/v1/mistk?

If not, could you point me in the right direction on where to add that functionality?

andrewzah commented 4 years ago

@dcastel1 @adipon

andrewshilliday commented 4 years ago

This is not currently supported. The platform that integrates the model developed with MISTK expects the endpoints to be located at /v1/mistk.

andrewzah commented 4 years ago

@andrewshilliday could you point me where that value gets set? Is it just statically set in model/server/swagger/swagger.yaml, with basePath? Would this be difficult to change to a dynamic variable?

adipon commented 4 years ago

@azah The endpoint path is generated from the mistk-model-api.yaml file's basepath attribute into the model/server/swagger/swagger.yaml file. While it is possible to change it to a dynamic variable in our build process, doing so would cause significant impact to downstream platforms that integrates with the models developed with MISTK. Could you describe the use case in which you would need this functionality?

andrewzah commented 4 years ago

@adipon that's fine, we can maintain a fork if this is not functionality needed by others. I'm just new to the software stack being used here, so I wasn't sure how to go about changing the base path to a different build-time variable (or a runtime variable) that we can change.

Our goal is dynamic routing with docker via Traefik and its labels, to different models. So if we spin up several containers, they would point to example.com/mistk/model1/v1/mistk, example.com/mistk/model2/v1/mistk, etc.

A variable that we can change at runtime instead of at build-time would be preferable.