ColabFold の場合
npx ts-node provisioning/hpc/colabfold/config/generate-template.ts
pcluster create-cluster --cluster-name hpccluster --cluster-configuration provisioning/hpc/colabfold/config/config.yml
- クラスターの作成状況は下記コマンドから確認できます
```sh
pcluster list-clusters
```
```json
Output:
{
"clusters": [
{
"clusterName": "hpcclustercolab",
## CREATE_COMPLETE になればクラスター作成完了
"cloudformationStackStatus": "CREATE_COMPLETE",
...
```
### 3. ウェブフロントエンドの構築
```sh
## 下記コマンドでクラスターの HeadNode のインスタンス ID を取得
pcluster describe-cluster -n hpccluster | grep -A 5 headNode | grep instanceId
"instanceId": "i-{任意のID}",
```
- `provisioning/bin/provisioning.ts` にある `ssmInstanceId` の値を上記インスタンス ID に修正
```diff
-const ssmInstanceId = 'your-headnode-instanceid'
+const ssmInstanceId = 'i-{任意のID}'
```
- `provisioning/bin/provisioning.ts` にある `allowIp4Ranges` の値を、フロントエンドへの接続を許可する IP アドレスレンジに修正
```diff
-const allowIp4Ranges = ['your-global-ip-v4-cidr']
+const allowIp4Ranges = ['xx.xx.xx.xx/xx']
```
- 修正後、フロントエンドをデプロイ
```sh
## フロントエンドのデプロイ
cd ~/environment/alphafold-protein-structure-prediction-with-frontend-app/provisioning
npx cdk deploy FrontendStack --require-approval never
```
- `cdk deploy` の Outputs にある `CloudFrontWebDistributionEndpoint` の値がフロントエンドの URL になります
### 4. HeadNode の構築
```sh
## 秘密鍵を使用して ParallelCluster の HeadNode に SSH ログイン
export AWS_DEFAULT_REGION=us-east-1
pcluster ssh --cluster-name hpccluster -i ~/.ssh/keypair-alphafold2.pem
```
- HeadNode にログインして、AlphaFold2 をインストール
```sh
bash /fsx/alphafold2/scripts/bin/app_install.sh
```
- AlphaFold2 に必要なデータベースをダウンロードします。これには 12時間ほどかかります。実行を開始したら、Cloud9 の画面を閉じても構いません。
```sh
nohup bash /fsx/alphafold2/scripts/bin/setup_database.sh &
```