Skip to content

Commit fa1323c

Browse files
authored
Merge pull request #46 from Azure/docs-upgrade-keonabut
Docs for Quickstart
2 parents 02b2b0e + cda1617 commit fa1323c

File tree

2 files changed

+86
-27
lines changed

2 files changed

+86
-27
lines changed

README.md

Lines changed: 44 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,15 @@ Azure Machine Learning + GitHub を利用した MLOps 実装サンプルコー
2121

2222
## 🚀 使い方
2323
- Azure Machine Learning と GitHub の環境を準備します。
24+
- クライアント環境として下記のいずれかにアクセスします。
25+
- Azure Machine Learning のコンピューティングインスタンス
26+
- DevContainer 環境
27+
- Conda でのパッケージインストールの際にメモリを消費するため、ある程度大きいスペックが必要になります。Codespaces の場合、4-core / 8GB RAM / 32GB storage 以上の Machine Type を選択してください。
2428
- .env ファイルに環境変数の設定をします。
2529
- [./scripts](./scripts) フォルダの各シェルスクリプトを実行します。
26-
- GitHub の Secrets を作成します
30+
- GitHub の Secrets を作成し、GitHub Actions を有効化し実行します
2731

28-
:point_right: **更に詳しい手順や参考資料は [クイックスタート](./docs/quickstart.md) のドキュメントを参照してください**
32+
:point_right: **クライアント環境として Azure Machine Learning のコンピューティングインスタンス (Compute Instance) を利用した場合のコードや CI/CD の実行方法は [クイックスタート](./docs/quickstart.md) のドキュメントに記載してあります**
2933

3034

3135
## 📝 技術条件
@@ -95,7 +99,44 @@ Azure Machine Learning + GitHub を利用した MLOps 実装サンプルコー
9599

96100
## 📄 ディレクトリ構造
97101

98-
>TODO
102+
```
103+
.
104+
├── .devcontainer # Configuration files for DevContainer
105+
├── .github
106+
│ └── workflows # YAML files for GitHub Actions
107+
├── .vscode
108+
├── cli # YAML files for Azure ML CLI v2
109+
│ ├── assets
110+
│ ├── endpoints
111+
│ └── jobs
112+
├── data # Sample data
113+
│ ├── raw
114+
│ └── samples
115+
├── docs # Documenting quickstart, coding style guide etc
116+
├── environments # Python libraries
117+
├── notebooks # Jupyter Notebook
118+
├── pipelines # Azure ML Pipeline CLI v2
119+
│ ├── eval
120+
│ ├── prep
121+
│ ├── score
122+
│ └── train
123+
├── scripts
124+
│ ├── assets # Shell scripts for creating assets like data, compute, environment
125+
│ ├── endpoints # Shell scripts for scoring model
126+
│ ├── jobs # Shell scripts for model training
127+
│ └── prototyping # Shell scripts for experimental
128+
├── src
129+
│ ├── data # Code for data preparation
130+
│ ├── deploy # Code for scoring model
131+
│ ├── features # Code for feature engineering
132+
│ ├── model # Code for model training
133+
│ ├── monitor # Code for monitoing data and model
134+
│ └── rai # Code for responsible ai
135+
├── tests
136+
│ ├── data_validation # Code for validating data
137+
│ └── unit # Code for unit testing
138+
└── utils # Code for utilities
139+
```
99140

100141
---
101142

docs/quickstart.md

Lines changed: 42 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,32 @@
11
# クイックスタート
2-
本リポジトリを動作させる手順を記載します。
2+
## 1. コード実行
3+
サンプルコードを動かす手順を紹介します。
34

