Skip to content

Commit

Permalink
Quality of life changes to Airflow Demo (#4895)
Browse files Browse the repository at this point in the history
Co-authored-by: Abhi Vaidyanatha <[email protected]>
  • Loading branch information
avaidyanatha and Abhi Vaidyanatha authored Jul 22, 2021
1 parent 1fedca9 commit 8f43ba9
Showing 1 changed file with 28 additions and 13 deletions.
41 changes: 28 additions & 13 deletions resources/examples/airflow/up.sh
Original file line number Diff line number Diff line change
@@ -1,22 +1,37 @@
#!/usr/bin/env bash
cd ../../..
echo "Attempting to remove previous Airbyte installation..."
docker-compose down -v
docker-compose up -d
cd resources/examples/airflow || exit
echo "Attempting to remove previous Airflow installation..."
docker-compose -f docker-compose-airflow.yaml down -v
docker-compose -f docker-compose-airflow.yaml up -d
# Create Postgres Database to replicate to.
docker run --rm --name airbyte-destination -e POSTGRES_PASSWORD=password -p 2000:5432 -d postgres
trap 'kill $ABID; kill $AFID; kill $SSID; kill $PGID; exit' INT
(
cd ../../..
echo "Starting Airbyte..."
docker-compose down -v
docker-compose up -d
)&
ABID=$!
(
echo "Starting Airflow..."
docker-compose -f docker-compose-airflow.yaml down -v
docker-compose -f docker-compose-airflow.yaml up -d
)&
AFID=$!
(
echo "Starting Superset..."
docker-compose -f superset/docker-compose-superset.yaml down -v
docker-compose -f superset/docker-compose-superset.yaml up -d
)&
SSID=$!
(
echo "Creating PG destination (localhost:2000 postgres/password)"
docker rm --force airbyte-destination
docker run --rm --name airbyte-destination -e POSTGRES_PASSWORD=password -p 2000:5432 -d postgres
)&
PGID=$!
echo "Waiting for applications to start..."
wait
echo "Access Airbyte at http://localhost:8000 and set up a connection."
echo "Enter your Airbyte connection ID: "
read connection_id
# Set connection ID for DAG.
docker exec -ti airflow_webserver airflow variables set 'AIRBYTE_CONNECTION_ID' "$connection_id"
docker exec -ti airflow_webserver airflow connections add 'airbyte_example' --conn-uri 'airbyte://host.docker.internal:8000'
echo "Access Airflow at http://localhost:8085 to kick off your Airbyte sync DAG."
echo "Attempting to remove previous Superset installation."
docker-compose -f superset/docker-compose-superset.yaml down -v
docker-compose -f superset/docker-compose-superset.yaml up -d
echo "Access Superset at http://localhost:8088 to set up your dashboards."

0 comments on commit 8f43ba9

Please sign in to comment.