fix(sdk): Propagate transformer ID during re-deployment #497
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
This PR exposes the Transformer
id
to the SDK methods so that, in the event of a model redeployment, the transformer's ID can be re-used to trigger an update.Which issue(s) this PR fixes:
Model redeployment capabilities were added to the SDK in #455. With this, however, transformer updates were not being done correctly and instead, a new transformer entity would be attempted to be created with every version endpoint update (re-deployment). The re-deployment operation would eventually fail with an error like below, leaving the endpoint stuck in the "pending" state:
This PR addresses this issue by exposing the transformer's id to the SDK and copying the id to the new transformer specs, during version endpoint updates.
Summary of changes
swagger.yaml
- UpdateTransformer
specs to includeid
api/client/
,python/sdk/client/
- Re-generate client codepython/sdk/merlin/endpoint.py
- Addtransformer
property toVersionEndpoint
python/sdk/merlin/model.py
python/sdk/merlin/transformer.py
- Addid
property to theTransformer
classpython/sdk/test/integration_test.py
- Expand the re-deployment test case to cover the id check for transformer. In the test case, the Tensorflow model (which requires a specific input) is replaced with a custom model so that the echo transformer can be used alongside.python/sdk/test/model_test.py
- Update mock responses, owning to the change inpython/sdk/merlin/model.py
to re-get the version endpoint after deployment.Does this PR introduce a user-facing change?:
Checklist