Skip to content
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: 2 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ on:
branches: [ main ]

env:
BASE_URL_HOST: localhost:8081
ENABLE_PROXY_FIX: False
AIRFLOW_PROJ_DIR: /home/runner/work/AlertFlow/AlertFlow/alertflow
AIRFLOW_HOME: /opt/airflow
AIRFLOW_PORT: 8081
Expand Down
4 changes: 2 additions & 2 deletions alertflow/airflow.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ default_hive_mapred_queue =
# The base url of your website as airflow cannot guess what domain or
# cname you are using. This is used in automated emails that
# airflow sends to point links to the right web server
base_url = http://localhost:8080
base_url = http://$BASE_URL_HOST

# Default timezone to display all dates in the UI, can be UTC, system, or
# any IANA timezone string (e.g. Europe/Amsterdam). If left empty the
Expand Down Expand Up @@ -648,7 +648,7 @@ navbar_color = #fff
default_dag_run_display_number = 25

# Enable werkzeug ``ProxyFix`` middleware for reverse proxy
enable_proxy_fix = False
enable_proxy_fix = $ENABLE_PROXY_FIX

# Number of values to trust for ``X-Forwarded-For``.
# More info: https://werkzeug.palletsprojects.com/en/0.16.x/middleware/proxy_fix/
Expand Down
103 changes: 0 additions & 103 deletions alertflow/dags/episcanner/episcanner_export_data.py

This file was deleted.

2 changes: 1 addition & 1 deletion alertflow/dags/satellite-weather/brasil.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
tags=['Brasil', 'Copernicus'],
schedule='@daily',
default_args=DEFAULT_ARGS,
start_date=pendulum.datetime(2014, 1, 1),
start_date=pendulum.datetime(2023, 8, 1),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the start date is expected to change over time, perhaps it would be better to create a function that calculates the initial date dynamically, instead of hardcoding it in the code.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This start date is only important to reduce the amount of days the DAG will have to check for incomplete data. I've ran many times locally and I'm sure there's no missing data before 2023/aug. but for now on, it thing it would be good to keep this date, then every time the container is rebuilt, it will check for possible missing data

catchup=True,
max_active_runs=14,
):
Expand Down
9 changes: 6 additions & 3 deletions conda/env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@ channels:
- conda-forge
- nodefaults
dependencies:
- python 3.*
- docker-compose
- pip
- poetry
- pre-commit
- blue
- flake8
- isort
- python 3.*
- docker-compose
- pip
- pip:
- tomli
11 changes: 1 addition & 10 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM apache/airflow:2.5.3
FROM apache/airflow:2.6.3

LABEL maintainer="Luã Bida Vacaro <[email protected]>"
LABEL org.opencontainers.image.title="AlertFlow"
Expand Down Expand Up @@ -74,13 +74,4 @@ RUN /usr/local/bin/python -m virtualenv /opt/envs/py310 --python="/opt/py310/bin
"satellite-weather-downloader >= 1.8.4" \
psycopg2

# Install conda and create environment
RUN curl -LO https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-Linux-x86_64.sh \
&& bash Mambaforge-Linux-x86_64.sh -b -p /home/airflow/mambaforge \
&& rm Mambaforge-Linux-x86_64.sh \
&& /home/airflow/mambaforge/bin/mamba create -y -n episcanner-downloader python=3.11 poetry psycopg2 python-dotenv \
&& chown -R ${HOST_UID}:${HOST_GID} ${AIRFLOW_HOME}/ /home/airflow/mambaforge/

RUN echo "alias activate_episcanner='source /home/airflow/mambaforge/bin/activate episcanner-downloader'" >> /home/airflow/.bashrc
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!


ENTRYPOINT [ "/entrypoint.sh" ]
2 changes: 2 additions & 0 deletions env.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ HOST_UID=${HOST_UID}
HOST_GID=${HOST_GID}

# Web
BASE_URL_HOST=${BASE_URL_HOST}
_AIRFLOW_WWW_USER_USERNAME=${_AIRFLOW_WWW_USER_USERNAME}
_AIRFLOW_WWW_USER_PASSWORD=${_AIRFLOW_WWW_USER_USERNAME}
_AIRFLOW_WWW_USER_EMAIL=${_AIRFLOW_WWW_USER_EMAIL}
_AIRFLOW_WWW_USER_FIRST_NAME=${_AIRFLOW_WWW_USER_FIRST_NAME}
_AIRFLOW_WWW_USER_LAST_NAME=${_AIRFLOW_WWW_USER_LAST_NAME}
ENABLE_PROXY_FIX=${ENABLE_PROXY_FIX}

# Email
EMAIL_MAIN=${EMAIL_MAIN}
Expand Down