How to check if push_container_exec_base_images() succeeded

Solved!
yashpuranik
How to check if push_container_exec_base_images() succeeded

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.a...).

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

yashpuranik
0 Kudos
1 Solution
ZachM
Dataiker

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

View solution in original post

0 Kudos
2 Replies
ZachM
Dataiker

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

0 Kudos
yashpuranik
Author

Worked like a charm! Thank you ๐Ÿ™‚

yashpuranik