How to check if push_container_exec_base_images() succeeded
![yashpuranik](https://us.v-cdn.net/6038231/uploads/lithium_attachments/n4748i34B776AD1AC4D5F4.jpg)
Hi,
I was looking at using push_container_exec_base_images() in connection with some other steps to work on building and updating some base images for Dataiku using the Python API (https://developer.dataiku.com/latest/api-reference/python/other-administration.html#dataikuapi.dss.admin.DSSGeneralSettings.push_container_exec_base_images).
The method appears to be non-blocking: I imagine it triggers the image pushes but returns control immediately. What is a good way to check if the base image push process has successfully completed before continuing on in the script? Currently, I simply sleep in my script for 10 minutes, but a more efficient method would be ideal
Thanks,
Yash
Best Answer
-
Hi @yashpuranik
,Instead of using DSSGeneralSettings.push_container_exec_base_images, you can use DSSClient.push_base_images, which returns a DSSFuture object that you can wait on.
Example:
import dataiku client = dataiku.api_client() # Start pushing the base images future = client.push_base_images() # Wait for the push to complete, and get the result result = future.wait_for_result()
Thanks,
Zach
Answers
-
yashpuranik Partner, Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Neuron, Dataiku DSS Adv Designer, Registered, Neuron 2022, Neuron 2023 Posts: 69 Neuron
Worked like a charm! Thank you