Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
59 changes: 59 additions & 0 deletions .github/workflows/translate_docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Translate Docs

on:
workflow_dispatch:
push:
branches:
- main
paths:
- docs/**

jobs:
translate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Get changed files in docs
run: |
git fetch origin main
git diff --name-only ${{ github.event.before }} ${{ github.sha }} -- docs/ > changed_files.txt
cat changed_files.txt

- name: Run translate_docs.py
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
run: |
pip install litellm
python tools/translate_docs.py $(cat changed_files.txt)
rm changed_files.txt

- name: Get current commit hash
id: get_hash
run: echo "hash=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT

- name: Commit and create PR
run: |
git config user.name "github-actions"
git config user.email "[email protected]"
git add .
if [ -n "$(git diff --cached --name-only)" ]; then
git commit -m "Translate docs and copy files"
git push origin HEAD:translate-output-${{ steps.get_hash.outputs.hash }}
echo "changes_committed=true" >> $GITHUB_ENV
else
echo "No changes to commit."
echo "changes_committed=false" >> $GITHUB_ENV
fi

- name: Create PR
if: env.changes_committed == 'true'
uses: peter-evans/create-pull-request@v5
with:
branch: translate-output-${{ steps.get_hash.outputs.hash }}
title: "Automated translation and file copy"
body: |
Processed changed docs files.
Commit hash: ${{ steps.get_hash.outputs.hash }}
4 changes: 2 additions & 2 deletions docs/weaviate/best-practices/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ As the size of your dataset grows, the accompanying vector indexes can lead to h

If you have a large number of vectors, consider using vector quantization to reduce the memory footprint of the vector index. This will reduce the required memory, and allow you to scale more effectively at lower costs.

![Overview of quantization schemes](../../../_includes/images/concepts/quantization_overview_light.png#gh-light-mode-only "Overview of quantization schemes")
![Overview of quantization schemes](../../../_includes/images/concepts/quantization_overview_dark.png#gh-dark-mode-only "Overview of quantization schemes")
![Overview of quantization schemes](@site/_includes/images/concepts/quantization_overview_light.png#gh-light-mode-only "Overview of quantization schemes")
![Overview of quantization schemes](@site/_includes/images/concepts/quantization_overview_dark.png#gh-dark-mode-only "Overview of quantization schemes")

For HNSW indexes, we suggest enabling product quantization (PQ) as a starting point. It provides a good set of default trade-offs between memory usage and query performance, as well as tunable parameters to optimize for your specific use case.

Expand Down
6 changes: 5 additions & 1 deletion docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const config = {

i18n: {
defaultLocale: "en",
locales: ["en"],
locales: ["en", "ja"],
},

headTags: [commonRoomScript, hubspotScript],
Expand Down Expand Up @@ -144,6 +144,10 @@ const config = {
position: "right",
className: "hiddenSearch",
},
{
type: "localeDropdown",
position: "right",
}
],
},
prism: {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
title: 2. Weaviate のカスタマイズ
sidebar_position: 200
---

import LearningGoals from '/src/components/Academy/learningGoals.jsx';
import CourseUnits from '/src/components/Academy/courseUnits.jsx';
import { courseData } from '/src/components/Academy/courseData.js'

## <i class="fa-solid fa-chalkboard-user"></i> コース概要

TBC

## <i class="fa-solid fa-chalkboard-user"></i> 学習目標

<LearningGoals courseName="customization_with_modules"/>

## <i class="fa-solid fa-book-open-reader"></i> ユニット

<CourseUnits courseData={courseData} courseName="customization_with_modules" />
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

<Tabs groupId="languages">
<TabItem value="py" label="Python">

import weaviate
```python

client = weaviate.Client("https://WEAVIATE_INSTANCE_URL") # Replace WEAVIATE_INSTANCE_URL with your instance URL

query = '''
{
Get {
WikiArticle {
title
wiki_summary
}
}
}
'''

result = client.query.raw(query)

print(result)
```

</TabItem>
<TabItem value="js" label="JS/TS Client v2">

```js
Coming soon
```

</TabItem>
<TabItem value="go" label="Go">

```go
TBC
```

</TabItem>
<TabItem value="java" label="Java">

```java
TBC
```

</TabItem>
</Tabs>
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
<details>
<summary>
スキーマの例
</summary>
<div>

```json
{
"classes": [
{
"class": "Category",
"description": "A Jeopardy! category",
...
"properties": [
{
"dataType": [
"text"
],
"description": "The title of the category",
"name": "title",
"tokenization": "word"
}
],
...
"vectorizer": "text2vec-openai"
},
{
"class": "Question",
...
"properties": [
{
"dataType": [
"text"
],
"description": "Question asked to the contestant",
...
"name": "question",
"tokenization": "word"
},
{
"dataType": [
"text"
],
"description": "Answer provided by the contestant",
...
"name": "answer",
"tokenization": "word"
},
{
"dataType": [
"int"
],
"description": "Points that the question was worth",
...
"name": "points"
},
{
"dataType": [
"text"
],
"description": "Jeopardy round",
...
"name": "round"
},
{
"dataType": [
"Category"
],
"description": "The category of the question",
...
"name": "hasCategory"
}
...
],
...
"vectorizer": "text2vec-openai"
}
]
}
```

</div>
</details>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
:::note プレビュー版ユニット
このユニットはプレビュー版です。
そのため、動画やクイズ問題など、いくつかのセクションがまだ完成していません。
完全版が公開されるまで、しばらくお待ちください。その間、下のコメント欄からご意見・ご感想をお寄せいただければ幸いです。
:::
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"label": "Deployment",
"position": 50
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
---
title: Kubernetes クラスターの作成
---

**Kubernetes** はオープンソースの *コンテナー オーケストレーション* プラットフォームです。つまり、 Kubernetes を使用すると、 [コンテナ化](https://www.docker.com/resources/what-container/) されたアプリケーションをデプロイ、スケール、および管理できます。

本番環境では、 Kubernetes は AWS、 Google Cloud、 Azure などのクラウド プロバイダー上やオンプレミスのインフラストラクチャ上にあるノード クラスターを管理するために使用されます。

ここでは、 **Minikube** という便利なツールを使って、開発およびテスト目的でローカル マシン上に Kubernetes クラスターを実行する方法を学びます。

:::info 本番環境の Kubernetes クラスターをお持ちの場合
本番環境の Kubernetes クラスターに Weaviate をデプロイしたい場合も手順はほぼ同じです。 Minikube を本番環境の Kubernetes クラスターに置き換えるだけです。

Kubernetes デプロイメントには多くのバリエーションがあるため、ご利用のクラウド プロバイダーや Kubernetes ディストリビューションが提供するデプロイ手順に従うことをおすすめします。
:::

## <i class="fa-solid fa-square-chevron-right"></i> 前提条件

このチュートリアルでは、次のツールが必要です。

- ** Minikube ** : ローカル マシン上で Kubernetes クラスターを実行するツール。ローカルで Kubernetes デプロイメントをテストするために使用します。
- ** kubectl ** : Kubernetes のコマンドライン ツール。 Kubernetes クラスターとの対話に使用します。
- ** Docker ** : アプリケーションをコンテナーで開発、配布、実行できるプラットフォーム。 Minikube の [*driver*](https://minikube.sigs.k8s.io/docs/drivers/) として Docker をインストールし、ローカル マシン上で Kubernetes クラスターを仮想化します。 Minikube は別のドライバーを使用してもかまいませんが、 Docker が最も一般的です。
- ** Helm ** : Kubernetes 用のパッケージ マネージャー。 Kubernetes 上でアプリケーションをインストールおよび管理するために使用します。

### <i class="fa-solid fa-code"></i> インストール

これらのツールがインストールされていない場合は、以下のリンク先の手順に従ってインストールしてください。

- [ Minikube ](https://minikube.sigs.k8s.io/docs/start/)
- [ kubectl ](https://kubernetes.io/docs/tasks/tools/#kubectl)
- [ Docker ](https://docs.docker.com/get-docker/)
- [ Helm ](https://helm.sh/docs/intro/install/)

インストール後、次のコマンドを実行してインストールを確認します。

```bash
minikube version
kubectl version --client
docker --version
helm version
```

次のような出力が表示されます。

```bash
minikube version: v1.32.0
commit: 8220a6eb95f0a4d75f7f2d7b14cef975f050512d
Client Version: v1.28.2
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
Docker version 24.0.7, build afdd53b
version.BuildInfo{Version:"v3.12.2", GitCommit:"1e210a2c8cc5117d1055bfaa5d40f51bbc2e345e", GitTreeState:"clean", GoVersion:"go1.20.6"}
```

同様の出力が得られれば、準備完了です。

表示されるバージョンは上記と異なる場合があります。最新バージョンがインストールされていることを確認してください。

## <i class="fa-solid fa-square-chevron-right"></i> Minikube の実行

準備ができたら Minikube を起動します。以下のコマンドを実行してください。

```bash
minikube start
```

すると、次のような出力が表示される場合があります。

```bash
😄 minikube v1.32.0 on Darwin 14.4.1 (arm64)
✨ Automatically selected the docker driver. Other choices: vmware, ssh
📌 Using Docker Desktop driver with root privileges
👍 Starting control plane node minikube in cluster minikube
🚜 Pulling base image ...
💾 Downloading Kubernetes v1.28.3 preload ...
> preloaded-images-k8s-v18-v1...: 341.16 MiB / 341.16 MiB 100.00% 42.00 M
> gcr.io/k8s-minikube/kicbase...: 410.56 MiB / 410.58 MiB 100.00% 42.28 M
🔥 Creating docker container (CPUs=2, Memory=8100MB) ...
🐳 Preparing Kubernetes v1.28.3 on Docker 24.0.7 ...
▪ Generating certificates and keys ...
▪ Booting up control plane ...
▪ Configuring RBAC rules ...
🔗 Configuring bridge CNI (Container Networking Interface) ...
🔎 Verifying Kubernetes components...
▪ Using image gcr.io/k8s-minikube/storage-provisioner:v5
🌟 Enabled addons: storage-provisioner, default-storageclass
🏄 Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default
```

素晴らしいです! Minikube を使って Kubernetes クラスターを起動できました。最後のコメントに `kubectl is now configured to use "minikube" cluster and "default" namespace by default` と表示されている点に注目してください。これで `kubectl` を使用して Kubernetes クラスターと対話できます。

### <i class="fa-solid fa-code"></i> クラスターの確認

次のコマンドを実行すると、

```bash
kubectl get pods -A
```

クラスター内で稼働している Pod が表示されます。例としては以下のようになります。

```bash
NAMESPACE NAME READY STATUS RESTARTS AGE
kube-system coredns-5dd5756b68-qhfch 1/1 Running 0 26s
kube-system etcd-minikube 1/1 Running 0 42s
kube-system kube-apiserver-minikube 1/1 Running 0 40s
kube-system kube-controller-manager-minikube 1/1 Running 0 42s
kube-system kube-proxy-xwdgf 1/1 Running 0 26s
kube-system kube-scheduler-minikube 1/1 Running 0 40s
kube-system storage-provisioner 1/1 Running 0 39s
```

上記と似た出力が得られれば、おめでとうございます! Minikube を使用してローカル マシン上に Kubernetes クラスターを立ち上げることに成功しました。

次は、 Helm を利用して Weaviate を Kubernetes クラスターにデプロイする方法を学びます。


## 質問とフィードバック

import DocsFeedback from '/_includes/docs-feedback.mdx';

<DocsFeedback/>
Loading