Skip to content

Commit

Permalink
Add: docker-airflow 환경 설정
Browse files Browse the repository at this point in the history
  • Loading branch information
gracia10 committed Nov 8, 2022
1 parent 78328e3 commit 8df1d26
Show file tree
Hide file tree
Showing 7 changed files with 1,872 additions and 1 deletion.
53 changes: 53 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# 이미지 생성시 사용할 이미지
FROM apache/airflow:2.4.2-python3.8

# 이미지 빌드, 컨테이너 실행 모두 사용가능한 환경변수
ENV AIRFLOW__KUBERNETES__FS_GROUP=50000
ENV AIRFLOW__KUBERNETES__RUN_AS_USER=50000

# 이미지 빌드(RUN)까지 사용가능한 변수
ARG DEST_INSTALL=/home/airflow

# (root) apt 패키지 추가
USER root
RUN apt-get update && \
apt-get install -y --no-install-recommends \
build-essential \
&& apt-get autoremove -yqq --purge \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

# (airflow) 새로운 PyPI 패키지 추가
USER airflow
WORKDIR ${DEST_INSTALL}

ENV PATH=${PATH}:/home/airflow/.local/bin

ARG UPDATE_PIP_VERSION_TO="22.3.1"
RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \
python get-pip.py --user pip==${UPDATE_PIP_VERSION_TO} && \
pip install pipenv

ENV PYTHONPATH="${AIRFLOW_HOME}:${PYTHONPATH}"

COPY Pipfile* ${DEST_INSTALL}/
RUN pipenv install --system --ignore-pipfile --deploy

# (root) airflow db 초기화 및 webserver 실행
USER root

### update entrypoint: add "airflow initdb" command
### before running the webserver
COPY ./entrypoint_* /
RUN sed -i "s/exec airflow.*/###/g" /entrypoint && \
cat /entrypoint_update_exec >> /entrypoint

ENV AIRFLOW__KUBERNETES__KUBE_CLIENT_REQUEST_ARGS=""

COPY ./dags/ ${AIRFLOW_HOME}/dags/

# Make sure Airflow is owned by airflow user
RUN chown -R "airflow" "${AIRFLOW_HOME}"

USER airflow
WORKDIR ${AIRFLOW_HOME}
108 changes: 108 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
alembic = "==1.8.1"
anyio = "==3.6.2"
apispec = "==3.3.2"
argcomplete = "==2.0.0"
attrs = "==22.1.0"
babel = "==2.11.0"
blinker = "==1.5"
cachelib = "==0.9.0"
cattrs = "==22.2.0"
certifi = "==2022.9.24"
cffi = "==1.15.1"
charset-normalizer = "==2.1.1"
click = "==8.1.3"
clickclick = "==20.10.2"
colorama = "==0.4.6"
colorlog = "==4.8.0"
commonmark = "==0.9.1"
configupdater = "==3.1.1"
connexion = "==2.14.1"
cron-descriptor = "==1.2.31"
croniter = "==1.3.7"
cryptography = "==38.0.3"
deprecated = "==1.2.13"
dill = "==0.3.6"
dnspython = "==2.2.1"
docutils = "==0.19"
email-validator = "==1.3.0"
exceptiongroup = "==1.0.1"
graphviz = "==0.20.1"
gunicorn = "==20.1.0"
h11 = "==0.12.0"
httpcore = "==0.15.0"
httpx = "==0.23.0"
idna = "==3.4"
importlib-metadata = "==5.0.0"
importlib-resources = "==5.10.0"
inflection = "==0.5.1"
itsdangerous = "==2.1.2"
jinja2 = "==3.1.2"
jsonschema = "==4.17.0"
lazy-object-proxy = "==1.8.0"
linkify-it-py = "==2.0.0"
lockfile = "==0.12.2"
mako = "==1.2.3"
markdown = "==3.4.1"
markdown-it-py = "==2.1.0"
markupsafe = "==2.1.1"
marshmallow = "==3.18.0"
marshmallow-enum = "==1.5.1"
marshmallow-oneofschema = "==3.0.1"
marshmallow-sqlalchemy = "==0.26.1"
mdit-py-plugins = "==0.3.1"
mdurl = "==0.1.2"
packaging = "==21.3"
pathspec = "==0.9.0"
pendulum = "==2.1.2"
pkgutil-resolve-name = "==1.3.10"
pluggy = "==1.0.0"
prison = "==0.2.1"
psutil = "==5.9.4"
pycparser = "==2.21"
pygments = "==2.13.0"
pyjwt = "==2.6.0"
pyparsing = "==3.0.9"
pyrsistent = "==0.19.2"
python-daemon = "==2.3.2"
python-dateutil = "==2.8.2"
python-nvd3 = "==0.15.0"
python-slugify = "==6.1.2"
pytz = "==2022.6"
pytzdata = "==2020.1"
pyyaml = "==6.0"
requests = "==2.28.1"
requests-toolbelt = "==0.10.1"
rfc3986 = "==1.5.0"
rich = "==12.6.0"
setproctitle = "==1.3.2"
six = "==1.16.0"
sniffio = "==1.3.0"
sqlalchemy = "==1.4.43"
sqlalchemy-jsonfield = "==1.0.0"
sqlalchemy-utils = "==0.38.3"
sqlparse = "==0.4.3"
swagger-ui-bundle = "==0.0.9"
tabulate = "==0.9.0"
tenacity = "==8.1.0"
termcolor = "==2.1.0"
text-unidecode = "==1.3"
typing-extensions = "==4.4.0"
uc-micro-py = "==1.0.1"
unicodecsv = "==0.14.1"
urllib3 = "==1.26.12"
werkzeug = "==2.2.2"
wrapt = "==1.14.1"
wtforms = "==3.0.1"
zipp = "==3.10.0"
azure-servicebus = "==7.8.1"

[dev-packages]

[requires]
python_version = "3.7"
Loading

0 comments on commit 8df1d26

Please sign in to comment.