Deployments

Welcome to our step-by-step guide on creating a deployment from an Action in the Giza Platform! This tutorial is designed to walk you through the process of deploying an action in your workspace, create runs and monitor their executions.

By the end of this tutorial, you'll have a solid understanding of how to leverage Giza Platform's powerful features to streamline your Action deployments and create Runs. Let's get started!

Create a deployment

Every Action deployment references one and only one "entrypoint" action. Different deployments may reference the same underlying action, a useful pattern when developing or promoting workflow changes through staged environments.

Let's assume you have the following action:

from giza_actions.action import action
from giza_actions.task import task

@task
def print_hello():
    print(f"Hello Action!")

@action
def hello_world():
    print_hello()

We can easily create a deployment for the above action definition by creating the Action object and then calling the serve function in the entrypoint script:

from giza_actions.action import Action, action
from giza_actions.task import task

@task
def print_hello():
    print(f"Hello Action!")

@action
def hello_world():
    print_hello()

if __name__ == '__main__':
    action_deploy = Action(entrypoint=hello_world, name="hello-world-action")
    action_deploy.serve(name="hello-world-action-deployment")

Running this script will do two things:

  • Create a deployment called "hello-world-action" for your action in the Giza Platform.

  • Stay running to listen for action runs for this deployment; when a run is found, it will be asynchronously executed within a subprocess locally.

Create an Action Run

First, you need a Workspace to create runs. Go to the Workspaces how-to guide to set it up.

Go to your workspace where you can see all your Action, Runs and Deployments. After executing your script, you will see your "hello-world-action" in your Actions tab. In the Deployments section, you will see the "hello-world-action-deployment" of the running deployment for your action.

Last updated