inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

묻고 답해요

172만명의 커뮤니티!! 함께 토론해봐요.

파이참에서 외부 파이썬 함수 수행하기

해결됨

Airflow 마스터 클래스

안녕하세요. 외부 파이썬 함수 수행하기가 안되어서 문의드리게 되었습니다. 저는 Pycharm이 익숙해서 Pycharm으로 하고 있었는데, Pycharm의 경우 .env파일이 인식이 안되는 걸까요..? common 모듈을 발견하지 못하네요... .env파일을 아래와 같이 설정하였고 dags_python_import_ func.py 에서도 Enable EnvFile에 체크표시를 하였는데 여전히 해당 모듈을 읽지 못하네요...ㅠㅠ 혹시 Pycharm의 경우 .env파일을 다르게 설정해야하는 걸까요...?

  • python
  • 데이터-엔지니어링
  • airflow
rosy 댓글 2 좋아요 0 조회수 619

xcom_pull 메서드 사용 질문

미해결

Airflow 마스터 클래스

안녕하세요 강의에서 xcom_pull 메서드 사용시 task_ids를 지정하지 않으면 가장 마지막 태스크의 키값을 가져온다고 하셨는데요, 실습코드를 돌려보니 먼저 실행되었던 태스크의 밸류값을 리턴합니다. from airflow import DAG import pendulum from airflow.decorators import task with DAG( dag_id="dags_python_with_xcom_eg1", schedule="30 6 * * *", start_date=pendulum.datetime(2024, 3, 1, tz="Asia/Seoul"), catchup=False, ) as dag: @task(task_id="python_xcom_push_task1") def xcom_push1(**kwargs): ti = kwargs["ti"] ti.xcom_push(key="result1", value="value_1") ti.xcom_push(key="result2", value=[1, 2, 3, 4]) @task(task_id="python_xcom_push_task2") def xcom_push2(**kwargs): ti = kwargs["ti"] ti.xcom_push(key="reuslt1", value="value_2") ti.xcom_push(key="reuslt2", value=[1, 2, 3]) @task(task_id="python_xcom_pull_task") def xcom_pull(**kwargs): ti = kwargs["ti"] value1 = ti.xcom_pull(key="result2") # [1, 2, 3] value2 = ti.xcom_pull( key="result1", task_ids="python_xcom_push_task1" ) # value_1 print(value1) print(value2) xcom_push1() >> xcom_push2() >> xcom_pull() dag는 위와 같이 작성했고요, [1, 2, 3]이 반환될 것으로 기대했던 부분에서 [1, 2, 3, 4]가 반환되어서 혹시 제가 코드를 잘못 작성한건지 궁금해서 여쭤봅니다

  • python
  • 데이터-엔지니어링
  • airflow
방효석 댓글 2 좋아요 0 조회수 351

show_templates() 함수의 키워드 아규먼트 질문

해결됨

Airflow 마스터 클래스

안녕하세요 강사님! dags_python_with_ templates.py 파일에서 show_templates 함수를 아무 인자도 넣지 않고 실행을 시키는데요, dag 실행시 출력되는 키워드 인자들은 에어플로우 태스크 객체에 기본으로 입력되는 값들인가요? 정확한 원리가 궁금하여 여쭤봅니다

  • python
  • 데이터-엔지니어링
  • airflow
방효석 댓글 2 좋아요 0 조회수 335

ubuntu 응답없음

해결됨

Airflow 마스터 클래스

powershell에서 wsl --install을 입력한 후에 ubuntu 시작하는중... 이 출력되고 그 다음에 응답이 없는데 이런 경우 어떻게 해야할까요?

  • python
  • 데이터-엔지니어링
  • airflow
rosy 댓글 1 좋아요 0 조회수 420

docker daemon 실행 문제

미해결

Airflow 마스터 클래스

