Skip to main content

An Apache Airflow Provider package containing Operators from Astronomer. The purpose of these operators is to better assist customers migrating Variables, Connections, and Environment Variables to Astronomer hosted Airflow environments from MWAA, GCC, and OSS environments. This provider is meant for MWAA 2.0.2 and Google Cloud Composer 1 environments in particular, as webserver plugins are unavailable in these environments.

Installation

Install and update using pip:

pip install astronomer-starship-provider

Usage

  1. Add the following line to your requirements.txt in your source environment:

astronomer-starship-provider
  1. Add the following DAG to your source environment:

from airflow import DAG

from astronomer.starship.operators import AstroMigrationOperator
from datetime import datetime

with DAG(
   dag_id="astronomer_migration_dag",
   start_date=datetime(2020, 8, 15),
   schedule_interval=None,
) as dag:

   AstroMigrationOperator(
       task_id='export_meta',
       deployment_url='{{ dag_run.conf["deployment_url"] }}',
       token='{{ dag_run.conf["astro_token"] }}',
   )
  1. Deploy this DAG to your source Airflow environment, configured as described in the Configuration section below

  2. Once the DAG is available in the Airflow UI, click the “Trigger DAG” button, then click “Trigger DAG w/ config”, and input the following in the configuration dictionary:

    • astro_token: To retrieve an Astronomer token, navigate to cloud.astronomer.io/token and login using your Astronomer credentials

    • deployment_url: To retrieve a deployment URL - navigate to the Astronomer Airlow deployment that you’d like to migrate to in the Astronomer UI, click Open Airflow and copy the page URL (excluding /home on the end of the URL)

      • For example, if your deployment URL is https://astronomer.astronomer.run/abcdt4ry/home, you’ll use https://astronomer.astronomer.run/abcdt4ry

    • The config dictionary used when triggering the DAG should be formatted as:

{
    "deployment_url": "your-deployment-url",
    "astro_token": "your-astro-token"
}
  1. Once the DAG successfully runs, your connections, variables, and environment variables should all be migrated to Astronomer

Configuration

The AstroMigrationOperator can be configured as follows:

  • variables_exclude_list: List the individual Airflow Variables which you do not want to be migrated. Any Variables not listed will be migrated to the desination Airflow deployment.

  • connection_exclude_list: List the individual Airflow Connections which you do not want to be migrated. Any Variables not listed will be migrated to the desination Airflow deployment.

  • env_include_list: List the individual Environment Variables which you do want to be migrated. Only the Environment Variables listed will be migrated to the desination Airflow deployment. None are migrated by default.

AstroMigrationOperator(
    task_id='export_meta',
    deployment_url='{{ dag_run.conf["deployment_url"] }}',
    token='{{ dag_run.conf["astro_token"] }}',
    variables_exclude_list=["some_var_1"],
    connection_exclude_list=["some_conn_1"],
    env_include_list=["FOO", "BAR"]
)

Metadata

Release files for astronomer-starship-provider 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for astronomer-starship-provider 0.1.4
File Size Uploaded
astronomer-starship-provider-0.1.4.tar.gz 6.1 kB Details

Release files / astronomer-starship-provider-0.1.4.tar.gz

Download URL astronomer-starship-provider-0.1.4.tar.gz
Size 6.1 kB
Tags Source
SHA-256 checksum
How to use checksums
722e871fa09b214525eab1859fe8f4527c17d56aa5a70ded900f53b543fc75a1
BLAKE2b-256 checksum
How to use checksums
ab7db42ba06f3be5f51277d07500f1e9553830a6bfec6f5e94d83fe556a3b6f8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.14

Release history Release notifications | RSS feed

This release

0.1.4 This release

1 release file

0.1.3

1 release file

0.1.2

1 release file

0.1.1

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page