Open12

SaaS Boostを試してみる

katoakikatoaki

AWS SaaS Boostがオープンソースで公開されました。

いくつかのサイトでも取り上げられていました。

実際に動かしながら、どんなことができるのか把握していきたいと思います。

katoakikatoaki

前提認識

  • AWS SaaS Boostは、モノリシックなアプリケーションを対象とする
  • 対象のアプリケーションを コンテナ化 して組み込む
  • 組み込まれたアプリケーションに様々な機能をエンハンスする
    • デプロイ
    • モニタリング
    • 課金
    • などなど

やってみたいこと

  • Laravelアプリを作成
    • シンプルなtodoアプリ的なものを容易
  • sailでdockerコンテナ化
  • アプリをSaaS Boostテナント(って呼び方あってるかな)にオンボーディング
  • モニタリングとかが簡単に使えるか試してみる
katoakikatoaki

その後、必要なミドルウェア等の環境チェックが行われ、問題なければ次の表示が行われる

===========================================================
Welcome to the AWS SaaS Boost Installer
Setting version to v0 as it is missing from the git properties file.
Installer Version: 7f8f07a-dirty, Commit time: 2021-05-19T02:33:50+0900
Checking maven, yarn and AWS CLI...
Environment Checks for maven, yarn, and AWS CLI PASSED.
===========================================================

その上で、メニューが表示される

1. New AWS SaaS Boost install.
2. Install Metrics and Analytics in to existing AWS SaaS Boost deployment.
3. Update Web Application for existing AWS SaaS Boost deployment.
4. Update existing AWS SaaS Boost deployment.
5. Delete existing AWS SaaS Boost deployment.
6. Exit installer.

インストールを行うために、メニューは1を選択、その後いくつか選択肢が出たので以下のように回答して進めた。

Please select an option to continue (1-6): 1
Directory path of saas-boost download (Press Enter for '/Users/kato.hiroaki/dev/sandbox/210519_saas-boost/aws-saas-boost') :
Enter name of the AWS SaaS Boost environment to deploy (Ex. dev, test, uat, prod, etc.): dev
Enter the email address for your AWS SaaS Boost administrator: hkato.bel@gmail.com
Enter the email address address again to confirm: hkato.bel@gmail.com
Would you like to setup a domain in Route 53 as a Hosted Zone for the AWS SaaS Boost environment (y or n)? n
Would you like to install the metrics and analytics module of AWS SaaS Boost (y or n)? n

If your application requires a FSX for Windows Filesystem, an Active Directory is required.
Would you like to provision a Managed Active Directory to use with FSX for Windows Filesystem (y or n)? n
===========================================================

Would you like to continue the installation with the following options?
AWS SaaS Boost Environment Name: dev
Admin Email Address: hkato.bel@gmail.com
Route 53 Domain for AWS SaaS Boost environment: 
Install Metrics and Analytics: n
Amazon Quicksight user for setup of Metrics and Analytics: n/a
Setup Active Directory for FSX for Windows: n
Enter y to continue or n to cancel: y
Continuing installation of AWS SaaS Boost

その後、インストール処理が進行し、最終的には以下のような表示が行われます

︙
Check the admin email box for the temporary password.
AWS SaaS Boost Console URL is: https://xxx.cloudfront.net
AWS SaaS Boost Artifacts Bucket: sb-dev-artifacts-b96458dc-80b1

Admin Email Address の項目で指定した宛先にメールが届くので確認します。
ダッシュボードのURLやログイン情報などが記載されています。

Welcome to AWS SaaS Boost!

You can login to your AWS SaaS Boost environment at https://xxx.cloudfront.net.
Your username is: xxx
Your temporary password is: xxx
katoakikatoaki

この先は主にWebUIでの作業となる。

URLにアクセスするとログイン画面が表示される。
ログインすると初回はパスワード変更が必要なので、これを行う。


katoakikatoaki

ダッシュボードにログイン後、まずはApplicationの設定を行った。

今回、試しにデプロイするのは、事前に用意したシンプルなtodo管理を行うLaravelアプリで、DBにMysqlを使う構成となっている。

katoakikatoaki

Summaryページに記載されているECRリポジトリにdockerイメージをpushします。

katoakikatoaki

OnboardingからProvision Tenantを選択し、必要事項を記入してSubmitします。

katoakikatoaki

OnboardingのStatusがDeployedになったらテナントが完成しています。
Tenantsから詳細を開き、Load Balancer DNSに記載されたURLにアクセスしてみます。

502エラー画面が表示されてしまいました。。

katoakikatoaki

まずは動く状態を作ってみよう、ということで、Getting startedにあるサンプルを動かしてみることにしました

https://github.com/awslabs/aws-saas-boost/blob/main/docs/getting-started.md#step-7---optional-deploy-the-sample-application

これまでと同様にセットアップを進め、デプロイだけ以下の手順で実施しました。

$ cd samples/java/
$ sh build.sh
Please enter your AWS SaaS Boost Environment label: dev
︙
The push refers to repository [xxxxxxxxxxxx.dkr.ecr.ap-northeast-1.amazonaws.com/sb-dev-core-peocpopw650c-ecsrepository-awwulxtydagg]
9622e1beb4ca: Pushed 
cec9bed92e2b: Pushed 
1119ff37d4a9: Pushed 
latest: digest: sha256:76be031f47577a849985e0330d47681611bfe031b1d4be0e01c2ea06dcb6bf8a size: 952
katoakikatoaki

Applicationの設定については、今回はGetting started資料にあるサンプルを動かしてみるため、以下の設定のみデフォルトから変更した状態にしました。

  • Application
    • Name: helloworld
  • Container Settings
    • Compute Size: small
    • Container Port: 8080
    • Container OS: Linux
    • Health Check URL: /index.html
  • File System
    • Mount point: /mnt
  • Database
    • Engine: MariaDB
    • Instance: db.t3.micro
    • Version: 10.5.8
    • Username: katoaki
    • Password: 適当

他はデフォルトのままです。

katoakikatoaki

が、その後オンボーディングしてみたもののエラー。

DBのcreateをする段階で失敗していたようです。

2021-05-21T12:26:19.132+09:00	2021-05-21 03:26:19.131 ERROR 7 --- [ main] c.a.a.p.s.c.DataSourceConfig : Error creating database
2021-05-21T12:26:19.132+09:00	java.sql.SQLSyntaxErrorException: (conn=37) You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1

DB(MariaDB)のバージョンがサンプルの想定と違ったのかなぁ。。