-
Notifications
You must be signed in to change notification settings - Fork 8
/
install.sh
48 lines (40 loc) · 1.44 KB
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# You can freely edit this file based on your needs
export AIRFLOW_HOME=$(pwd)
#If you used Linux system, if not. Skip this steps
sudo apt-get install -y --no-install-recommends \
freetds-bin \
krb5-user \
ldap-utils \
libffi6 \
libsasl2-2 \
libsasl2-modules \
libssl1.1 \
locales \
lsb-release \
sasl2-bin \
sqlite3 \
unixodbc
AIRFLOW_VERSION=2.0.2
PYTHON_VERSION="$(python --version | cut -d " " -f 2 | cut -d "." -f 1-2)"
CONSTRAINT_URL="https://raw.githubusercontent.com/apache/airflow/constraints-${AIRFLOW_VERSION}/constraints-${PYTHON_VERSION}.txt"
pip install "apache-airflow[async,postgres,google]==${AIRFLOW_VERSION}" --constraint "${CONSTRAINT_URL}"
pip install xlrd
pip install openpyxl
#Init DB based on AIRFLOW_HOME path
airflow db init
#Create account to login to Airflow web
AIRFLOW_USERNAME=admin
AIRFLOW_FIRSTNAME=Data
AIRFLOW_LASTNAME=Engineer
airflow users create \
--username "${AIRFLOW_USERNAME}" \
--firstname "${AIRFLOW_FIRSTNAME}" \
--lastname "${AIRFLOW_LASTNAME}" \
--role Admin \
--email "${AIRFLOW_EMAIL}"
#Run on 1st terminal
airflow webserver --port 8080
#Run on separate terminal, but you have to export the AIRFLOW_HOME variable again before run this command
airflow scheduler
#Then open localhost:8080 on your browser and input your username and password that you just created