Data Orchestration
ยท
๐Ÿ›ข๏ธ Database
Data Orchestration Airflow? ๋ฐ์ดํ„ฐ ์ข…์‚ฌ์ž๋ผ๋ฉด Data Orchestration(๋ฐฐ์น˜ ํˆด)์— ๋Œ€ํ•ด ํ•œ ๋ฒˆ์ฏค ๋“ค์–ด๋ดค์„ ๊ฒƒ์ด๋‹ค. ๊ทธ์ค‘ Airflow๊ฐ€ ๊ฐ€์žฅ ๋Œ€์ค‘์ ์ด๊ณ  ์ธ๊ธฐ๊ฐ€ ์žˆ์ง€๋งŒ ์ด Dag system์„ ์ฒ˜์Œ ์ตํžˆ๊ธฐ๋Š” ์ƒ๋‹นํžˆ ์ƒ์†Œํ•˜๊ณ  ๋‹ค๋ฃจ๊ธฐ ์–ด๋ ค์šธ ๊ฒƒ์ด๋‹ค. execute date, start date, clear ๋“ฑ ๋“ฑ ๋ฐฐ์น˜ํ•˜๋‚˜ ํ•œ ์ค‘์š”ํ•œ task๋กœ ์ด๋ฃจ์–ด์ง„ ๋ฐฐ์น˜๊ฐ€ ์‹œ์Šคํ…œ์„ ์ž˜ ์ดํ•ดํ•˜์ง€ ๋ชปํ•˜๋ฉด ์‹คํ–‰ ์‹œ๊ฐ„์ด ๋‹ฌ๋ผ์งˆ ์ˆ˜ ์žˆ๊ณ  ๋ถˆํ•„์š”ํ•œ ๊ธฐ๋Šฅ์œผ๋กœ ์‹คํŒจํ•œ task๊ฐ€ ์‹คํŒจ ์‹œ์ ์—์„œ ์ง€๊ธˆ ์‹œ๊ฐ„๊นŒ์ง€ ์žฌ์‹œ์ž‘์ด ๋˜๋Š” ๋ถˆ์ƒ์‚ฌ ๋˜ํ•œ ์ผ์–ด๋‚  ์ˆ˜๋„ ์žˆ๋‹ค. (ex) catch_up)  Airflow์˜ UI๋ฅผ ๋ณผ ๋•Œ ํ˜นํ•ด์„œ ๋งŽ์ด๋“ค ์„ ํƒํ•˜๊ณ  ํ›„ํšŒํ•˜๋Š” ํฌ์ธํŠธ๊ฐ€ ์—ฌ๋Ÿฟ ์žˆ๋‹ค.  ์ฒซ ๋ฒˆ์งธ. Airflow์˜ ํŒจํ‚ค์ง€ ๊ด€์  ..
Airflow Entrypoint
ยท
๐Ÿ›ข๏ธ Database
Entrypoint ํ”„๋กœ๋•์…˜ ์ด๋ฏธ์ง€์˜ ๊ธฐ๋ณธ ์ง„์ž…์ ์„ ์‚ฌ์šฉํ•˜๋Š” ๊ฒฝ์šฐ ์ปจํ…Œ์ด๋„ˆ๊ฐ€ ์‹œ์ž‘๋  ๋•Œ ์ž๋™์œผ๋กœ ์ˆ˜ํ–‰๋˜๋Š” ๋ช‡ ๊ฐ€์ง€ ๋™์ž‘์ด ์žˆ์Šต๋‹ˆ๋‹ค. ์–ด๋–ค ๊ฒฝ์šฐ์—๋Š” ํ™˜๊ฒฝ ๋ณ€์ˆ˜๋ฅผ ์ด๋ฏธ์ง€์— ์ „๋‹ฌํ•˜์—ฌ ํ•ด๋‹น ๋™์ž‘ ์ค‘ ์ผ๋ถ€๋ฅผ ํŠธ๋ฆฌ๊ฑฐํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.์ž„์˜์˜ ์‚ฌ์šฉ์ž๊ฐ€ ์ปจํ…Œ์ด๋„ˆ๋ฅผ ์‹คํ–‰ํ•˜๋„๋ก ํ—ˆ์šฉ Airflow ์ด๋ฏธ์ง€๋Š” Open-Shift์™€ ํ˜ธํ™˜๋˜๋ฏ€๋กœ ์ž„์˜์˜ ์‚ฌ์šฉ์ž ID์™€ ๊ทธ๋ฃน ID 0( root)๋กœ ์‹œ์ž‘ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. Airflow์™€ ๋‹ค๋ฅธ ์‚ฌ์šฉ์ž๋กœ ์ด๋ฏธ์ง€๋ฅผ ์‹คํ–‰ํ•˜๋ ค๋ฉด ์‚ฌ์šฉ์ž์˜ GID๋ฅผ .์œผ๋กœ ์„ค์ •ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค 0. ๋‹ค๋ฅธ ๊ทธ๋ฃน์„ ์‚ฌ์šฉํ•˜๋ ค๊ณ  ํ•˜๋ฉด ์ง„์ž…์ ์ด ์˜ค๋ฅ˜์™€ ํ•จ๊ป˜ ์ข…๋ฃŒ๋ฉ๋‹ˆ๋‹ค.OpenShift๋Š” ์ปจํ…Œ์ด๋„ˆ๋ฅผ ์‹œ์ž‘ํ•  ๋•Œ UID๋ฅผ ๋ฌด์ž‘์œ„๋กœ ํ• ๋‹นํ•˜์ง€๋งŒ, ์ด๋ฏธ์ง€๋ฅผ ์ˆ˜๋™์œผ๋กœ ์‹คํ–‰ํ•˜๋Š” ๊ฒฝ์šฐ์—๋„ ์ด ์œ ์—ฐํ•œ UID๋ฅผ ํ™œ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ด๋Š” ์˜ˆ๋ฅผ ๋“ค์–ด ..
[Airflow] airflow-init alembic.script.revision.ResolutionError: No such revision or branch ์˜ค๋ฅ˜
ยท
๐Ÿ›ข๏ธ Database
์›์ธ docker๋กœ ๊ธฐ์กด airflow 2.4 -> 2.8๋กœ ์—…๊ทธ๋ ˆ์ด๋“œ ํ›„ ๋‹ค์‹œ 2.8 -> 2.4๋กœ downgrade ํ•  ๋•Œ db migration์ด ๋˜์ง€ ์•Š์•„ ์ƒ๊ธฐ๋Š” ๋ฌธ์ œ Solution 1) airflow-init ์‹œ ๊ตฌ์„ฑ ๋‹จ๊ณ„์—์„œ `airflow db upgrade'๋ฅผ ์‹คํ–‰ํ•ด์•ผํ•˜์ง€๋งŒ init ๋‹จ๊ณ„์˜ time์ด ์งง์•„ ๋ฐ”๋กœ ์ข…๋ฃŒ ๋˜์–ด ๋ฒ„๋ฆผ ๋”ฐ๋ผ์„œ local ํ™˜๊ฒฝ์ด๋ผ๋ฉด `airflow db migrate`๋กœ db migrate ํ˜น์€ `airflow db upgrade`๋ฅผ ์ˆ˜ํ–‰ https://airflow.apache.org/docs/apache-airflow/stable/migrations-ref.html Reference for Database Migrations — Airflow Documentat..
[Airflow] airflow db ์ดˆ๊ธฐํ™” ์˜ค๋ฅ˜
ยท
๐Ÿ›ข๏ธ Database
airflow db ์ดˆ๊ธฐํ™” ์˜ค๋ฅ˜๋”๋ณด๊ธฐ----------------------------------------------------------------------------------------------------------------------Traceback (most recent call last):  File "/opt/homebrew/bin/airflow", line 5, in     from airflow.__main__ import main  File "/opt/homebrew/lib/python3.11/site-packages/airflow/__init__.py", line 68, in     settings.initialize()  File "/opt/homebrew/lib/python..
[airflow] airflow-init-1 exited
ยท
๐Ÿ›ข๏ธ Database
docker-compose๋กœ ๊ตฌ์„ฑํ•œ container ์ค‘ airflow-init-1๊ฐ€ ์‹œ์ž‘๊ณผ ๋™์‹œ์— ๊บผ์ง€๋Š” ํ˜„์ƒ์„ ๋ณผ ์ˆ˜ ์žˆ๋‹ค. ์ด๋Š” container ๊ตฌ์„ฑ ์ค‘ ์ดˆ๊ธฐํ™”๋ฅผ ์ž˜ ์‹คํ–‰ํ•˜๊ณ  ์™„๋ฃŒ๋˜์–ด ๊บผ์ง„ ๊ฒƒ์ด๋‹ค. docker-compose ํ›„ --detach๊ฐ€ ์—†์œผ๋ฉด airflow ๊ณ„์† ์‹คํ–‰ํ•˜๊ธฐ ๋–„๋ฌธ์— ์ด๋ฅผ ๋ฐฉ์ง€ํ•˜๊ธฐ ์œ„ํ•จ์ด๋‹ค. https://stackoverflow.com/questions/68714224/airflow-exiting-after-initilalization Airflow exiting after Initilalization I'm trying to set up airflow instance using docker-compose in an Ubuntu EC2 Instance. After airfl..
๋‹คํ–ˆ๋‹ค
'Airflow' ํƒœ๊ทธ์˜ ๊ธ€ ๋ชฉ๋ก