First some praise: I just added parameters with de...
# prefect-ui
n
First some praise: I just added parameters with default values and specific parameter values on different schedules of a flow for the first time. Furthermore I also just tried the conditional task functionality for the first time. Those features are so versatile and cool, I love it. 🤩 On that note, in Cloud I can successfully schedule and run the scheduled runs of my flow with the schedules’ custom parameters. I can also use “Quick Run” to run with the default parameters. But when I try to run my flow manually with the “Run” tab to set different parameter inputs I get some errors on the scheduling of that run. The error says
{'memory': ['Not a valid string.'], 'cpu': ['Not a valid string.']}
but I haven’t changed any of the ECSRun parameters that were set on registration (where I set them to integers). Could there be a bug in the UI causing this?
This is how the section looks in the UI, where I haven’t changed anything from my default ECSRun set in the registration
Also tried setting them as strings with double quotes:
"256"
and that give me a different error:
An error occurred (InvalidParameterException) when calling the RunTask operation: Invalid 'cpu' setting for task.
j
Hi @Noah Holm - thanks for the feedback! Different error messages but do you think your issue is similar to/connected to this one: https://github.com/PrefectHQ/ui/issues/1023? We just released a fix for that so would be interested to know when you were seeing your issue and whether it's something you've seen previously or just noticed.
n
Hey Jenny, I just tried some more and it doesn’t seem to have solved my issue. However I did find one interesting additional aspect: So my flow registered successfully with cloud, has two cronclocks in its schedule which runs on the schedule and I can manually run with “quick run”. When I go to the run tab to customize my parameters I get the above string error, but if I got to the run tab and click run without actually changing anything, it still works. Let me if I can do anything more to help looking further into this
Just tried changing my default parameter in the run tab and remove the memory/cpu config completely. That worked!
j
Thanks for that extra info. Let me look into that.
Ok - I think I see the issue. Entering an integer for CPU and Memory works for core because it takes either an integer or a string. However, the required input for an integer is different to the required input for a string (which needs the unit also e.g. 'vcpu'). In the UI we expect that value to be a string and process it as a string. When we pass back the CPU it's in the wrong format if it was previously entered as an integer (because there's no unit). I can open a UI ticket for that issue but in the meantime, it looks like you've already figured out that removing CPU and memory resolves the issue. If you're willing to explore further, could you try updating your run config to use the string input for memory and cpu? And/or try adding a unit (looks like vcpu for cpu and gb for memory) to the cpu and memory inputs on the run page and seeing if the run is successful?
n
Yes, registering the flow with strings in the ECSRun args works even though I also start tinkering with my default parameters in the Run tab. So to conclude:
Copy code
# Works for everything I've seen but the tinkering of Run parameters
ECSRun(
    labels=["somelabel"],
    image="someimage",
    cpu=256,
    memory=512,
)

# Also worked after tinkering with the parameters in the Run tab
ECSRun(
    labels=["somelabel"],
    image="someimage",
    cpu=".25 vCPU",
    memory="0.5 GB",
)
j
Thanks for confirming that! @Marvin open "Using integers for ECSRun memory and CPU causes issues in the run flow page" in UI
n
Thanks Jenny! Have a good day ☀️
j
You too!
c
Hi, I know I'm resurrecting an old thread, but I'm getting a similar error using the
Run
tab w/ a
KubernetesRun
config.
Copy code
{'cpu_limit': ['Not a valid string.'], 'cpu_request': ['Not a valid string.']}
Quick Run
works fine! Additional info: • Prefect version 0.15.3 • Python version 3.8.5 • Happens w/ both server and cloud.