섹션 1 docker 설치 단계에서 sudo service docker start 입력하면 Starting Docker: docker [OK] 라고 나옵니다. 하지만 sudo docker run hello-world 입력 하면 docker daemon이 연결되지 않는다고 나옵니다. sudo service docker status 입력해서 확인해 보니 Docker is not running 상태로 지속되고 있습니다. sudo service docker restart 입력하고 해도 동일한 현상이 나옵니다. /var/log/docker.log를 열어 확인해보니 아래에 나와있듯이 plugin 로딩 시 에러가 나오는 것 같습니다. 애초에 알려주신 https://docs.docker.com/engine/install/ubuntu 링크의 docker 설치 명령어가 지난 몇달 사이에 바뀌었는지, 강의영상에서의 설치 명령어와 약간 달랐습니다. 이 링크에서의 명령어를 사용하지 않고 강의영상에서의 명령어로 입력하면 문제가 해결될까요? 아니면 다른 방법이 있는지 문의드립니다.

  • python
  • 데이터-엔지니어링
  • airflow
홍창기 댓글 1 좋아요 0 조회수 583

제목과 영상이 다른것 같아요~

해결됨

Airflow 마스터 클래스

Task 실패시 email 발송하기 sla 로 task 수행현황 감시하고 email 발송하기 이 두개의 영상이 바뀐것 같아 보입니다 확인 해봐주세요~

  • python
  • 데이터-엔지니어링
  • airflow
qkswl6253 댓글 1 좋아요 0 조회수 263

파이썬 외부함수 임포트 경로 질문

미해결

Airflow 마스터 클래스

안녕하세요 강사님 실습 따라서 코드 작성하고 dags_python_import_ func.py 대그 에어플로우에 올려서 테스트해봤는데 계속 임포트 에러가 나서 질문드립니다. 제 실습환경이 강의의 실습환경과 달라서 그러는건지 잘 모르겠는데 제 실습환경은 아래와 같습니다. 이 상태에서 common.common_func 경로로 get_sftp 함수 임포트하면 moduleNotFoundError가 발생합니다. plugins를 포함해도 동일하고요ㅜ 어떤게 문제인지 알려주실 수 있을까요?

  • python
  • 데이터-엔지니어링
  • airflow
방효석 댓글 1 좋아요 0 조회수 307

docker-compose.yaml 파일 관련 질문

해결됨

Airflow 마스터 클래스

안녕하세요 강사님, 강의 열심히 듣고 있는데요 docker-compose.yaml 파일의 volume 부분 설명해주신게 잘 이해가 가지 않습니다. : 기준으로 왼쪽이 WSL, 오른쪽이 docker container의 volume이고 둘을 매칭해주는거라고 설명해주셨는데 두개가 같은거 아닌가요? wsl 환경에서 docker를 셋업하고 에어플로우 태스크를 실행시키는걸로 이해하고 있거든요. 참고로 저는 맥 환경에서 실습중이라 WSL은 설치 안하고 그냥 디렉토리만 local과 remote로 구분해놓고 remote에 도커 셋업해서 실습중입니다. 그럼 제 기준에선 : 왼쪽이 remote 디렉토리이고 오른쪽이 docker container 인건가요?

  • python
  • 데이터-엔지니어링
  • airflow
방효석 댓글 2 좋아요 0 조회수 425

mac 환경에서 실습 질문

미해결

Airflow 마스터 클래스

안녕하세요 🙂 Mac환경에서 실습을 하고 있습니다. 제 로컬에 Statground 폴더와 vscode 폴더를 만들어서 vscode/dags 경로에서 실습 코드를 작성하여 git에 올리고 Statground에 pull 받아서 실습을 진행하고 있었습니다. WSL을 사용하지 않는데, git에 push하고 Pull 할 필요 없이 Statground/airflow/dags 경로에 바로 실습 파일을 작성해서 진행해도 되는 건가요?

  • python
  • 데이터-엔지니어링
  • airflow
현지원 댓글 2 좋아요 0 조회수 365

SQLAlchemy 2.X 지원

미해결

Airflow 마스터 클래스

