{"id":1575,"date":"2021-08-05T18:03:46","date_gmt":"2021-08-05T09:03:46","guid":{"rendered":"https:\/\/www.kwonline.org\/memo2\/?p=1575"},"modified":"2021-08-06T12:00:35","modified_gmt":"2021-08-06T03:00:35","slug":"install-airflow-on-raspberry-pi-4","status":"publish","type":"post","link":"https:\/\/www.kwonline.org\/memo2\/2021\/08\/05\/install-airflow-on-raspberry-pi-4\/","title":{"rendered":"Raspberry Pi 4 \u306b Airflow \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b"},"content":{"rendered":"<p>&nbsp;<br \/>\n\u3084\u3063\u3068\u52d5\u3044\u305f\u306e\u3067\u30e1\u30e2\u3002<\/p>\n<p>OS \u306f Ubuntu Server 20.04 LTS \u306b\u5165\u308c\u66ff\u3048\u6e08\u307f\u3002<\/p>\n<p>\u4f55\u3082\u8003\u3048\u305a\u306b Airflow \u306e\u516c\u5f0f\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306e\u3068\u304a\u308a\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u3089\u3001\u3084\u308c pendulum \u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u51fa\u6765\u306a\u3044\u3084\u3089 pyarrow \u306f PEP-517 \u304c\u3069\u3046\u3060\u306e\u3053\u3046\u3060\u306e\u3068\u8a00\u308f\u308c\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u30b3\u30b1\u308b\u3002<br \/>\nPyYAML \u306f\u3082\u3046\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u308b\u304b\u3089\u9032\u3081\u306a\u3044\u3068\u304b\u3044\u3046\u30a8\u30e9\u30fc\u3082\u3042\u3063\u305f\u306a\u3002<br \/>\n\u5168\u90e8\u30e1\u30e2\u3063\u3066\u306a\u3044\u3002<\/p>\n<p>\u3067\u3001\u6700\u7d42\u7684\u306b\u3084\u3063\u305f\u4e8b\u306f\u3053\u3061\u3089\u3002<\/p>\n<p>&nbsp;<\/p>\n<h3>libffi.so.6<\/h3>\n<p>libffi.so.6 \u304c\u898b\u3064\u304b\u3089\u306a\u3044\u3068\u304b\u6012\u3089\u308c\u308b\u306e\u3067 libffi.so.7 \u306e\u30b7\u30f3\u30dc\u30ea\u30c3\u30af\u30ea\u30f3\u30af\u8cbc\u308b\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nsudo ln -s \/usr\/lib\/aarch64-linux-gnu\/libffi.so.7 \/usr\/lib\/aarch64-linux-gnu\/libffi.so.6\r\n<\/pre>\n<p>&nbsp;<\/p>\n<h3>\u4f9d\u5b58\u30c4\u30fc\u30eb\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h3>\n<p>\u516c\u5f0f\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306b\u66f8\u3044\u3066\u3042\u3063\u305f\u3082\u306e\u3068\u3001\u30b0\u30b0\u3063\u305f\u7d50\u679c\u5fc5\u8981\u3060\u3063\u305f\u3082\u306e\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nsudo apt install -y --no-install-recommends \\\r\n        freetds-bin \\\r\n        krb5-user \\\r\n        ldap-utils \\\r\n        libsasl2-2 \\\r\n        libsasl2-modules \\\r\n        libssl1.1 \\\r\n        locales  \\\r\n        lsb-release \\\r\n        sasl2-bin \\\r\n        sqlite3 \\\r\n        unixodbc \\\r\n        python3 \\\r\n        python3-pip \\\r\n        python-dev \\\r\n        libatlas-base-dev\r\n<\/pre>\n<h3>Python3\u95a2\u9023<\/h3>\n<p>Python3\u95a2\u9023\u306e\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u3092\u3059\u308b\u3002<\/p>\n<p>.bashrc \u306b\u4e0b\u8a18\u3092\u8ffd\u8a18<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nalias python=python3\r\nalias pip=pip3\r\n<\/pre>\n<p>\u7de8\u96c6\u3057\u305f\u3089 source \u30b3\u30de\u30f3\u30c9\u3067\u8aad\u307f\u8fbc\u307f\u76f4\u3059<\/p>\n<p>\u3067\u3001\u3053\u306e\u307e\u307e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3092\u59cb\u3081\u3066\u3082 PEP-517 \u304c\u3069\u3046\u3060\u306e\u3053\u3046\u3060\u306e\u3068\u6012\u3089\u308c\u308b\u306e\u3067\u3001\u4e0b\u8a18\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304a\u304f\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\npip install --upgrade pip setuptools wheel\r\n<\/pre>\n<p>&nbsp;<\/p>\n<h3>Airflow \u672c\u4f53\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h3>\n<p>\u3084\u3063\u3068 apahce-airflow \u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<br \/>\n\u3057\u304b\u3057\u3053\u3053\u3067\u3082\u307e\u305f PyYAML \u304c\u65e2\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u308b\u304b\u3089\u3069\u3046\u306e\u3053\u3046\u306e\u3068\u30a8\u30e9\u30fc\u304c\u51fa\u308b\u306e\u3067\u7121\u8996\u3057\u3066\u5f37\u5236\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\uff57<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nAIRFLOW_VERSION=2.1.2\r\nPYTHON_VERSION=&quot;$(python --version | cut -d &quot; &quot; -f 2 | cut -d &quot;.&quot; -f 1-2)&quot;\r\nCONSTRAINT_URL=&quot;https:\/\/raw.githubusercontent.com\/apache\/airflow\/constraints-${AIRFLOW_VERSION}\/constraints-${PYTHON_VERSION}.txt&quot;\r\nsudo pip install --ignore-installed PyYAML &quot;apache-airflow==${AIRFLOW_VERSION}&quot; --constraint &quot;${CONSTRAINT_URL}&quot;\r\n<\/pre>\n<p>&nbsp;<\/p>\n<h3>\u521d\u671f\u5316\u3068\u8d77\u52d5<\/h3>\n<p>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u3057\u307e\u3048\u3070\u3042\u3068\u306f\u3053\u3061\u3089\u306e\u3082\u3093\u3060 (\u8b0e<\/p>\n<p>\u4ee5\u4e0b\u306e\u624b\u9806\u3067\u521d\u671f\u5316\u3057\u3066\u8d77\u52d5\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nexport AIRFLOW_HOME=~\/airflow\r\n\r\nairflow db init\r\nairflow users create \\\r\n    --username admin \\\r\n    --firstname hoge \\\r\n    --lastname fuga \\\r\n    --role Admin \\\r\n    --email hoge@example.com\r\n\r\nairflow webserver --port 8080 -D\r\nairflow scheduler -D\r\n<\/pre>\n<p>\u4f59\u8a08\u306a\u4e8b\u3082\u3084\u3063\u3066\u3057\u307e\u3063\u3066\u308b\u304b\u3082\u77e5\u308c\u3093\u3051\u3069\u52d5\u3044\u3066\u308b\u304b\u3089\u304a\uff4b<\/p>\n<p>\u52d5\u304f\u3088\u3046\u306b\u306a\u3063\u305f\u3089\u597d\u304d\u306a\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u8ffd\u52a0\u3059\u308b\u3002<br \/>\n\u4ffa\u306f BigQuery \u4f7f\u3046\u306e\u3067 GCP \u7528\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u8ffd\u52a0\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nsudo pip install apache-airflow-providers-google\r\n<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; \u3084\u3063\u3068\u52d5\u3044\u305f\u306e\u3067\u30e1\u30e2\u3002 OS \u306f Ubuntu Server 20.04 LTS \u306b\u5165\u308c\u66ff\u3048\u6e08\u307f\u3002 \u4f55\u3082\u8003\u3048\u305a\u306b Airflow \u306e\u516c\u5f0f\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306e\u3068\u304a\u308a\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u3089\u3001\u3084\u308c pendulum \u304c\u30a4 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21,8],"tags":[],"class_list":["post-1575","post","type-post","status-publish","format-standard","hentry","category-data-engineering","category-linux"],"_links":{"self":[{"href":"https:\/\/www.kwonline.org\/memo2\/wp-json\/wp\/v2\/posts\/1575","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kwonline.org\/memo2\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kwonline.org\/memo2\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kwonline.org\/memo2\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kwonline.org\/memo2\/wp-json\/wp\/v2\/comments?post=1575"}],"version-history":[{"count":4,"href":"https:\/\/www.kwonline.org\/memo2\/wp-json\/wp\/v2\/posts\/1575\/revisions"}],"predecessor-version":[{"id":1579,"href":"https:\/\/www.kwonline.org\/memo2\/wp-json\/wp\/v2\/posts\/1575\/revisions\/1579"}],"wp:attachment":[{"href":"https:\/\/www.kwonline.org\/memo2\/wp-json\/wp\/v2\/media?parent=1575"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kwonline.org\/memo2\/wp-json\/wp\/v2\/categories?post=1575"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kwonline.org\/memo2\/wp-json\/wp\/v2\/tags?post=1575"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}