Deploy model endpoint in a TFX pipeline

Referring to the official Vertex AI x TFX example:

The tutorial shows how to push the trained model to a GCS bucket as the last step. What if I wanted to also deploy it to Vertex AI with an endpoint enabled?

Any resources?

If you want to serve a custom model there Is:

https://codelabs.developers.google.com/vertex_custom_training_prediction#0

It’s out of scope for my query. I can easily run a CustomTrainingJob on Vertex AI and directly deploy that.

But my query involves that from a pipeline which is different than what you referenced.

@Sayak_Paul , That was by mistake. Not meant for your post.

Do you want to do this directly from a TFX pipeline?

After my model is pushed from the Pusher component of TFX, I want to be able to deploy it on Vertex AI.

Please follow the tutorial I mentioned in the initial post. You’ll see that the entire TFX Pipeline is orchestrated as a Vertex AI pipeline.

Ccing @Robert_Crowe if he has any suggestions.

Mhh I don’t think it is available off the shelf, but let’s wait for Robert.

Pobably a custom component is required, something like:

I agree. This repository is gold, thanks for mentioning it here. It’s pretty recent as well.

Unfortunately the official Vertex Pusher component is still being developed, but if you push to a file system destination then you can script deployment to Vertex Prediction.

Thanks, @Robert_Crowe. Do you have a code example that I could refer to for supporting this?

Isn’t it already in the mentioned repo (step 7)?

Step 9 I guess: “Upload the model to Vertex AI using vertex_model_pusher custom Python component”. I will try this one out and see.

it was 7 but it was update some days ago now it is on point 8.

But: there’s a duplicate number.

Yes but I don’t mean notebook cells number I meant 8 (it was 7) as 8. Model Upload to AI Platform

P.s. 7. Model pushing is Robert:

but if you push to a file system destination …

Getting back to the solution that actually worked: