Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kai.wang/new baseon latest aws airflow #260

Open
wants to merge 3 commits into
base: v2.5.1
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ VERSION
## Get started

```bash
git clone https://github.com/aws/aws-mwaa-local-runner.git
compass repo get aws-mwaa-local-runner
cd aws-mwaa-local-runner
```

Expand Down
2 changes: 2 additions & 0 deletions docker/config/webserver_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@

basedir = os.path.abspath(os.path.dirname(__file__))

AUTH_ROLE_PUBLIC = "Admin"

# The SQLAlchemy connection string.
SQLALCHEMY_DATABASE_URI = conf.get('core', 'SQL_ALCHEMY_CONN')

Expand Down
4 changes: 3 additions & 1 deletion docker/docker-compose-local.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
version: '3.7'
volumes:
postgres_data: {}
services:
postgres:
image: postgres:10-alpine
Expand All @@ -11,7 +13,7 @@ services:
max-size: 10m
max-file: "3"
volumes:
- "${PWD}/db-data:/var/lib/postgresql/data"
- "postgres_data:/var/lib/postgresql/data"

local-runner:
image: amazon/mwaa-local:2_5
Expand Down
2 changes: 1 addition & 1 deletion docker/docker-compose-resetdb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ services:
max-size: 10m
max-file: "3"
volumes:
- "${PWD}/db-data:/var/lib/postgresql/data"
- "postgres_data:/var/lib/postgresql/data"

resetdb:
image: amazon/mwaa-local:2_5
Expand Down
8 changes: 6 additions & 2 deletions docker/script/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ install_requirements() {
fi
fi
echo "Installing requirements.txt"
pip3 install --user -r "$AIRFLOW_HOME/$REQUIREMENTS_FILE"
pip3 install --user -r "$AIRFLOW_HOME/$REQUIREMENTS_FILE" --force-reinstall
fi
}

Expand Down Expand Up @@ -131,13 +131,17 @@ case "$1" in
export AIRFLOW__CORE__LOAD_EXAMPLES="False"

install_requirements
# Forward ports for App Domain. 192.168.5.2 is the host system IP. This should be host.lima.internal, but that DNS
# entry is currently broken. The IP should be static however.
socat TCP4-LISTEN:31337,fork,reuseaddr TCP4:192.168.5.2:31337 &
socat TCP4-LISTEN:31338,fork,reuseaddr TCP4:192.168.5.2:31338 &
airflow db init
if [ "$AIRFLOW__CORE__EXECUTOR" = "LocalExecutor" ] || [ "$AIRFLOW__CORE__EXECUTOR" = "SequentialExecutor" ]; then
# With the "Local" and "Sequential" executors it should all run in one container.
airflow scheduler &
sleep 2
fi
airflow users create -r Admin -u admin -e [email protected] -f admin -l user -p $DEFAULT_PASSWORD

exec airflow webserver
;;
resetdb)
Expand Down
3 changes: 3 additions & 0 deletions docker/script/systemlibs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ yum install -y nc
# Needed for generating fernet key for local runner
yum install -y python2-cryptography

# Needed to forward App Domain related ports: 31337, 31338
yum install -y socat

# Install additional system library dependencies. Provided as a string of libraries separated by space
if [ -n "${SYSTEM_DEPS}" ]; then yum install -y "${SYSTEM_DEPS}"; fi

Expand Down
5 changes: 2 additions & 3 deletions requirements/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
--constraint "https://raw.githubusercontent.com/apache/airflow/constraints-2.5.1/constraints-3.10.txt"
# --constraint "https://raw.githubusercontent.com/apache/airflow/constraints-2.5.1/constraints-3.10.txt"

apache-airflow-providers-snowflake==4.0.2
apache-airflow-providers-mysql==4.0.0
/usr/local/airflow/plugins/demo_airflow-0.0.0-py3-none-any.whl