Thread
#prefect-community
    Pedro Martins

    Pedro Martins

    1 year ago
    Hey team! I have a flow in which the parameters default value comes from a
    config.toml
    . See below:
    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

    Josh Greenhalgh

    1 year ago
    Is it really a default if its dynamic?
    Pedro Martins

    Pedro Martins

    1 year ago
    The ideia is to allow deployment through changing the configuration file and through prefect CLI.
    Kyle Moon-Wright

    Kyle Moon-Wright

    1 year ago
    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.