Running launch plans#

Inspecting launch plans#

Inspecting launch plans in the Union console#

Select Launch Plans in the sidebar to display a list of all the registered launch plans in the project and domain:

Launch plan list

You can search the launch plans by name. The columns in the launch plans table are defined as follows:

  • Name: The name of the launch plan. Click to inspect a specific launch plan in detail.

  • Triggers:

    • If the launch plan is active, a green Active badge is shown. When a launch plan is active, any attached schedule will be in effect and the launch plan will be invoked according to that schedule.

    • Shows whether the launch plan has an trigger. To filter for only those launch plans with a trigger, check the Has Triggers box in the top right.

  • Last Execution: The last execution timestamp of this launch plan, irrespective of how the last execution was invoked (by schedule, by trigger, or manually).

  • Last 10 Executions: A visual representation of the last 10 executions of this launch plan, irrespective of how these executions were invoked (by schedule, by trigger, or manually).

Select an entry on the list to go to that specific launch plan:

Launch plan list

Here you can see:

  • Launch Plan Detail (Latest Version):

    • Expected Inputs: The input and output types for the launch plan.

    • Fixed Inputs: If the launch plan includes predefined input values, they are shown here.

  • Launch Plan Versions: A list of all versions of this launch plan.

  • All executions in the Launch Plan: A list of all executions of this launch plan.

In the top right you can see if this launch plan is active (and if it is, which version, specifically, is active). There is also a control for changing the active version or deactivating the launch plan entirely. See Activating a launch plan and Deactivating a launch plan, below, for more details.

Inspecting launch plans on the command line with uctl#

To view all launch plans within a project and domain:

$ uctl get launchplans \
       --project <project-id> \
       --domain <domain>

To view a specific launch plan:

$ uctl get launchplan \
       --project <project-id> \
       --domain <domain> \
       <launch-plan-name>

Inspecting launch plans in Python with UnionRemote#

Use the method UnionRemote.client.list_launch_plans_paginated to get the list of launch plans.

Activating a launch plan#

Launch plans can be activated and deactivated. More precisely:

  • Among the versions of a given launch plan (as defined by name), at most one can be set to active. All others are inactive.

  • If a launch plan version that has a schedule attached is activated, then its schedule also becomes active and its workflow will be invoked automatically according to that schedule.

  • When a launch plan version with a schedule is inactive, its schedule is inactive and will not be used to invoke its workflow.

Launch plans that do not have schedules attached can also have an active version. For such non-scheduled launch plans, this status serves as a flag that can be used to distinguish one version from among the others. It can, for example, be used by management logic to determine which version of a launch plan to use for new invocations.

Upon registration of a new launch plan, the first version is automatically inactive. If it has a schedule attached, the schedule is also inactive. Once activated, a launch plan version remains active even as new, later, versions are registered.

A launch plan version with a schedule attached can be activated through either the Union console, uctl, or UnionRemote.

Activating a launch plan in the console#

In the launch plan view, click Add active launch plan in the top right corner of the screen:

Activate schedule

A modal will appear that lets you select which launch plan version to activate:

Activate schedule

This modal will contain all versions of the the launch plan that have an attached schedule. Note that at most one version (and therefore at most one schedule) of a launch plan can be active at any given time.

Selecting the launch plan version and clicking Update activates the launch plan version and schedule. The launch plan version and schedule are now activated. The launch plan will be triggered according to the schedule going forward.

Warning

Non-scheduled launch plans cannot be activated via the Union console. The Union console does not support activating launch plans that do not have schedules attached. You can activate them with uctl or UnionRemote.

Activating a launch plan on the command line with uctl#

To activate a launch plan version with uctl, execute the following command:

$ uctl update launchplan \
       --activate \
       --project <project-id> \
       --domain <domain> \
       <launch-plan-name> \
       --version <launch-plan-version>

Activating a launch plan in Python with UnionRemote#

The following code activates a launch plan version using UnionRemote:

from unionai.remote import UnionRemote

remote = UnionRemote(config=Config.auto(), default_project=<project-id>, default_domain=<domain>)
launch_plan = remote.fetch_launch_plan(ame=<launch-plan-name>, version=<launch-plan-version>).id
remote.client.update_launch_plan(launch_plan.id, "ACTIVE")

Deactivating a launch plan#

Deactivating a launch plan in the Union console#

To deactivate a launch plan, navigate to a launch plan with an active schedule, click the icon in the top-right corner of the screen beside Active launch plan, and click “Deactivate”.

Deactivate schedule

A confirmation modal will appear, allowing you to deactivate the launch plan and its schedule.

Warning

Non-scheduled launch plans cannot be deactivated via the Union console. The Union console does not support deactivating launch plans that do not have schedules attached. You can deactivate them with uctl or UnionRemote.

Deactivating a launch plan on the command line with uctl#

To deactivate a launch plan version with uctl, execute the following command:

$ uctl update launchplan \
       --deactivate \
       --project <project-id> \
       --domain <domain> \
       <launch-plan-name> \
       --version <launch-plan-version>

Deactivating a launch plan in Python with UnionRemote#

The following code activates a launch plan version using UnionRemote:

from unionai.remote import UnionRemote
from flytekit.remote import Config

remote = UnionRemote(config=Config.auto(), default_project=<project-id>, default_domain=<domain>)
launch_plan = remote.fetch_launch_plan(ame=<launch-plan-name>, version=<launch-plan-version>)
remote.client.update_launch_plan(launch_plan.id, "INACTIVE")

Running a launch plan#

Running a launch plan in the console#

Above, we defined my_workflow_custom_lp with fixed input a=3 and default inputs b=4 and c=5:

my_workflow_custom_lp

To invoke the launch plan, go to the Workflows view, select workflows.launch_plan_example.my_workflow, click Launch Workflow, then select my_workflow_custom_lp from the Launch Plan dropdown menu:

my_workflow_custom_lp

You will see that the two default inputs are available to be overridden, but the fixed input is not:

my_workflow_custom_lp

Click Launch to execute the launch plan.

Running a launch plan on the command line with uctl#

To invoke a launch plan via the command line, first generate the execution spec file for the launch plan:

$ uctl get launchplan \
       --project <project-id>
       --domain <domain> \
       <launch-plan-name> \
       --execFile <execution-spec-file-name>.yaml

Then you can execute the launch plan with the following command:

$ uctl create execution \
       --project <project-id> \
       --domain <domain> \
       --execFile <execution-spec-file-name>.yaml

Running a launch plan in Python with UnionRemote#

The following code executes a launch plan using UnionRemote:

from unionai.remote import UnionRemote
from flytekit.remote import Config

remote = UnionRemote(config=Config.auto(), default_project=<project-id>, default_domain=<domain>)
launch_plan = remote.fetch_launch_plan(name=<launch-plan-name>, version=<launch-plan-version>)
remote.execute(launch_plan, inputs=<inputs>)

See the UnionRemote and UnionRemote.execute documentation for more details.