<@U06RKAMK0UC> How do I create and submit a new la...
# ask-ai
s
@ancient-wolf-19325 How do I create and submit a new launch plan?
j
To create and submit a new launch plan in Flyte, you can use either the Flytectl CLI or the FlyteRemote Python SDK. Here are the steps for both methods: Using Flytectl CLI 1. Generate an execution spec file:
Copy code
flytectl get launchplan -p flytesnacks -d development myapp.workflows.example.my_wf --execFile exec_spec.yaml
2. Update the input spec file for arguments to the workflow:
Copy code
inputs:
        name: "adam"
3. Create execution using the exec spec file:
Copy code
flytectl create execution -p flytesnacks -d development --execFile exec_spec.yaml
4. Monitor the execution by providing the execution id from the create command:
Copy code
flytectl get execution -p flytesnacks -d development <execid>
Using FlyteRemote Python SDK 1. Initialize FlyteRemote and fetch the launch plan:
Copy code
from flytekit.remote import FlyteRemote
    from flytekit.configuration import Config
    from flytekit import LaunchPlan

    remote = FlyteRemote(
        config=Config.for_endpoint(endpoint="flyte.example.net"),
        default_project="flytesnacks",
        default_domain="development",
    )

    flyte_lp = remote.fetch_launch_plan(
        name="workflows.example.wf", version="v1", project="flytesnacks", domain="development"
    )
2. Execute the launch plan:
Copy code
execution = remote.execute(
        flyte_lp, inputs={"mean": 1}, execution_name="lp-execution", wait=True
    )
For more details, refer to the Flytectl documentation and the FlyteRemote documentation. Would you like more detail on any specific part? Sources: - Running launch plans 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.