구글링해보면 Airflow가 전체적으로 2.X 지원을 준비하는 것 같긴 합니다만, docker-compose로 airflow 2.8.4 docker를 설치하면 SQLAlchemy가 1.4.X가 설치되는 것 같습니다. 저희가 만든 Dags는 내부에 SQLAlchemdy 2.X를 사용해서 DB 접근을 하는 코드가 있는데 Airflow에 SQLAlchemy 2.X를 설치해서 쓰는 방법이 있을까요? 예를 들면, dags를 실행하는 Airflow-worker에 SQLAlchemy 최신 버전을 pip install로 설치한다던지요.. 또는 기본 Base가 되는 이미지에 2.X로 업그레이드 시키거나, worker에 2.X를 설치할 때 Airflow의 기존 로직들은 이상이 없을지요? 아니면, 아래처럼 virtual env 방식으로 SQLAlchemy를 설치하는 식으로 사용해야 할까요? @task.virtualenv( task_id="virtualenv_python", requirements=["SQLAlchemy==2.0.0"], system_site_packages=False ) 일반적으로 사용하는 방법에 대해 궁금합니다. 감사합니다.

  • python
  • 데이터-엔지니어링
  • airflow
  • sqlalchemy
강운천 댓글 1 좋아요 0 조회수 560

공공데이터 받아오기 - XML형식 표시하기 질문

해결됨

Airflow 마스터 클래스

항상 강의 감사드립니다. SimpleHttp오퍼레이터로 공공데이터 받아오기 실습부분에 질문이 있습니다. 강의에서는 Json형식의 데이터를 받아와 load함수를 사용하셨는데요, 제가 받아온 데이터는 xml형식이어서 코드를 수정해가며 실습을 진행했습니다. 구글링을 통해 필요한 라이브러리를 가져와 다음과 같이 코드를 수정했습니다. import pendulum from airflow import DAG from airflow.operators.bash import BashOperator from airflow.providers.http.operators.http import SimpleHttpOperator from airflow.decorators import task with DAG( dag_id='dags_simple_http_operator', start_date=pendulum.datetime(2024, 3, 1, tz='Asia/Seoul'), schedule=None, catchup=False ) as dag: '''서울시 공공데이터 정보''' # http://openapi.seoul.go.kr:8088/(인증키)/xml/TnJbhntBassOpen/1/5/ get_hr_data = SimpleHttpOperator( task_id='get_hr_data', http_conn_id='openapi.seoul.go.kr', endpoint='{{var.value.apikey_openapi_seoul_go_kr}}/xml/TnJbhntBassOpen/1/10/', method='GET', headers={ 'Content-Type':'application/json', 'charset':'utf-8', 'Accept':'*/*' } ) @task(task_id='python_2') def python_2(**kwargs): ti = kwargs['ti'] rslt = ti.xcom_pull(task_ids='get_hr_data') # SimpleHttpOperator가 가진 데이터를 가져오기 import xml.etree.ElementTree as ET from pprint import pprint root = ET.fromstring(rslt) print(f'root : {root}, root/tag : {root.tag}, root/attrib : {root.attrib}') # for child in root: # print(child.tag, child.attrib) for child in root: print(f'Tag : {child.tag}, Content : {child.text}') get_hr_data >> python_2() (pprint라이브러리는 오류가 생겨 사용하지 않았습니다) python_2 태스크의 Logs결과입니다 : [2024-03-25, 00:18:05 KST] {logging_mixin.py:188} INFO - Tag : list_total_count, Content : 827 [2024-03-25, 00:18:05 KST] {logging_mixin.py:188} INFO - Tag : RESULT, Content : [2024-03-25, 00:18:05 KST] {logging_mixin.py:188} INFO - Tag : row, Content : [2024-03-25, 00:18:05 KST] {logging_mixin.py:188} INFO - Tag : row, Content : 결론적으로 내용들이 표시가 되지 않는데, 이유가 무엇인가요? (child.attrib함수도 시도해보았지만, 역시 담는 내용이 없었습니다) 문서는 다음 문서를 참고하였습니다 : https://docs.python.org/ko/3/library/xml.etree.elementtree.html#xml-tree-and-elements

  • python
  • 데이터-엔지니어링
  • airflow
hpsm5187 댓글 2 좋아요 0 조회수 327

airflow 실행 시 webserver가 안 띄워져요

미해결

Airflow 마스터 클래스

