LoginSignup
4
0

More than 3 years have passed since last update.

AirflowのマネージドサービスAstronomer.ioを使ってみた

Last updated at Posted at 2019-10-14

Astronomer.ioとは

Cloud Composerのような、Airflowのホスティングサービスです。
https://www.astronomer.io/

  • Fully-managedなAstronomer Cloud
  • 自前のKubernatesにデプロイするAstronomer Enterprise

がありますが、今回はAstronomer Cloudだけの話です。

とりあえず触ってみる

quickstartがあるので、そのとおりやってみます。

トライアル準備

2週間のフリートライアルがあるそうです。
https://www.astronomer.io/trial/
名前とメールアドレスと会社名がいります。Google/Githubで認証が出来ます。

SDK準備

(Dockerがいります)

$ curl -sSL https://install.astronomer.io | sudo bash -s -- v0.7.5-2
$ astro airflow init
$ ls
Dockerfile      dags            packages.txt        requirements.txt
airflow_settings.yaml   include         plugins

ローカル開発

Dockerコンテナが用意されているらしく、

 astro airflow start

でAirflowをローカルに起動することが出来ます。

クラウドにデプロイ

ローカルでやりたくてastronomer.io使ってねえ!というわけで、クラウドにデプロイしてみましょう。

デプロイメント準備

https://app.astronomer.cloud/deployments/new
LocalExecutor・CeleryExecutorを選択して、ワークスペースを作ります。

デプロイ

 astro auth login astronomer.cloud
 CLUSTER                             WORKSPACE                           
 astronomer.cloud                                                        

 Switched cluster
Username (leave blank for oAuth): 

ユーザー名求められますが、空を入力するとoAuthで認証出来ます。
その後、Workspaceを選択するとデプロイが始まります。

Select which airflow deployment you want to deploy to:
 #    RELEASE NAME                  WORKSPACE                     DEPLOYMENT UUID                                   
 1    meteoroidal-radiation-4546    Hoge's Workspace               02df4dd8-157c-4ef5-b0ea-324469b0be36              

> 1
Deploying: meteoroidal-radiation-4546
meteoroidal-radiation-4546/airflow
Building image...
Sending build context to Docker daemon  11.78kB
Step 1/1 : FROM astronomerinc/ap-airflow:0.7.5-2-1.9.0-onbuild
# Executing 5 build triggers
 ---> Using cache
 ---> Using cache
 ---> Using cache
 ---> Using cache
 ---> Using cache
 ---> dab4fa1eacb8
Successfully built dab4fa1eacb8
Successfully tagged meteoroidal-radiation-4546/airflow:latest
Pushing image to Astronomer registry
The push refers to repository [registry.astronomer.cloud/meteoroidal-radiation-4546/airflow]
eb41b3d4671d: Pushed 
1b27d8ce770d: Pushed 
037bd12864e8: Pushed 
8187c92699db: Pushed 
6f6f84fc0562: Pushed 
3dd564f0994c: Pushed 
8b478718335c: Pushed 
44a5ad0d4381: Pushed 
fb3d316a5ada: Pushed 
1c95d1861654: Pushed 
499930bec4ed: Pushed 
df64d3292fd6: Pushed 
cli-1: digest: sha256:375ea69be08de3cfc979adc2a7c0b6a21e78632a3dc815a6672a5b863083670c size: 2816
Untagged: registry.astronomer.cloud/meteoroidal-radiation-4546/airflow:cli-1
Untagged: registry.astronomer.cloud/meteoroidal-radiation-4546/airflow@sha256:375ea69be08de3cfc979adc2a7c0b6a21e78632a3dc815a6672a5b863083670c

Cloud Composerとの比較(Astronomer.ioさんの資料から)

Cloud Composerとの比較が気になりますよね。AstronomerさんはComposerとの比較を用意してくれています。
(GCP側からの比較はなさそう)

鵜呑みにして書いてみると

  • 値段
    • Composerは最小でも$300かかるよ
    • Astronomer.ioは最小$110(ただしLocalExecutor)で済むよ
    • Astronomer.ioは、scheduler・worker・webserverのスペックを柔軟に変えやすいよ
  • 機能
    • KubernatesExecutorも initial supportしているよ
  • サポート・トレーニング
    • Airflowのコミッターを含むエキスパートのサポートがあるよ
    • 内部でAirflowを二年間使っているよ

あたりがメリットらしいです。

Cloud Composerとの雑感(自分の感想)

ComposerもAstronomer.ioも、AirflowのDAGを動かすという点では、どちらも同じように使えそうです。
正直、もっと使わないとわからないですが、雑感です:

  • Dockerでの開発環境が準備されているのは便利
  • 最小構成ではAstronomer.ioのが安いですが、CeleryExecutorにするとそんなに変わらない気も…
  • ComposerのAirflow UIは時々Internal Server Errorでアクセス出来なくなるのですが、Astronomer.ioは果たして…?
    • AirflowのUIは用事があって見に行くものなので、アクセス出来ないと結構ストレスになります
  • ComposerではGKEのnode/podに入ることが出来ますが、Astronomer.ioは出来ない?
    • とはいえ、それが本当に必要なのかは微妙
  • Astronomer.ioの方がクラスタ作成が早い感じ
    • Composerでは、新しいクラスタ(environment)作成に10~20分時間がかかることがあります

少なくとも、ライトに(LocalExecutorで済む範囲)Airflowを試してみたいなら検討の価値はあるかもしれません。

細いメモ

スクリーンショット 2019-10-15 4.28.38.png

4
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
0