Hello :wave:, I recently joined a team using Flyte...
# ask-the-community
c
Hello 👋, I recently joined a team using Flyte, and I’m tasked with introducing Flyte’s native scheduler. I’ve gotten my code running in the
sandbox
environment with
--fast
registration, which is pretty awesome. But now I’m stuck trying to set inputs specific to developing in
sandbox
(e.g., hostname of an external service running on my local machine). Question: How do I enable a schedule with specified inputs that override
default_inputs
whenever the scheduler invokes my workflow? What I think I want is a commandline like:
Copy code
flytectl update launchplan -p {project} -d {domain} {lp_name} --version {version} --activate --execFile exec_spec.yaml
As a test, when I try to follow this line from the docs and omit a required input from the
LaunchPlan.get_or_create
call, then my schedule simply doesn’t run when actived:
Copy code
Launch plans do not necessarily contain the entire set of required workflow inputs
I hope I’m just missing something! Thanks.
y
you cannot. you will need to create a new launch plan with the inputs you want.
but that should be pretty doable. is there a problem with that?
c
gotcha, good to know
it certainly won’t be a major problem, if at all, but I’ll have to take some time structuring my code around this to know for sure
y
wait why?
i’m confused.
making a new launch plan is just one line…
c
so while I can make multiple launch plans, I don’t want to check a sandbox-specific one into my team’s repo
y
can you paste the signature of the wf
c
it’s not a hard requirement, but I like to keep that sort of thing in READMEs and scripts
Copy code
@workflow
def wf(ip: str, args: List[str]):
    prepared = prepare_map_inputs(args=args, ip=ip)
    return map_task(task_name)(input=prepared)
y
you want a launch plan that is only registered on sandbox not in production?
c
I’d like a different one between the two environments, yeah
my prod one is daily and uses kubernetes to access the external service, and for sandbox I run that service on my machine (outside docker) and want a shorter schedule for testing purposes
y
and you tried creating one manually out of band?
and you’re saying the creation worked.. but schedule activation failed?
c
I’ve been able to create one with FlyteRemote
y
can you paste in the get or create call as well?
c
Copy code
launch_plan = LaunchPlan.get_or_create(
    workflow=wf,
    name="lp",
    default_inputs={
        "args": ["arg1", "arg2"],
        "ip": "<http://kubernetes-host:8080>",
    },
    schedule=CronSchedule(
       schedule="*/1 * * * *", # a testing schedule of 1 minute
    ),
)
y
may be a bug… but can you try changing that to fixed_inputs?
c
In sandbox, I’d ideally like to override args (says with fewer elements) and ip (with
"<http://host.docker.internal:8080>"
)
y
sure but that can be yet another launch plan right?
since there’s no way to override inputs for a scheduled one
may as well be fixed.
c
I see what you’re saying, I’ll change it to fixed to make it clear in the code and find a clean way to create a specific launch plan for sandbox
luckily, the above get_or_create call does work if I set the appropriate values in the code
it only broke when I tried to override the inputs, which isn’t supported
I have a few ideas of how to proceed from here, so thanks for the pointers - I’ll toy around with them tomorrow
y
yeah sure, let us know
c
ok, and thanks again for all your work on the sandbox environment 🙂
156 Views