airflow를 초기화한 후 docker compose up으로 airflow를 실행하는 과정에서 webserver가 구동이 되지않습니다.. {webserver_ command.py:222 } ERROR - No response from gunicorn master within 120 seconds {webserver_ command.py:223 } ERROR - Shutting down webserver 위에 에러를 해결하기 위해 검색했을때 airflow.cfg의 작업자 수를 줄이라는 해결책이 있었지만 airflow폴더내에 airflow.cfg파일은 없었습니다. 또한 airflow의 config파일내에도 아무파일도 없구요 +) Please install connexion with extra install: pip install connexion[swagger-ui] 혹시 위에 에러와 관련이 있을까요?

  • python
  • 데이터-엔지니어링
  • airflow
김소윤 댓글 1 좋아요 0 조회수 537

airflow 화면 사용자이름과 비밀번호

미해결

Airflow 마스터 클래스

안녕하세요, 강의내용대로 다른 데스트탑에서 airflow docker 까지 다 작동이 되는데 localhost:8080 에서 사용자이름과 비밀번호가 'airflow'로 인증이 안되는데요 어떻게 하지요?

  • python
  • 데이터-엔지니어링
  • airflow
Lotus 댓글 2 좋아요 0 조회수 802

sqlalchemy.create_engine으로 생성한 객체에 cursor가 없습니다.

미해결

Airflow 마스터 클래스

