Blueprintのコンセプト
Blueprint は Yaml フォーマットで定義される exaBase Studio のドメイン固有のプログラミング言語 (Domain Specific Language) です。
エンジニアが親しみのある Yaml 形式で記述することができます。さらに、 Studio App の機能である Canvas を利用して GUI で Blueprint を作成することも可能で、非エンジニアの方が使ったり、チームで話し合ったりしながら、共同で設計を進めることができます。
Blueprint のビジョン
一般的にビジネスの業務や情報処理の内容やプロセスの変化に対応してシステムへの要求も変化します。 特にデジタル・トランスフォーメーション(DX)と呼ばれるようなデジタル技術によるビジネスの変革はあるべき姿を見出すための試行錯誤の繰り返しが必要となることが多く、さまざまな変化や変更への対応をしなければなりません。また、ビジネスと技術の課題や制約が相互に影響することから多様なステークホルダーの間の会話を円滑に行うことも求められます。
わたしたちはこうした不確実な環境で成果を上げるためには下記を備えることを重要視しています。
- 関係者がビジネスと技術のどちらのことも一定のレベルで理解できる共通言語
- 狙い通りの効果が期待できるかどうかを素早く検証できる手軽さ
- 変更の要請にすぐに対応できる柔軟なプロセス
こうした背景から Blueprint が生まれました。
Blueprint はデータの表現と処理が分離されているためにこうした変更を行いやすくなっています。
Blueprint のはたらき
ユーザーは Blueprint をデプロイすることで Circuit と呼ばれるサーバー上で動作する実行プログラムを作ることができます。
Circuit
Circuit は Blueprint に記載された情報をもとにしてサーバー上に構築された実行プログラムです。設計図から生み出された回路 = Circuitをイメージしてください。
Circuit は Entity, Endpoint, Trigger, Pipeline によって構成されます。それぞれのコンポーネントは Kubernetes 上の Pod として立ち上がり、独立したサービスとして存在します。
Blueprint の使い方
Blueprint はノードと呼ばれる構成要素を組み合わせて作成することでシステムをデザインすることが可能です。
YAMLでBlueprintのサンプルコードを見る
constructorApiVersion: v1alpha60
metadata:
name: Your Test Blueprint!!
description: |-
A long description field to allow us to describe what is going on
with this wonderful test blueprint!!!!!
version: 0.0.1
labels:
env: production
debug: no
workspaces:
- id: workspace-test-accounting
metadata:
name: Test Workspace for Accounting
description: "This is the test workspace for accounting that we will be using to test sending and receiving data with triggers and pipelines"
version: 0.0.1
labels:
usesSAGE: No
integrations: "SAGE, Excel, GoogleSpreadsheet"
entities:
- id: e1
metadata:
name: Normal Entity
description: "This is a Normal entity"
type: io.ebstudio.core.entity.data
expires: 60000
interval: 1000
- id: e2
metadata:
name: Binary Entity
description: "Binary entity for use with files"
type: io.ebstudio.core.entity.file
endpoints:
- uri: /ep1
type: io.ebstudio.core.entity
target: e1
authorizedIps:
- 126.122.122.12/32
- 126.122.122.0/24
bind: ReadOnly
- uri: /ep1
type: io.ebstudio.core.sideapp
port: 8080
target: sideapp-service
bind: ReadOnly
- uri: /ep1
type: io.ebstudio.core.pipeline
target: pipeline-1
bind: ReadOnly
triggers:
- id: check-if-e1-or-e2-has-new-value
metadata:
name: New trigger Names
description: "Trigger using rxjs"
type: io.ebstudio.core.trigger.script.rxjs
entities:
- id: e1
default: "Test Value"
- id: e2
default: 23
script: |
'use strict'
const { getEntityAsObservable, disposeBag } = context;
getEntityAsObservable('e1')
.subscribe(x => {
// received data is converted to JSON value if available
if(Array.isArray(x)) {
console.log(`array: ${JSON.stringify(x)}`);
} else if(typeof x === 'object') {
console.log(`${typeof x}: ${JSON.stringify(x)}`);
} else {
console.log(`${typeof x}: ${x}`);
}
})
.putIn(disposeBag);
requirements:
- dayjs
- lodash
environment:
ENVNAMETEST: EnviromentTestVariable
ENVNAMETESTSECRET: ${{SECRET.EnviromentTestKey}}
storage:
- path: /tmp/asdasad
injection:
- path: /tmp/asdasad.py
data: |
asdasd
asdasdasd
asdasdas
pipeline: pipeline-test
pipelines:
- id: pipeline-test
name: One Pipeline Test
description: "A pipeline test"
type: io.ebstudio.core.pipeline.atpipeline
try:
steps:
- id: pipeline-test-step-1
description: "This is pipeline test step one"
computeType: CPU
image: test-test-test.dkr.ecr.ap-northeast-1.amazonaws.com/ebstudio/test-test:latest
environment:
ENVNAMETEST: EnviromentTestVariable
ENVNAMETESTSECRET: ${{SECRET.EnviromentTestKey}}
predefinedInputs:
- id: testPreDefinedInput
data: |
a test data string
inputs:
- type: entity
id: e1
data: /tmp/entity--e1.txt
outputs:
- type: entity
id: e3
data: /tmp/entity--e3.txt
- type: filesystem
id: e1-file-data
data: /app/test/e1-filedata.zip
- id: pipeline-test-step-2
description: "This is pipeline test step two"
computeType: GPU
image: test-test-test.dkr.ecr.ap-northeast-1.amazonaws.com/ebstudio/test-test:latest
inputs:
- type: filesystem
id: e1-file-data
data: /app/test/e1-filedata.zip
outputs:
- type: entity
id: e4
data: /tmp/entity--e4.txt
except:
steps:
- id: pipeline-test-step-2
description: "This is pipeline test step two"
computeType: GPU
image: test-test-test.dkr.ecr.ap-northeast-1.amazonaws.com/ebstudio/test-test:latest
inputs:
- type: exception
id: e1-file-data
data: /app/test/e1-filedata.zip
outputs:
- type: entity
id: e4
data: /tmp/entity--e4.txt
sideapps:
- id: test-sideapp
metadata:
name: Sideapp One
description: "A lovely sideapp"
type: io.ebstudio.core.sideapp.service
image: test-test-test.dkr.ecr.ap-northeast-1.amazonaws.com/ebstudio/test-test:latest
environment:
ENVNAMETEST: EnviromentTestVariable
ENVNAMETESTSECRET: ${{SECRET.EnviromentTestKey}}
storage:
- path: /tmp/asdasad
injection:
- path: /tmp/asdasad.py
data: |
asdasd
asdasdasd
asdasdas
Blueprint のコンポーネント
Blueprint ではEntity
とTrigger
を用いて現実世界のコンテキストを情報空間に表現します。表現されたコンテキストに応じて必要なときにだけPipeline
とFunction
のリソースが立ち上がり、AI などを用いた情報処理を行います。
それぞれのノードは Blueprint がデプロイされると Circuit 上に構築され、独立した小さなサービス(Kubernetes の Pod)として稼働します。
名前 | 機能 | 説明 |
---|---|---|
エンティティ | データやファイルへの参照を保持する | エンティティは、他のコンポーネントやエンドポイントを介して接続された外部サービスから書き込まれたデータやファイルの参照を保持します。これらのデータは、エンドポイントを介して読み取るだけでなく、値が変更されたときにイベントとしてトリガーに通知したり、パイプライン実行時にファンクションから参照できます。 |
エンドポイント | デプロイしたサービスへの接続ポイント | エンドポイントは、exaBase Studioでデプロイした各サービスと外部サービスを接続するための窓口となります。エンティティ、パイプライン、SideAppが接続対象となります。 https://app.(env-name).studio.exabase.ai/[エンドポイント名] にてアクセスできます。 |
トリガー | リアクティブなイベント処理とパイプライン実行 | トリガーは、rxjsと呼ばれるリアクティブプログラミングのJavaScriptライブラリを用いて開発でき、非同期処理やイベント、データストリームを効率的に管理できます。処理の結果として、トリガに接続しているパイプラインを実行することもできます。 |
パイプライン | AI処理等の非同期処理を逐次実行できるワークフローエンジン | パイプラインは、ファンクションを逐次実行するワークフローエンジンです。あるファンクションが出力した結果を後段のファンクションで再利用するなど、柔軟なファイルリソースの再利用をサポートします。 |
ファンクション | パイプラインから実行される任意の処理 | ファンクションは、パイプラインに登録され実行されるデータ処理です。エンティティからのデータ読み込み/結果の書き込みなどを基本機能としてサポートします。 |
SideApp | 常時起動するサービス | SideAppは、常時起動を前提とするサービスで、他のコンポーネントと連携した開発が可能です。WebサーバやAPIサーバ等、幅広い用途で活用いただけます。 |