Getting Started with Cloud Composer

Creating Your First Workflow Environment

Pradeep Singh
4 min readMar 13, 2023
Credit: dev.classmethod.jp

This is the second article of the series ‘Mastering Cloud Composer: A Comprehensive Guide to Managed Airflow on Google Cloud’.

In this article, we will go through the below topics:

  • A step-by-step guide to creating a new environment
  • Overview of the Airflow web interface and CLI tools
  • Tips for customizing workflows and integrating with other GCP services

Cloud Composer is a fully-managed workflow orchestration service that allows you to author, schedule, and monitor workflows using Apache Airflow. In this article, we’ll take you through the process of creating your first workflow environment in Cloud Composer and show you how to get started with building workflows.

Creating Your First Workflow Environment

The first step in getting started with Cloud Composer is creating a new environment. Here’s how you can do it:

  1. Access the Cloud Composer Console
    Open the Cloud Composer console in your Google Cloud Platform (GCP) project. If you don’t have a GCP account, you will need to create one before you can proceed.
  2. Click on Create Environment
    Once you are logged into the Cloud Composer console, click on “Create Environment”. You will then be presented with two options: Composer 1 or Composer 2.
  3. Choose Your Composer Version
    Choose the version of Composer that you want to use. In Composer 1, you will need to scale manually as per your needs and it supports Airflow 1 and 2. On the other hand, Composer 2 provides auto-scaling and supports only Airflow 2. Choose the version that best suits your needs.
  4. Fill in the Required Information
    Fill in the required information, such as the name of the environment, the region where the environment will be located, the composer image version, and the workload configuration.
  5. Click Create
    After you have filled in all the required information, click on “Create” to create your first workflow environment in Cloud Composer.

Congratulations! You have successfully created your first workflow environment in Cloud Composer. You can now start building and managing complex workflows in the cloud with ease.

Overview of the Airflow Web Interface and CLI Tools

After successfully creating your environment, you can now access the Airflow web interface and start authoring, scheduling, and monitoring workflows. Interacting with Airflow can be done in two ways: the Web Interface and the Command Line Interface (CLI).

Web Interface

The Airflow web interface is an intuitive and user-friendly interface that allows you to visualize the progress of your workflows and perform various operations. Here are some of the things you can do with the web interface:

  • View the status of your DAGs and their individual tasks
  • Trigger DAGs manually or on a schedule
  • View the log output of your DAGs and their tasks
  • View the progress of your DAGs and their tasks
  • View the status of your Airflow environment
  • Manage connections to external systems

Command Line Interface (CLI)

Aside from the web interface, you can also use the Command Line Interface (CLI) to interact with Airflow. The CLI provides a convenient way to manage your workflows and perform tasks such as:

  • Running and stopping DAGs
  • Managing connections to external systems
  • Interacting with the metadata database
  • Creating and deleting DAGs
  • Testing individual tasks
  • Upgrading the schema of your metadata database

Tips for Customizing Workflows and Integrating with Other GCP Services

Here are some tips on how to customize workflows and integrate them with other GCP services:

Integration with other GCP services

Cloud Composer allows you to integrate your workflows with other GCP services such as:

  • Cloud Storage: Use Cloud Storage to store and manage data used by your workflows.
  • Cloud Pub/Sub: Use Cloud Pub/Sub to send and receive messages between your workflows and other services.
  • BigQuery: Use BigQuery to analyze and visualize data generated by your workflows.

Customizing workflows

You can customize workflows in a number of ways:

  • Define custom operators: Use custom operators to create tasks that are specific to your organization’s needs.
  • Use templates: Use templates to create reusable DAGs that can be shared across different projects and teams.
  • Customize the web interface: Use custom CSS to customize the look and feel of the Airflow web interface.
  • Add custom plugins: Use custom plugins to extend the functionality of Airflow.

Integrating with third-party services

In addition to integrating with other GCP services, you can also integrate your workflows with third-party services such as:

  • GitHub: Use GitHub to manage your DAGs and code.
  • Slack: Use Slack to receive notifications and alerts from your workflows.
  • JIRA: Use JIRA to manage tasks and issues related to your workflows.

This article introduced Cloud Composer and provided guidance on creating your first workflow environment. You also learned how to customize workflows and integrate them with other GCP services. With Cloud Composer’s managed orchestration service and integration with various GCP services, you can create powerful, flexible, and scalable workflows that automate a variety of tasks, including data processing and machine learning.

--

--

Pradeep Singh

MLOps Engineer @ Genpact / psrajput.com / Running (10k in 59.12, 5k in 26.15) / Cricket / Trekking / Chess