4-
## Azure Machine Learning の環境準備
5+
### Azure Machine Learning の環境準備
56
- Azure の Subscription を準備します。
6-
※本リポジトリは所有者権限を持っていることを前提に作成されています
7-
- [クイックスタート: Azure Machine Learning の利用を開始するために必要なワークスペース リソースを作成する](https://learn.microsoft.com/ja-jp/azure/machine-learning/quickstart-create-resources) の手順に従って、`ワークスペース``コンピューティングインスタンス` を作成します。
8-
- [Visual Studio Code で Azure Machine Learning コンピューティング インスタンスに接続する (プレビュー)](https://learn.microsoft.com/ja-jp/azure/machine-learning/how-to-set-up-vs-code-remote?tabs=studio) の手順に従って、`コンピューティングインスタンス` にアクセス可能なことを確認します。
7+
- Azure のリソースグループに対する所有者権限を持っていることが前提です
8+
- [クイックスタート: Azure Machine Learning の利用を開始するために必要なワークスペース リソースを作成する](https://learn.microsoft.com/ja-jp/azure/machine-learning/quickstart-create-resources) の手順に従って、Azure Machine Learning の `ワークスペース``コンピューティングインスタンス` を作成します。
9+
- [Visual Studio Code で Azure Machine Learning コンピューティング インスタンスに接続する (プレビュー)](https://learn.microsoft.com/ja-jp/azure/machine-learning/how-to-set-up-vs-code-remote?tabs=studio#configure-a-remote-compute-instance) の手順に従って、Azure Machine Learning の `コンピューティングインスタンス` にアクセス可能なことを確認します。
910

1011

1112
<br />
1213

13-
## GitHub の環境準備
14+
### GitHub の環境準備
1415
- GitHub のアカウントを準備します。
15-
Public リポジトリを利用する前提であれば Free (個人向けの基本プラン) で動作しますが、セキュリティ機能などが豊富な Team プランや Enterprise プランの利用を推奨します。
16-
- 本リポジトリを Fork します。
16+
- Public リポジトリを利用する前提であれば Free プラン (個人・組織の基本プラン) の[価格プラン](https://github.com/pricing)で動作しますが、セキュリティ機能などが豊富な Team プランや Enterprise プランの利用を推奨します。
17+
- 本リポジトリ [Azure/mlops-starter-sklearn](https://github.com/Azure/mlops-starter-sklearn) を自分のアカウント・組織に Fork します。
1718
- `コンピューティングインスタンス` のターミナル上で、User フォルダ (Users) 配下の自分の個人フォルダに Fork したリポジトリをクローンします。
1819

1920
```bash
2021
cd User/<username>
21-
git clone https://github.com/<github user/org>/mlops-starter-sklearn
22+
git clone https://github.com/<github user/org>/mlops-starter-sklearn #Fork 先のリポジトリを指定
2223
```
2324

2425
<br />
2526

26-
## 環境変数の設定
27+
### Azure Machine Learning 上での環境変数の設定
28+
先ほど Fork したコードを実行します。
29+
2730
- `.env.sample` ファイルを `.env` に改名します。
2831
```bash
2932
mv .env.sample .env
@@ -42,18 +45,8 @@ WORKSPACE="azureml"
4245
LOCATION="japaneast"
4346
SUBSCRIPTION="xxxxxxxxxxx"
4447
```
45-
## GitHub Actions のシークレット作成
46-
- GitHub Actions のシークレットを作成します。
47-
- GROUP: Azure Machine Learning ワークスペースのリソースグループ名
48-
- WORKSPACE: Azure Machine Learning ワークスペースの名前
49-
- SUBSCRIPTION: Azure サブスクリプションID
50-
- AZURE_CREDENTIAL: Azure の接続情報
51-
- Azure Service Principal を利用する想定で書かれています。技術的には OpenID Connect の利用も可能ですが、本ドキュメントやコードは Azure Service Principal を利用することを前提に作成されています。
52-
- 資格情報とそれをシークレット AZURE_CREDENTAL に設定する詳細な方法は [Azure Machine Learning で GitHub Actions を使用する - 手順2. Azure での認証](https://learn.microsoft.com/ja-JP/azure/machine-learning/how-to-github-actions-machine-learning?tabs=userlevel#step-2-authenticate-with-azure) をご参照ください。
53-
54-
5548

56-
## シェルスクリプトの実行
49+
### シェルスクリプトの実行
5750
- `コンピューティングインスタンス` のターミナル上で、[scripts](../scripts) フォルダの各シェルスクリプトを実行します。
5851
- Azure CLI ログイン
5952
- `az login --use-device` コマンドで Azure CLI 認証を行います。
@@ -79,26 +72,51 @@ SUBSCRIPTION="xxxxxxxxxxx"
7972
- [deploy-batch-endpoint-custom.sh](../scripts/endpoints/deploy-batch-endpoint-custom.sh): カスタム型モデルのオンラインエンドポイントへのデプロイ
8073
- [deploy-batch-endpoint-mlflow.sh](../scripts/endpoints/deploy-batch-endpoint-mlflow.sh): MLflow 型モデルのオンラインエンドポイントへのデプロイ
8174

82-
### E2E のスクリプト実行例
75+
#### E2E のスクリプト実行例
8376

8477
```bash
85-
bash ./scripts/setup.sh
78+
# Azure ログイン認証
8679
az login --use-device
80+
81+
# Python 環境の構築、Jupyter カーネルの設定、pre-commit 設定、Azure CLI インストール
82+
bash ./scripts/setup.sh
83+
84+
# 環境変数の読み込みと Azure CLI の設定
8785
bash ./scripts/configure-workspace.sh
8886

87+
# Notebook の実行
8988
bash ./scripts/prototyping/run-notebooks.sh
9089

90+
# アセット (計算環境、データアセット、環境) の作成
9191
bash ./scripts/assets/create-compute.sh
9292
bash ./scripts/assets/create-data.sh
9393
bash ./scripts/assets/create-environment.sh
9494

95+
# Job の実行
9596
bash ./scripts/jobs/train.sh
9697

97-
bash ./scripts/assets/register-model.sh
98+
# モデルの登録
9899
bash ./scripts/assets/register-model.sh
99100

101+
# 推論環境の構築
100102
bash ./scripts/endpoints/deploy-online-endpoint-custom.sh
101103
bash ./scripts/endpoints/deploy-online-endpoint-mlflow.sh
102104
bash ./scripts/endpoints/deploy-batch-endpoint-custom.sh
103105
bash ./scripts/endpoints/deploy-batch-endpoint-mlflow.sh
104106
```
107+
108+
---
109+
110+
## 2. CI/CD の実行
111+
112+
### GitHub Actions のシークレット作成
113+
- GitHub Actions のシークレットを作成します。
114+
- GROUP: Azure Machine Learning ワークスペースのリソースグループ名
115+
- WORKSPACE: Azure Machine Learning ワークスペースの名前
116+
- SUBSCRIPTION: Azure サブスクリプション ID
117+
- AZURE_CREDENTIALS: Azure の接続情報
118+
- Azure Service Principal を利用する想定で書かれています。技術的には OpenID Connect の利用も可能ですが、本ドキュメントやコードは Azure Service Principal を利用することを前提に作成されています。
119+
- 資格情報とそれをシークレット AZURE_CREDENTAL に設定する詳細な方法は [Azure Machine Learning で GitHub Actions を使用する - 手順2. Azure での認証](https://learn.microsoft.com/ja-JP/azure/machine-learning/how-to-github-actions-machine-learning?tabs=userlevel#step-2-authenticate-with-azure) をご参照ください。
120+
121+
### GitHub Actions の有効化と実行
122+
Fork 先の GitHub のページ内の `Actions` タブにアクセスし、GitHub Actions を有効化します。詳細は [GitHub アクション - ワークフローの無効化と有効化](https://docs.github.com/ja/actions/managing-workflow-runs/disabling-and-enabling-a-workflow) をご確認ください。

0 commit comments

Comments
 (0)