Pedro Martins

02/08/2021, 6:06 PM
Hey team! I have a flow in which the parameters default value comes from a
. See below:
Copy code
with Flow("model-deployment-pipeline", **custom_confs,) as flow:
        model_uri = Parameter("model_uri", default=config["model"]["modelUri"])
        environment = Parameter("environment", default=config["model"]["environment"])

        deploy_model(model_uri=model_uri, namespace=environment)
This flow is triggered when there are modification on the config.toml. How can I make sure that this flow will access the most up to date config file?

Josh Greenhalgh

02/08/2021, 6:09 PM
Is it really a default if its dynamic?

Pedro Martins

02/08/2021, 6:14 PM
The ideia is to allow deployment through changing the configuration file and through prefect CLI.

Kyle Moon-Wright

02/08/2021, 6:23 PM
Hey @Pedro Martins, Hard to say how you can ensure your config.toml is the latest version, there should only be one that Prefect will draw from especially if the flow is triggered on a modification to that file. Maybe setting an env var to be exposed via UI logging that marks a TOML version number or a specifies the used config.toml for that flow run? Not sure if that will meet your needs though, there’s no version control for that file specifically so we’d need to bake it in to our existing CI process.