전체 에러 로그: 8fbc4f9f281a *** Found local files: *** * /opt/airflow/logs/dag_id=dags_python_with_custom_hook_bulk_load/run_id=manual__2024-03-06T03:55:34.102649+00:00/task_id=insrt_postgres/attempt=1.log [2024-03-06T03:55:35.452+0000] {taskinstance.py:1979} INFO - Dependencies all met for dep_context=non-requeueable deps ti=<TaskInstance: dags_python_with_custom_hook_bulk_load.insrt_postgres manual__2024-03-06T03:55:34.102649+00:00 [queued]> [2024-03-06T03:55:35.456+0000] {taskinstance.py:1979} INFO - Dependencies all met for dep_context=requeueable deps ti=<TaskInstance: dags_python_with_custom_hook_bulk_load.insrt_postgres manual__2024-03-06T03:55:34.102649+00:00 [queued]> [2024-03-06T03:55:35.456+0000] {taskinstance.py:2193} INFO - Starting attempt 1 of 1 [2024-03-06T03:55:35.464+0000] {taskinstance.py:2214} INFO - Executing <Task(PythonOperator): insrt_postgres> on 2024-03-06 03:55:34.102649+00:00 [2024-03-06T03:55:35.469+0000] {standard_task_runner.py:60} INFO - Started process 262 to run task [2024-03-06T03:55:35.471+0000] {standard_task_runner.py:87} INFO - Running: ['***', 'tasks', 'run', 'dags_python_with_custom_hook_bulk_load', 'insrt_postgres', 'manual__2024-03-06T03:55:34.102649+00:00', '--job-id', '620', '--raw', '--subdir', 'DAGS_FOLDER/dags_python_with custom_hook_bulk_load.py', '--cfg-path', '/tmp/tmp0zav_1t7'] [2024-03-06T03:55:35.472+0000] {standard_task_runner.py:88} INFO - Job 620: Subtask insrt_postgres [2024-03-06T03:55:35.504+0000] {task_command.py:423} INFO - Running <TaskInstance: dags_python_with_custom_hook_bulk_load.insrt_postgres manual__2024-03-06T03:55:34.102649+00:00 [running]> on host 8fbc4f9f281a [2024-03-06T03:55:35.555+0000] {taskinstance.py:2510} INFO - Exporting env vars: AIRFLOW_CTX_DAG_OWNER='***' AIRFLOW_CTX_DAG_ID='dags_python_with_custom_hook_bulk_load' AIRFLOW_CTX_TASK_ID='insrt_postgres' AIRFLOW_CTX_EXECUTION_DATE='2024-03-06T03:55:34.102649+00:00' AIRFLOW_CTX_TRY_NUMBER='1' AIRFLOW_CTX_DAG_RUN_ID='manual__2024-03-06T03:55:34.102649+00:00' [2024-03-06T03:55:35.556+0000] {custom_postgres_hook.py:24} INFO - 적재 대상 파일: /opt/***/files/TbCorona19CountStatus/20240306/TbCorona19CountStatus.csv [2024-03-06T03:55:35.556+0000] {custom_postgres_hook.py:25} INFO - 테이블 :TbCorona19CountStatus_bulk2 [2024-03-06T03:55:35.562+0000] {base.py:83} INFO - Using connection ID 'conn-db-postgres-custom' for task execution. [2024-03-06T03:55:35.582+0000] {custom_postgres_hook.py:34} INFO - TbCorona19CountStatus_bulk2.S_DT: 개행문자 제거 [2024-03-06T03:55:35.583+0000] {custom_postgres_hook.py:34} INFO - TbCorona19CountStatus_bulk2.T_DT: 개행문자 제거 [2024-03-06T03:55:35.583+0000] {custom_postgres_hook.py:38} INFO - 적재 건수:1212 [2024-03-06T03:55:35.583+0000] {custom_postgres_hook.py:40} INFO - postgresql://***:***@172.28.0.3/*** [2024-03-06T03:55:35.587+0000] {warnings.py:110} WARNING - /opt/***/plugins/hooks/custom_postgres_hook.py:43: UserWarning: pandas only supports SQLAlchemy connectable (engine/connection) or database string URI or sqlite3 DBAPI2 connection. Other DBAPI2 objects are not tested. Please consider using SQLAlchemy. file_df.to_sql(name = table_name, [2024-03-06T03:55:35.589+0000] {taskinstance.py:2728} ERROR - Task failed with exception Traceback (most recent call last): File "/home/airflow/.local/lib/python3.11/site-packages/airflow/models/taskinstance.py", line 444, in execute task result = execute callable(context=context, **execute_callable_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/airflow/.local/lib/python3.11/site-packages/airflow/models/taskinstance.py", line 414, in execute callable return execute_callable(context=context, **execute_callable_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/airflow/.local/lib/python3.11/site-packages/airflow/operators/python.py", line 200, in execute return_value = self.execute_callable() ^^^^^^^^^^^^^^^^^^^^^^^ File "/home/airflow/.local/lib/python3.11/site-packages/airflow/operators/python.py", line 217, in execute_callable return self.python_callable(*self.op_args, **self.op_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/airflow/dags/dags_python_with custom_hook_bulk_load.py", line 14, in insrt_postgres custom_postgres_hook.bulk_load(table_name=tbl_nm, file_name=file_nm, delimiter=',', File "/opt/airflow/plugins/hooks/custom_postgres_hook.py", line 43, in bulk_load file_df.to_sql(name = table_name, File "/home/airflow/.local/lib/python3.11/site-packages/pandas/util/_decorators.py", line 333, in wrapper return func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/home/airflow/.local/lib/python3.11/site-packages/pandas/core/generic.py", line 3084, in to_sql return sql.to_sql( ^^^^^^^^^^^ File "/home/airflow/.local/lib/python3.11/site-packages/pandas/io/sql.py", line 842, in to_sql return pandas_sql.to_sql( ^^^^^^^^^^^^^^^^^^ File "/home/airflow/.local/lib/python3.11/site-packages/pandas/io/sql.py", line 2848, in to_sql table.create() File "/home/airflow/.local/lib/python3.11/site-packages/pandas/io/sql.py", line 984, in create if self.exists(): ^^^^^^^^^^^^^ File "/home/airflow/.local/lib/python3.11/site-packages/pandas/io/sql.py", line 970, in exists return self.pd_sql.has_table(self.name, self.schema) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/airflow/.local/lib/python3.11/site-packages/pandas/io/sql.py", line 2863, in has_table return len(self.execute(query, [name]).fetchall()) > 0 ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/airflow/.local/lib/python3.11/site-packages/pandas/io/sql.py", line 2670, in execute cur = self.con.cursor() ^^^^^^^^^^^^^^^ AttributeError: 'Engine' object has no attribute 'cursor' [2024-03-06T03:55:35.597+0000] {taskinstance.py:1149} INFO - Marking task as FAILED. dag_id=dags_python_with_custom_hook_bulk_load, task_id=insrt_postgres, execution_date=20240306T035534, start_date=20240306T035535, end_date=20240306T035535 [2024-03-06T03:55:35.605+0000] {standard_task_runner.py:107} ERROR - Failed to execute job 620 for task insrt_postgres ('Engine' object has no attribute 'cursor'; 262) [2024-03-06T03:55:35.643+0000] {local_task_job_runner.py:234} INFO - Task exited with return code 1 [2024-03-06T03:55:35.655+0000] {taskinstance.py:3309} INFO - 0 downstream tasks scheduled from follow-on schedule check 결과로 cursor가 attribute로 없다는 오류가 발생합니다. 기존에 있던 이후 글은 글자수 제한으로 삭제합니다.

  • python
  • 데이터-엔지니어링
  • airflow
