Skip to content

Commit

Permalink
Use e2-standard-2
Browse files Browse the repository at this point in the history
  • Loading branch information
nownabe committed Apr 5, 2023
1 parent 0b1e6e6 commit 5be3c7f
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 17 deletions.
16 changes: 8 additions & 8 deletions TUTORIAL.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,14 +195,14 @@ gcloud ai index-endpoints create \
作成したインデックスをインデックス エンドポイントにデプロイします。

```bash
index_id="$(gcloud ai indexes list --region us-central1 --format "value(name)" | cut -d/ -f6)"
index_endpoint_id="$(gcloud ai index-endpoints list --region us-central1 --format "value(name)" | cut -d/ -f6)"
gcloud ai index-endpoints deploy-index \
"$index_endpoint_id" \
--region us-central1 \
--deployed-index-id flowers_search_index \
--display-name "Deployed flower search index" \
--index "$index_id"
index_endpoint_id="$(gcloud ai index-endpoints list --region us-central1 --format "value(name)" | cut -d/ -f6)"
INDEX_ID="$(gcloud ai indexes list --region us-central1 --format "value(name)")" \
envsubst < deploy_index_body.json.tpl | \
curl -X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
"https://us-central1-aiplatform.googleapis.com/v1/projects/<walkthrough-project-id />/locations/us-central1/indexEndpoints/$index_endpoint_id:deployIndex" \
-d @-
```

デプロイには数分から数十分かかります。表示されたコマンドを実行するか、コンソールからステータスが確認できます。
Expand Down
16 changes: 8 additions & 8 deletions TUTORIAL.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,14 +195,14 @@ gcloud ai index-endpoints create \
Deploy the built index to the index endpoint.

```bash
index_id="$(gcloud ai indexes list --region us-central1 --format "value(name)" | cut -d/ -f6)"
index_endpoint_id="$(gcloud ai index-endpoints list --region us-central1 --format "value(name)" | cut -d/ -f6)"
gcloud ai index-endpoints deploy-index \
"$index_endpoint_id" \
--region us-central1 \
--deployed-index-id flowers_search_index \
--display-name "Deployed flower search index" \
--index "$index_id"
index_endpoint_id="$(gcloud ai index-endpoints list --region us-central1 --format "value(name)" | cut -d/ -f6)"
INDEX_ID="$(gcloud ai indexes list --region us-central1 --format "value(name)")" \
envsubst < deploy_index_body.json.tpl | \
curl -X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
"https://us-central1-aiplatform.googleapis.com/v1/projects/<walkthrough-project-id />/locations/us-central1/indexEndpoints/$index_endpoint_id:deployIndex" \
-d @-
```

Deploying this index typically takes 30 or 40 minutes. You can see the job status on Console.
Expand Down
1 change: 1 addition & 0 deletions create_index_body.json.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"config": {
"dimensions": 1280,
"approximateNeighborsCount": 100,
"shardSize": "SHARD_SIZE_SMALL",
"algorithmConfig": { "treeAhConfig": {} }
}
},
Expand Down
2 changes: 1 addition & 1 deletion deploy_index_body.json.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"displayName": "Deployed flower search index",
"dedicatedResources": {
"machineSpec": {
"machineType": "e2-standard-16"
"machineType": "e2-standard-2"
},
"minReplicaCount": 1,
"maxReplicaCount": 1
Expand Down

0 comments on commit 5be3c7f

Please sign in to comment.