Sign up to take part
Registered users can ask their own questions, contribute to discussions, and be part of the Community!
Registered users can ask their own questions, contribute to discussions, and be part of the Community!
Hi,
I would like to change dynamically the container for the execution of a recipe through the dataikuapi-external-client. I could not find any referenece in the documentation.
How can I achieve that (if possible)?
Regards,
Filippo
Hi again,
In that case you will need to use the get_settings() method of the Recipe API, retrieve the existing parameters for container configuration, modify the dictionary in-place and finally call the save() method on the recipe settings handle. Here is a simplified example:
import dataikuapi
client = dataikuapi.DSSClient(host=HOST, api_key=API_KEY)
project = client.get_project(PROJECT_KEY)
recipe_settings = project.get_recipe(RECIPE_ID).get_settings()
recipe_advanced_params = recipe_settings.raw_params
recipe_advanced_params["containerSelection"]["containerMode"] = "EXPLICIT_CONTAINER"
recipe_advanced_params["containerSelection"]["containerConf"] = YOUR_CONTAINER_CONF_NAME
Of course this assumes that you already have an existing functioning containerized execution configuration in your instance's administration settings.
Best,
Harizo
Hi Filippo,
Do you mean to programmatically change the "container configuration" settings for a given recipe ?
Best,
Harizo
Exactly. How can I do that? What methods in the DSSRecipe or DSSRecipeSettings classes should I use?
Thanks!
Hi again,
In that case you will need to use the get_settings() method of the Recipe API, retrieve the existing parameters for container configuration, modify the dictionary in-place and finally call the save() method on the recipe settings handle. Here is a simplified example:
import dataikuapi
client = dataikuapi.DSSClient(host=HOST, api_key=API_KEY)
project = client.get_project(PROJECT_KEY)
recipe_settings = project.get_recipe(RECIPE_ID).get_settings()
recipe_advanced_params = recipe_settings.raw_params
recipe_advanced_params["containerSelection"]["containerMode"] = "EXPLICIT_CONTAINER"
recipe_advanced_params["containerSelection"]["containerConf"] = YOUR_CONTAINER_CONF_NAME
Of course this assumes that you already have an existing functioning containerized execution configuration in your instance's administration settings.
Best,
Harizo