Skip to content
This repository was archived by the owner on Feb 28, 2025. It is now read-only.

Commit 8f43ba9

Browse files
avaidyanathaAbhi Vaidyanatha
and
Abhi Vaidyanatha
authored
Quality of life changes to Airflow Demo (airbytehq#4895)
Co-authored-by: Abhi Vaidyanatha <[email protected]>
1 parent 1fedca9 commit 8f43ba9

File tree

1 file changed

+28
-13
lines changed
  • resources/examples/airflow

1 file changed

+28
-13
lines changed

resources/examples/airflow/up.sh

+28-13
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,37 @@
11
#!/usr/bin/env bash
2-
cd ../../..
3-
echo "Attempting to remove previous Airbyte installation..."
4-
docker-compose down -v
5-
docker-compose up -d
6-
cd resources/examples/airflow || exit
7-
echo "Attempting to remove previous Airflow installation..."
8-
docker-compose -f docker-compose-airflow.yaml down -v
9-
docker-compose -f docker-compose-airflow.yaml up -d
10-
# Create Postgres Database to replicate to.
11-
docker run --rm --name airbyte-destination -e POSTGRES_PASSWORD=password -p 2000:5432 -d postgres
2+
trap 'kill $ABID; kill $AFID; kill $SSID; kill $PGID; exit' INT
3+
(
4+
cd ../../..
5+
echo "Starting Airbyte..."
6+
docker-compose down -v
7+
docker-compose up -d
8+
)&
9+
ABID=$!
10+
(
11+
echo "Starting Airflow..."
12+
docker-compose -f docker-compose-airflow.yaml down -v
13+
docker-compose -f docker-compose-airflow.yaml up -d
14+
)&
15+
AFID=$!
16+
(
17+
echo "Starting Superset..."
18+
docker-compose -f superset/docker-compose-superset.yaml down -v
19+
docker-compose -f superset/docker-compose-superset.yaml up -d
20+
)&
21+
SSID=$!
22+
(
23+
echo "Creating PG destination (localhost:2000 postgres/password)"
24+
docker rm --force airbyte-destination
25+
docker run --rm --name airbyte-destination -e POSTGRES_PASSWORD=password -p 2000:5432 -d postgres
26+
)&
27+
PGID=$!
28+
echo "Waiting for applications to start..."
29+
wait
1230
echo "Access Airbyte at http://localhost:8000 and set up a connection."
1331
echo "Enter your Airbyte connection ID: "
1432
read connection_id
1533
# Set connection ID for DAG.
1634
docker exec -ti airflow_webserver airflow variables set 'AIRBYTE_CONNECTION_ID' "$connection_id"
1735
docker exec -ti airflow_webserver airflow connections add 'airbyte_example' --conn-uri 'airbyte://host.docker.internal:8000'
1836
echo "Access Airflow at http://localhost:8085 to kick off your Airbyte sync DAG."
19-
echo "Attempting to remove previous Superset installation."
20-
docker-compose -f superset/docker-compose-superset.yaml down -v
21-
docker-compose -f superset/docker-compose-superset.yaml up -d
2237
echo "Access Superset at http://localhost:8088 to set up your dashboards."

0 commit comments

Comments
 (0)