Created
May 20, 2021 15:07
-
-
Save 1ambda/bf1bb9b8f9a31282efcf3eeccf8842db to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Airflow Worker 가 실행될 Kubernetes Pod 을 설정합니다. | |
executorConfig = ExecutorBuilder( | |
image = "dask-py38", | |
resource = { memory: "80960Mi", cpu: "32" }, | |
resourceCapacityType = "SPOT", | |
resourceNodeSelector = { "compute-type": "airflow-cpu-intensive", ... }, | |
notebookCustomPackages = ["pandas==1.2.3", "pyarrow==3.0.0"], | |
notebookKernel = "python38", | |
... | |
) | |
with dag: | |
# 필요한 데이터가 준비되었는지 확인하며 기다립니다 | |
taskDependencyWait = ... | |
# Papermill API 를 이용해 전달받은 ipynb 노트북을 실행합니다 | |
taskNotebook = NotebookOperator( | |
executor_config = executorConfig, | |
... | |
notebookPath = "...", # EFS 내 실행할 ipynb 노트북 경로 | |
notebookParameter = { ... }, # 사용자가 노트북에 전달할 Papermill 파라미터 | |
notebookNotification = { ... }, # Slack 등 알림을 보내기 위한 정보 | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment