Skip to main content

A package to simplify connecting to the couchbase nosql database from Apache Airflow

Project description

airflow-providers-couchbase

The airflow-providers-couchbase enables interactions with Couchbase clusters within Apache Airflow workflows. It provides custom Couchbase Hook that allow users to seamlessly interact with Couchbase databases, execute queries, manage documents, and more.

Installation

To install the airflow-providers-couchbase package, run:

pip install airflow-providers-couchbase

Running a DAG Example Inside an Airflow Docker Container

This section demonstrates how to run the example DAG inside an Airflow Docker container. A docker folder is provided in the repository, containing a Dockerfile and docker-compose.yaml file for setting up the Couchbase provider and running Airflow. Additionally, a sample DAG file airflow_test_cb_cluster.py is available in the docker/dags folder, which interacts with a Couchbase cluster.

Prerequisites

  • Docker and Docker Compose installed on your machine.
  • A running Couchbase cluster accessible from your Docker container. If you don’t have one, download and install Couchbase Server from the official website.
  • The travel-sample bucket should be available in your Couchbase cluster. If not, you can import it from Couchbase sample buckets.

Steps to Run the Example DAG

  1. Navigate to the Docker Directory:

    cd docker
    
  2. Build and Run the Docker Containers:

    docker compose up airflow-init
    docker-compose up --build
    
  3. Access the Airflow Web UI: Open your web browser and navigate to http://localhost:8080 to access the Airflow web UI.

  4. Configure a Couchbase Connection: Navigate to Airflow Connections and configure the Couchbase connection with the following details:

    • Connection Id: couchbase_default
    • Connection Type: Couchbase
    • Connection: couchbase://your_couchbase_host
    • Username: Your Couchbase username
    • Password: Your Couchbase password
  5. Trigger the DAG: Trigger the couchbase_cluster_test DAG from the Airflow UI and inspect the logs.

  6. Inspect the Logs: Click on each task and check the logs to verify the execution of Couchbase queries.

Clean Up

To stop and remove the Docker containers and volumes, run:

docker-compose down -v

Additional Resources

  • Airflow Installation Guide
  • Apache Airflow Documentation

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

airflow_providers_couchbase-1.0.0.tar.gz (19.4 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file airflow_providers_couchbase-1.0.0.tar.gz.

File metadata

File hashes

Hashes for airflow_providers_couchbase-1.0.0.tar.gz
Algorithm Hash digest
SHA256 2049ac8d36d2c97ad1de939f3cdcdf9c6a64cf6ebf91a1623d4c833243103729
MD5 1d1d98ec7eb813f9cbd41307d6da6cbd
BLAKE2b-256 9d57cf8d87cfce9073aeeceaf7071e9d563083e217c98e0032a046ffafa0c4b5

See more details on using hashes here.

File details

Details for the file airflow_providers_couchbase-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for airflow_providers_couchbase-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 282e84ab33b8e08bde7432cd6b2e6d5fc1a462f1956674900af85ef11f851f3e
MD5 b0cc4eebfb3dd5bb8d035c80231bab9f
BLAKE2b-256 e7996fb388d58931e8cec641a3a9ebf554c946d74ecd9f51770a493f885732dc

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page