김유민 댓글 3 좋아요 0 조회수 4162

외부 파이썬 함수 수행하기 - workspace folder 질문

해결됨

Airflow 마스터 클래스

알찬 강의 항상 감사드립니다. 작업 위치1 (vsc상에서 작성하고 git push를 하는 위치) : [~/Desktop/airflow강의] 작업 위치2 (WSL에서 git pull을 하는 위치) : [~/airflow] 저는 위와 같은 경로상에서 수업 실습을 진행하고 있으며, '외부 파이썬 함수 수행하기' 강의에서 .env 파일을 다음과 같이 작성했습니다. WORKSPACE_FOLDER=/Users/hpsm5187/Desktop/airflow강의 airflow가 인식하는 작업 폴더는 '작업 위치2'인 걸로 아는데, .env파일 내의 경로는 '작업 위치1'의 경로임에도 이상 없이 작동이 되는 부분이 의아합니다. .env파일을 git에서 인식하지 않도록 처리했는데 .env에서 정의해준 경로는 어떻게 반영이 되는건가요?

  • python
  • 데이터-엔지니어링
  • airflow
hpsm5187 댓글 2 좋아요 0 조회수 335

docker_compose.yaml파일이 비어있습니다

해결됨

Airflow 마스터 클래스

안녕하세요 강사님, 문제 사항 질문 드립니다. Bash Operator DAG만들기 부분에서 docker_compose.yaml파일을 vi편집기로 열어보았는데요, 이렇게 표시되며 j, k로 스크롤해보아도 변함이 없습니다. 혹시 컴포즈 파일이 비어있는 상태인걸까요? docker compose up명령어는 문제 없이 실행됩니다. ++ 질문 수정 vscode로 파일을 확인해보니 같은 파일이 두 개 있고, 하나는 비어있고 하나는 강의에서와 동일하게 내용이 차 있습니다. ++ 해결되었습니다. 찾아보니 새로 생긴 파일 하나는 macos자체에서 생성하는 메타데이터 파일이라고 하는것 같네요. 시간 좀 지나고 다시 vi편집기로 열어보니 내용이 있는 파일이 열렸습니다. 감사합니다!

  • python
  • 데이터-엔지니어링
  • airflow
hpsm5187 댓글 1 좋아요 0 조회수 281

Task의 실행 주체가 헷갈립니다.

미해결

Airflow 마스터 클래스

안녕하세요, 강의 잘 듣고 있습니다. 제목 그대로 task를 실행하는 주체가 헷갈려 질문 드립니다. airflow document 를 읽어본 결과 scheduler는 DAG의 시작 시간을 확인한 후에 Executor에게 시작을 지시하는 것으로 보였습니다. Executor의 종류 중 locally하게 실행하는 task의 경우 executor가 직접 실행하고, remotely하게 실행하는 task의 경우 (특히 분산 환경에서 사용되는 Executor; ex. CeleryExecutor)에는 worker 풀을 활용한다고 이해했습니다. Airflow의 경우 default executor가 SequentialExecutor로 설정된다고 하는데, 이는 local executor이므로 worker가 존재하지 않는다고 이해했습니다. 그래서 local executor에도 따로 worker가 존재하는지 궁금하여 질문 남깁니다! 감사합니다.

  • python
  • 데이터-엔지니어링
  • airflow
김민서 댓글 1 좋아요 0 조회수 257

python 설치 관련

해결됨

Airflow 마스터 클래스

