Thread
#flytekit
    Rahul Mehta

    Rahul Mehta

    1 month ago
    Is it possible to mix
    @flytekit.dynamic
    &
    with_overrides
    ? Curious if we could pass a resource configuration object to a workflow at runtime and have the
    @dynamic
    step specify overrides at runtime
    Ketan (kumare3)

    Ketan (kumare3)

    1 month ago
    Yes you should be able to
    That was one of the intended usecases
    Rahul Mehta

    Rahul Mehta

    1 month ago
    Ah, I was trying to parameterize a workflow with cpu/mem so that we could dynamically specify them as arguments (in lieu of https://github.com/flyteorg/flyte/issues/475)
    Looks like this successfully compiles w/ dynamic but if there's a sub-workflow (
    @workflow
    , not
    @dynamic
    ) then it leads to the following error
    AttributeError: 'Promise' object has no attribute 'cpu'
    Although, when actually examining the pod in the cluster it looks like supplying args to
    with_overrides
    for limits doesn't have any effect/I still see the following when running
    kubectl describe
    on one of the pods (when I specified
    cpu="1"
    &
    mem=100Mi
    )
    Limits:
          cpu:     100m
          memory:  200Mi
        Requests:
          cpu:     100m
          memory:  200Mi
    If I hard-code the values in it seems to work fine but it doesn't appear to be possible to specify
    with_overrides
    w/ an argument to a workflow
    'VoidPromise' object has no attribute 'with_overrides'
    If anyone on the team could provide an example of setting overrides in a dynamic step based on an argument that'd be very helpful..seems like it's possible per https://flyte-org.slack.com/archives/CP2HDHKE1/p1655135984234209, but I must be missing something…
    Samhita Alla

    Samhita Alla

    1 month ago
    I guess mixing
    @flytekit.dynamic
    and
    with_overrides
    isn’t yet possible. @Smriti Satyan, I remember you telling that this didn’t work. Could you elaborate more on this, please?
    Ketan (kumare3)

    Ketan (kumare3)

    1 month ago
    Smriti Satyan

    Smriti Satyan

    1 month ago
    Thats right @Samhita Alla. Facilitating
    dynamic
    with
    with_overrides
    is a work in progress. Right now, it can't be used. cc @Yee If we try to use
    with_overrides
    with
    dynamic
    workflow, it fails to execute.
    Ketan (kumare3)

    Ketan (kumare3)

    1 month ago
    @Rahul Mehta I am sorry in that case, let us look into this tomorrow. For some reason this feels like a bug
    Rahul Mehta

    Rahul Mehta

    1 month ago
    Filed https://github.com/flyteorg/flyte/issues/2730 w/ some more details of the issue
    Ketan (kumare3)

    Ketan (kumare3)

    1 month ago
    cc @Yee
    It works for me on a production cluster
    it does not work locally, but that is because of the way we interpret it and that should be a more complex fix to make it run locally
    Rahul Mehta

    Rahul Mehta

    1 month ago
    Ah this was on a production cluster with the sandbox helm chart deployed. To confirm I was running on remote. I'll upgrade all the deps and give this a shot next week
    Ketan (kumare3)

    Ketan (kumare3)

    1 month ago
    sure
    if you hop on a call i can show you as well
    Rahul Mehta

    Rahul Mehta

    1 month ago
    Sure - thanks very much for digging into it so quickly @Ketan (kumare3) ! Will reach out next week
    Ketan (kumare3)

    Ketan (kumare3)

    1 month ago
    absolutely
    Rahul Mehta

    Rahul Mehta

    1 month ago
    Confirmed this is no longer an issue on the most recent version of the chart that I deployed. Thanks again @Ketan (kumare3)!
    Ketan (kumare3)

    Ketan (kumare3)

    1 month ago
    Interesting, I don't even know we fixed it
    Rahul Mehta

    Rahul Mehta

    1 month ago
    This is definitely going to be very powerful and is the final blocker we had to fully moving towards flyte 🙂
    Ketan (kumare3)

    Ketan (kumare3)

    1 month ago
    Hopefully you will spread the word