안녕하세요. python 설치 관련 질문이 있어 문의드립니다 ~ 강의에서는 파이썬 3.7.x 버전 설치 후 python 명령어를 통해 버전을 확인해주셨는데요. 강의를 보고 저도 3.8.x 버전 설치 후 (에어플로우와 버전 통일) python 명령어를 통해 버전을 확인해보았는데, 버전이 확인되지 않아 python3 명령어를 사용해보니 버전이 확인되었습니다. 구글링을 해보니 파이썬 3버전 부터는 python3 명령어를 사용해야 한다고 하는데 강사님 버전은 3버전임에도 불구하고 오류없이 작동하여서 별도의 처리를 해두신건지 궁금합니다. (참고로 제 os는 mac os입니다!)

  • python
  • 데이터-엔지니어링
  • airflow
권소영 댓글 0 좋아요 0 조회수 423

docker-compose up 이후 웹서버가 뜨지 않습니다

해결됨

Airflow 마스터 클래스

안녕하세요 도커&에어플로우 설치 부분 강사님 강의보며 실습하던 중에 크롬창에서 웹서버 접속이 되지 않아 문의드립니다. 환경은 mac os 입니다. sudo docker-compose up airflow-init sudo docker-compose up 명령어 사용해서 진행했습니다. 로그 중에 permission denied가 나는 부분이 있는데 이 부분 때문일까요? airflow-init-1 | chown: changing ownership of '/sources/logs': Permission denied airflow-init-1 | chown: changing ownership of '/sources/dags': Permission denied airflow-init-1 | chown: changing ownership of '/sources/plugins': Permission denied 로그 전문 공유드립니다. (airflow-dockercompose) jeremy 😹  ~/dev/airflow-dockercompose  sudo docker-compose up airflow-init Password: [+] Running 44/3 ✔ postgres 13 layers [⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿] 0B/0B Pulled 72.8s ✔ redis 6 layers [⣿⣿⣿⣿⣿⣿] 0B/0B Pulled 84.6s ✔ airflow-init 22 layers [⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿] 0B/0B Pulled 68.5s [+] Running 3/3 ✔ Container airflow-dockercompose-redis-1 Created 0.3s ✔ Container airflow-dockercompose-postgres-1 Created 0.3s ✔ Container airflow-dockercompose-airflow-init-1 Created 0.0s Attaching to airflow-init-1 airflow-init-1 | chown: changing ownership of '/sources/logs': Permission denied airflow-init-1 | chown: changing ownership of '/sources/dags': Permission denied airflow-init-1 | chown: changing ownership of '/sources/plugins': Permission denied airflow-init-1 | The container is run as root user. For security, consider using a regular user account. airflow-init-1 | airflow-init-1 | DB: postgresql+psycopg2://airflow:***@postgres/airflow airflow-init-1 | Performing upgrade to the metadata database postgresql+psycopg2://airflow:***@postgres/airflow airflow-init-1 | [2024-02-13T12:36:11.330+0000] {migration.py:216} INFO - Context impl PostgresqlImpl. airflow-init-1 | [2024-02-13T12:36:11.332+0000] {migration.py:219} INFO - Will assume transactional DDL. airflow-init-1 | [2024-02-13T12:36:11.344+0000] {db.py:1616} INFO - Creating tables airflow-init-1 | INFO [alembic.runtime.migration] Context impl PostgresqlImpl. airflow-init-1 | INFO [alembic.runtime.migration] Will assume transactional DDL. airflow-init-1 | OpenBLAS WARNING - could not determine the L2 cache size on this system, assuming 256k airflow-init-1 | Database migrating done! airflow-init-1 | /home/airflow/.local/lib/python3.8/site-packages/flask_limiter/extension.py:336 UserWarning: Using the in-memory storage for tracking rate limits as no storage was explicitly specified. This is not recommended for production use. See: https://flask-limiter.readthedocs.io#configuring-a-storage-backend for documentation about configuring the storage backend. airflow-init-1 | OpenBLAS WARNING - could not determine the L2 cache size on this system, assuming 256k airflow-init-1 | airflow already exist in the db airflow-init-1 | 2.8.1 airflow-init-1 exited with code 0 (airflow-dockercompose) jeremy 😹  ~/dev/airflow-dockercompose  sudo docker-compose up [+] Running 7/7 ✔ Container airflow-dockercompose-postgres-1 Running 0.0s ✔ Container airflow-dockercompose-redis-1 Running 0.0s ✔ Container airflow-dockercompose-airflow-init-1 Created 0.0s ✔ Container airflow-dockercompose-airflow-worker-1 Created 0.1s ✔ Container airflow-dockercompose-airflow-scheduler-1 Created 0.1s ✔ Container airflow-dockercompose-airflow-triggerer-1 Created 0.1s ✔ Container airflow-dockercompose-airflow-webserver-1 Created 0.1s Attaching to airflow-init-1, airflow-scheduler-1, airflow-triggerer-1, airflow-webserver-1, airflow-worker-1, postgres-1, redis-1 airflow-init-1 | chown: changing ownership of '/sources/logs': Permission denied airflow-init-1 | chown: changing ownership of '/sources/dags': Permission denied airflow-init-1 | chown: changing ownership of '/sources/plugins': Permission denied airflow-init-1 | The container is run as root user. For security, consider using a regular user account. airflow-init-1 | airflow-init-1 | DB: postgresql+psycopg2://airflow:***@postgres/airflow airflow-init-1 | Performing upgrade to the metadata database postgresql+psycopg2://airflow:***@postgres/airflow airflow-init-1 | [2024-02-13T12:37:00.495+0000] {migration.py:216} INFO - Context impl PostgresqlImpl. airflow-init-1 | [2024-02-13T12:37:00.496+0000] {migration.py:219} INFO - Will assume transactional DDL. airflow-init-1 | [2024-02-13T12:37:00.509+0000] {db.py:1616} INFO - Creating tables airflow-init-1 | INFO [alembic.runtime.migration] Context impl PostgresqlImpl. airflow-init-1 | INFO [alembic.runtime.migration] Will assume transactional DDL. airflow-init-1 | OpenBLAS WARNING - could not determine the L2 cache size on this system, assuming 256k airflow-init-1 | Database migrating done! airflow-init-1 | /home/airflow/.local/lib/python3.8/site-packages/flask_limiter/extension.py:336 UserWarning: Using the in-memory storage for tracking rate limits as no storage was explicitly specified. This is not recommended for production use. See: https://flask-limiter.readthedocs.io#configuring-a-storage-backend for documentation about configuring the storage backend. airflow-init-1 | OpenBLAS WARNING - could not determine the L2 cache size on this system, assuming 256k airflow-init-1 | airflow already exist in the db airflow-init-1 | 2.8.1 airflow-init-1 exited with code 0 airflow-triggerer-1 | airflow-worker-1 | airflow-webserver-1 | airflow-scheduler-1 | airflow-webserver-1 | [2024-02-13T12:37:28.080+0000] {configuration.py:2065} INFO - Creating new FAB webserver config file in: /opt/airflow/webserver_config.py airflow-triggerer-1 | ____________ _____________ airflow-triggerer-1 | ____ |__( )_________ __/__ /________ __ airflow-triggerer-1 | ____ /| |_ /__ ___/_ /_ __ /_ __ \_ | /| / / airflow-triggerer-1 | ___ ___ | / _ / _ __/ _ / / /_/ /_ |/ |/ / airflow-triggerer-1 | _/_/ |_/_/ /_/ /_/ /_/ \____/____/|__/

  • python
  • 데이터-엔지니어링
  • airflow
신윤철 댓글 2 좋아요 0 조회수 971

메타데이터 의미

미해결

실리콘밸리 엔지니어와 함께하는 Apache Airflow

강사님 안녕하세요 메타데이터는 테이터의 설명 즉, 테이블에 대한 명세서 라고 정의 하는것을 봤습니다. 그런데 또 다른 의미로 원천 데이터 라는 의미로도 사용될 수 있을까요? 예를들어 overview강의에서 6:24초에 "다른 메타 데이터와 합성해서"라고 말씀 해주셔서요! 사소하지만 조금 헷갈려서 문의 드립니다! 강의 잘 듣고 있습니다. 감사합니다!

  • python
  • 빅데이터
  • 데이터-엔지니어링
  • airflow
윌리 댓글 2 좋아요 1 조회수 394

인기 태그

인프런 TOP Writers

주간 인기글