時間がない人のために
以下の内容で docker-compose.yaml
を作成し起動してください。
※2024-08-01時点では、weaviate のバージョンは、1.26.1
です。最新のバージョンに書き換えても動くと思います。
---
services:
weaviate:
command:
- --host
- 0.0.0.0
- --port
- '8080'
- --scheme
- http
image: cr.weaviate.io/semitechnologies/weaviate:1.26.1
ports:
- 8080:8080
- 50051:50051
volumes:
- /home/jetson-01/weaviate-1.26.1/data:/var/lib/weaviate
restart: on-failure:0
environment:
TRANSFORMERS_INFERENCE_API: 'http://t2v-transformers:8080'
SUM_INFERENCE_API: 'http://sum-transformers:8080'
RERANKER_INFERENCE_API: 'http://reranker-transformers:8080'
QUERY_DEFAULTS_LIMIT: 25
AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED: 'true'
PERSISTENCE_DATA_PATH: '/var/lib/weaviate'
DEFAULT_VECTORIZER_MODULE: 'text2vec-transformers'
ENABLE_MODULES: 'text2vec-transformers,sum-transformers,ref2vec-centroid,reranker-transformers'
CLUSTER_HOSTNAME: 'node1'
t2v-transformers:
image: ghcr.io/microaijp/jetson-transformers-inference:sentence-transformers-paraphrase-multilingual-minilm-l12-v2
environment:
ENABLE_CUDA: '1'
NVIDIA_VISIBLE_DEVICES: 'all'
deploy:
resources:
reservations:
devices:
- capabilities:
- 'gpu'
sum-transformers:
image: ghcr.io/microaijp/jetson-sum-transformers:facebook-bart-large-cnn-1.0.0
environment:
ENABLE_CUDA: '1'
NVIDIA_VISIBLE_DEVICES: 'all'
deploy:
resources:
reservations:
devices:
- capabilities:
- 'gpu'
reranker-transformers:
image: ghcr.io/microaijp/jetson-reranker-transformers:cross-encoder-ms-marco-minilm-l-6-v2
environment:
ENABLE_CUDA: '1'
NVIDIA_VISIBLE_DEVICES: 'all'
deploy:
resources:
reservations:
devices:
- capabilities:
- 'gpu'
volumes:
weaviate_data:
...
※/home/jetson-01/weaviate-1.26.1/data
は、↓の絶対パスに書き換えてください
データ保存用ディレクトリ作成
起動
docker compose up -d
で起動できます。
ベースとなるDocker Compose
ここからリビルドしたときのログです。以下の docker-compose.yaml をベースにしています。
---
services:
weaviate:
command:
- --host
- 0.0.0.0
- --port
- '8080'
- --scheme
- http
image: cr.weaviate.io/semitechnologies/weaviate:1.26.1
ports:
- 8080:8080
- 50051:50051
volumes:
- weaviate_data:/var/lib/weaviate
restart: on-failure:0
environment:
TRANSFORMERS_INFERENCE_API: 'http://t2v-transformers:8080'
SUM_INFERENCE_API: 'http://sum-transformers:8080'
RERANKER_INFERENCE_API: 'http://reranker-transformers:8080'
QUERY_DEFAULTS_LIMIT: 25
AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED: 'true'
PERSISTENCE_DATA_PATH: '/var/lib/weaviate'
DEFAULT_VECTORIZER_MODULE: 'text2vec-transformers'
ENABLE_MODULES: 'text2vec-transformers,sum-transformers,ref2vec-centroid,reranker-transformers'
CLUSTER_HOSTNAME: 'node1'
t2v-transformers:
image: cr.weaviate.io/semitechnologies/transformers-inference:sentence-transformers-paraphrase-multilingual-MiniLM-L12-v2
environment:
ENABLE_CUDA: '1'
NVIDIA_VISIBLE_DEVICES: 'all'
deploy:
resources:
reservations:
devices:
- capabilities:
- 'gpu'
sum-transformers:
image: cr.weaviate.io/semitechnologies/sum-transformers:facebook-bart-large-cnn-1.0.0
environment:
ENABLE_CUDA: '1'
NVIDIA_VISIBLE_DEVICES: 'all'
deploy:
resources:
reservations:
devices:
- capabilities:
- 'gpu'
reranker-transformers:
image: cr.weaviate.io/semitechnologies/reranker-transformers:cross-encoder-ms-marco-MiniLM-L-6-v2
environment:
ENABLE_CUDA: '1'
NVIDIA_VISIBLE_DEVICES: 'all'
deploy:
resources:
reservations:
devices:
- capabilities:
- 'gpu'
volumes:
weaviate_data:
...
- sum-transformers
- reranker-transformers
の4つを動かす必要があります。
weaviate 自体は GPU を使わないので、t2v-transformers
と sum-transformers
と reranker-transformers
をリビルドしていきます。
ソースコードを抜き出す
ホスト側でソースコードのコピーを保存するディレクトリを作る
$ cd
$ mkdir weaviate-1.26.1
$ mkdir weaviate-1.26.1/t2v-transformers
$ mkdir weaviate-1.26.1/sum-transformers
$ mkdir weaviate-1.26.1/reranker-transformers
一時的にコンテナを起動して、ソースコードをホストにコピーする
t2v-transformers
docker pull cr.weaviate.io/semitechnologies/transformers-inference:sentence-transformers-paraphrase-multilingual-MiniLM-L12-v2
docker run -it --rm --name temp_container cr.weaviate.io/semitechnologies/transformers-inference:sentence-transformers-paraphrase-multilingual-MiniLM-L12-v2 /bin/bash
ホスト側で
docker cp temp_container:/app ~/weaviate-1.26.1/t2v-transformers
コンテナ側
docker pull cr.weaviate.io/semitechnologies/sum-transformers:facebook-bart-large-cnn-1.0.0
docker run -it --rm --name temp_container cr.weaviate.io/semitechnologies/sum-transformers:facebook-bart-large-cnn-1.0.0 /bin/bash
ホスト側で
docker cp temp_container:/app ~/weaviate-1.26.1/sum-transformers
コンテナ側
exit
reranker-transformers
docker pull cr.weaviate.io/semitechnologies/reranker-transformers:cross-encoder-ms-marco-MiniLM-L-6-v2
docker create --name temp_container_reranker cr.weaviate.io/semitechnologies/reranker-transformers:cross-encoder-ms-marco-MiniLM-L-6-v2
docker cp temp_container_reranker:/app ~/weaviate-1.26.1/reranker-transformers/
Dockerfile の作成&ビルド
t2v-transformers
cd ~/weaviate-1.26.1/t2v-transformers
nano requirements.txt
不足ライブラリを追加
transformers
fastapi
uvicorn
nltk
sentencepiece
sentence-transformers
optimum
onnxruntime
もともとある requirements.txt を削除しておく
mv ~/weaviate-1.26.1/t2v-transformers/app/requirements.txt ~/weaviate-1.26.1/t2v-transformers/app/requirements.txt.bk
FROM dustynv/l4t-pytorch:r36.2.0
WORKDIR /app
RUN apt-get update
RUN apt-get install -y libsndfile1
RUN pip install --upgrade pip setuptools
COPY requirements.txt .
RUN pip3 install -r requirements.txt
COPY app .
ENV MODEL_NAME=sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2
ARG TARGETARCH
ARG MODEL_NAME
ARG ONNX_RUNTIME
ENV ONNX_CPU=${TARGETARCH}
RUN ./download.py
COPY . .
ENTRYPOINT ["/bin/sh", "-c"]
CMD ["uvicorn app:app --host 0.0.0.0 --port 8080"]
リビルト実行
sudo docker build -t microaijp/transformers-inference:sentence-transformers-paraphrase-multilingual-MiniLM-L12-v2 .
起動確認
sudo docker run --runtime=nvidia --rm \
--name microai-t2v-transformers \
--gpus all \
-e ENABLE_CUDA=1 \
-e NVIDIA_VISIBLE_DEVICES=all \
-p 8080:8080 \
microaijp/transformers-inference:sentence-transformers-paraphrase-multilingual-MiniLM-L12-v2
タグ付け&私の ghcr に pushします。
echo "ghp_XXXXXXXXXXXXXXXXX" | sudo docker login ghcr.io -u microaijp --password-stdin
sudo docker tag microaijp/transformers-inference:sentence-transformers-paraphrase-multilingual-MiniLM-L12-v2 ghcr.io/microaijp/jetson-transformers-inference:sentence-transformers-paraphrase-multilingual-MiniLM-L12-v2
sudo docker push ghcr.io/microaijp/jetson-transformers-inference:sentence-transformers-paraphrase-multilingual-MiniLM-L12-v2
sum-transformers
cd ~/weaviate-1.26.1/sum-transformers
nano requirements.txt
不足ライブラリを追加
pydantic
transformers
fastapi
uvicorn
もともとある requirements.txt を削除しておく
mv ~/weaviate-1.26.1/sum-transformers/app/requirements.txt ~/weaviate-1.26.1/sum-transformers/app/requirements.txt.bk
FROM dustynv/l4t-pytorch:r36.2.0
WORKDIR /app
COPY requirements.txt .
RUN pip3 install -r requirements.txt
ENV MODEL_NAME=facebook/bart-large-cnn
# COPY download.py .
COPY app .
RUN chmod +x ./download.py
RUN ./download.py
COPY . .
ENTRYPOINT ["/bin/sh", "-c"]
CMD ["uvicorn app:app --host 0.0.0.0 --port 8080"]
リビルド
sudo docker build -t microaijp/sum-transformers:facebook-bart-large-cnn-1.0.0 .
起動確認
sudo docker run --runtime=nvidia --rm \
--name microai-sum-transformers \
--gpus all \
-e ENABLE_CUDA=1 \
-e NVIDIA_VISIBLE_DEVICES=all \
-p 8080:8080 \
microaijp/sum-transformers:facebook-bart-large-cnn-1.0.0
タグ付け&私の ghcr に pushします。
echo "ghp_XXXXXXXXXXXXXXXXX" | sudo docker login ghcr.io -u microaijp --password-stdin
sudo docker tag microaijp/sum-transformers:facebook-bart-large-cnn-1.0.0 ghcr.io/microaijp/jetson-sum-transformers:facebook-bart-large-cnn-1.0.0
sudo docker push ghcr.io/microaijp/jetson-sum-transformers:facebook-bart-large-cnn-1.0.0
reranker-transformers
cd ~/weaviate-1.26.1/rerunker-transformers
nano requirements.txt
不足ライブラリを追加
pydantic
transformers
sentence-transformers
fastapi
uvicorn
もともとある requirements.txt を削除しておく
mv ~/weaviate-1.26.1/sum-transformers/app/requirements.txt ~/weaviate-1.26.1/sum-transformers/app/requirements.txt.bk
FROM dustynv/l4t-pytorch:r36.2.0
WORKDIR /app
COPY requirements.txt .
RUN pip3 install -r requirements.txt
# COPY download.py .
COPY app .
RUN chmod +x ./download.py
RUN ./download.py
COPY . .
ENTRYPOINT ["/bin/sh", "-c"]
CMD ["uvicorn app:app --host 0.0.0.0 --port 8080"]
リビルド
sudo docker build -t microaijp/reranker-transformers:cross-encoder-ms-marco-MiniLM-L-6-v2 .
起動確認
sudo docker run --runtime=nvidia --rm \
--name microai-reranker-transformers \
--gpus all \
-e ENABLE_CUDA=1 \
-e NVIDIA_VISIBLE_DEVICES=all \
-p 8080:8080 \
microaijp/reranker-transformers:cross-encoder-ms-marco-MiniLM-L-6-v2
タグ付け&私の ghcr に pushします。
echo "ghp_XXXXXXXXXXXXXXXXX" | sudo docker login ghcr.io -u microaijp --password-stdin
sudo docker tag microaijp/reranker-transformers:cross-encoder-ms-marco-MiniLM-L-6-v2 ghcr.io/microaijp/jetson-reranker-transformers:cross-encoder-ms-marco-MiniLM-L-6-v2
sudo docker push ghcr.io/microaijp/jetson-reranker-transformers:cross-encoder-ms-marco-MiniLM-L-6-v2
Docker Compose 作成
データ保存用ディレクトリ作成
mkdir -p ~/weaviate-1.26.1/data
docker-compose.yaml 作成
cd ~/weaviate-1.26.1
nano docker-compose.yaml
※/home/jetson-01/weaviate-1.26.1/data
は、↑の絶対パスに書き換えてください
---
services:
weaviate:
command:
- --host
- 0.0.0.0
- --port
- '8080'
- --scheme
- http
image: cr.weaviate.io/semitechnologies/weaviate:1.26.1
ports:
- 8080:8080
- 50051:50051
volumes:
- /home/jetson-01/weaviate-1.26.1/data:/var/lib/weaviate
restart: on-failure:0
environment:
TRANSFORMERS_INFERENCE_API: 'http://t2v-transformers:8080'
SUM_INFERENCE_API: 'http://sum-transformers:8080'
RERANKER_INFERENCE_API: 'http://reranker-transformers:8080'
QUERY_DEFAULTS_LIMIT: 25
AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED: 'true'
PERSISTENCE_DATA_PATH: '/var/lib/weaviate'
DEFAULT_VECTORIZER_MODULE: 'text2vec-transformers'
ENABLE_MODULES: 'text2vec-transformers,sum-transformers,ref2vec-centroid,reranker-transformers'
CLUSTER_HOSTNAME: 'node1'
t2v-transformers:
image: ghcr.io/microaijp/jetson-transformers-inference:sentence-transformers-paraphrase-multilingual-minilm-l12-v2
environment:
ENABLE_CUDA: '1'
NVIDIA_VISIBLE_DEVICES: 'all'
deploy:
resources:
reservations:
devices:
- capabilities:
- 'gpu'
sum-transformers:
image: ghcr.io/microaijp/jetson-sum-transformers:facebook-bart-large-cnn-1.0.0
environment:
ENABLE_CUDA: '1'
NVIDIA_VISIBLE_DEVICES: 'all'
deploy:
resources:
reservations:
devices:
- capabilities:
- 'gpu'
reranker-transformers:
image: ghcr.io/microaijp/jetson-reranker-transformers:cross-encoder-ms-marco-minilm-l-6-v2
environment:
ENABLE_CUDA: '1'
NVIDIA_VISIBLE_DEVICES: 'all'
deploy:
resources:
reservations:
devices:
- capabilities:
- 'gpu'
volumes:
weaviate_data:
...
起動
起動確認
docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
a3de3afeb478 ghcr.io/microaijp/jetson-sum-transformers:facebook-bart-large-cnn-1.0.0 "/bin/sh -c 'uvicorn…" 17 seconds ago Up 15 seconds weaviate-1261-sum-transformers-1
42c2e58f70bd ghcr.io/microaijp/jetson-transformers-inference:sentence-transformers-paraphrase-multilingual-minilm-l12-v2 "/bin/sh -c 'uvicorn…" 17 seconds ago Up 15 seconds weaviate-1261-t2v-transformers-1
238a1ed30421 ghcr.io/microaijp/jetson-reranker-transformers:cross-encoder-ms-marco-minilm-l-6-v2 "/bin/sh -c 'uvicorn…" 17 seconds ago Up 16 seconds weaviate-1261-reranker-transformers-1
65fca361a0b9 cr.weaviate.io/semitechnologies/weaviate:1.26.1 "/bin/weaviate --hos…" 17 seconds ago Up 16 seconds 0.0.0.0:8080->8080/tcp, :::8080->8080/tcp, 0.0.0.0:50051->50051/tcp, :::50051->50051/tcp weaviate-1261-weaviate-1
ログ確認
docker logs weaviate-1261-weaviate-1
{"action":"startup","default_vectorizer_module":"text2vec-transformers","level":"info","msg":"the default vectorizer modules is set to \"text2vec-transformers\", as a result all new schema classes without an explicit vectorizer setting, will use this vectorizer","time":"2024-08-01T22:54:43Z"}
{"action":"startup","auto_schema_enabled":true,"level":"info","msg":"auto schema enabled setting is set to \"true\"","time":"2024-08-01T22:54:43Z"}
{"level":"info","msg":"No resource limits set, weaviate will use all available memory and CPU. To limit resources, set LIMIT_RESOURCES=true","time":"2024-08-01T22:54:43Z"}
{"level":"info","msg":"module offload-s3 is enabled","time":"2024-08-01T22:54:43Z"}
{"action":"transformer_remote_wait_for_startup","error":"send check ready request: Get \"http://t2v-transformers:8080/.well-known/ready\": dial tcp 172.18.0.5:8080: connect: connection refused","level":"warning","msg":"transformer remote inference service not ready","time":"2024-08-01T22:54:44Z"}
{"action":"transformer_remote_wait_for_startup","error":"send check ready request: Get \"http://t2v-transformers:8080/.well-known/ready\": dial tcp 172.18.0.5:8080: connect: connection refused","level":"warning","msg":"transformer remote inference service not ready","time":"2024-08-01T22:54:45Z"}
{"action":"transformer_remote_wait_for_startup","error":"send check ready request: Get \"http://t2v-transformers:8080/.well-known/ready\": dial tcp 172.18.0.5:8080: connect: connection refused","level":"warning","msg":"transformer remote inference service not ready","time":"2024-08-01T22:54:46Z"}
{"action":"transformer_remote_wait_for_startup","error":"send check ready request: Get \"http://t2v-transformers:8080/.well-known/ready\": dial tcp 172.18.0.5:8080: connect: connection refused","level":"warning","msg":"transformer remote inference service not ready","time":"2024-08-01T22:54:47Z"}
{"action":"transformer_remote_wait_for_startup","error":"send check ready request: Get \"http://t2v-transformers:8080/.well-known/ready\": dial tcp 172.18.0.5:8080: connect: connection refused","level":"warning","msg":"transformer remote inference service not ready","time":"2024-08-01T22:54:48Z"}
{"action":"transformer_remote_wait_for_startup","error":"send check ready request: Get \"http://t2v-transformers:8080/.well-known/ready\": dial tcp 172.18.0.5:8080: connect: connection refused","level":"warning","msg":"transformer remote inference service not ready","time":"2024-08-01T22:54:49Z"}
{"action":"transformer_remote_wait_for_startup","error":"send check ready request: Get \"http://t2v-transformers:8080/.well-known/ready\": dial tcp 172.18.0.5:8080: connect: connection refused","level":"warning","msg":"transformer remote inference service not ready","time":"2024-08-01T22:54:50Z"}
{"action":"transformer_remote_wait_for_startup","error":"send check ready request: Get \"http://t2v-transformers:8080/.well-known/ready\": dial tcp 172.18.0.5:8080: connect: connection refused","level":"warning","msg":"transformer remote inference service not ready","time":"2024-08-01T22:54:51Z"}
{"action":"transformer_remote_wait_for_startup","error":"send check ready request: Get \"http://t2v-transformers:8080/.well-known/ready\": dial tcp 172.18.0.5:8080: connect: connection refused","level":"warning","msg":"transformer remote inference service not ready","time":"2024-08-01T22:54:52Z"}
{"level":"info","msg":"open cluster service","servers":{"node1":8300},"time":"2024-08-01T22:54:55Z"}
{"address":"172.18.0.2:8301","level":"info","msg":"starting cloud rpc server ...","time":"2024-08-01T22:54:55Z"}
{"level":"info","msg":"starting raft sub-system ...","time":"2024-08-01T22:54:55Z"}
{"address":"172.18.0.2:8300","level":"info","msg":"tcp transport","tcpMaxPool":3,"tcpTimeout":10000000000,"time":"2024-08-01T22:54:55Z"}
{"level":"info","msg":"loading local db","time":"2024-08-01T22:54:55Z"}
{"level":"info","msg":"local DB successfully loaded","time":"2024-08-01T22:54:55Z"}
{"level":"info","msg":"schema manager loaded","n":0,"time":"2024-08-01T22:54:55Z"}
{"level":"info","metadata_only_voters":false,"msg":"construct a new raft node","name":"node1","time":"2024-08-01T22:54:55Z"}
{"action":"raft","index":0,"level":"info","msg":"raft initial configuration","servers":"[[]]","time":"2024-08-01T22:54:55Z"}
{"last_snapshot_index":0,"last_store_applied_index":0,"last_store_log_applied_index":0,"level":"info","msg":"raft node constructed","raft_applied_index":0,"raft_last_index":0,"time":"2024-08-01T22:54:55Z"}
{"action":"raft","follower":{},"leader-address":"","leader-id":"","level":"info","msg":"raft entering follower state","time":"2024-08-01T22:54:55Z"}
{"level":"warning","msg":"raft no known peers, aborting election","time":"2024-08-01T22:54:56Z"}
{"action":"bootstrap","error":"could not join a cluster from [172.18.0.2:8300]","level":"warning","msg":"failed to join cluster, will notify next if voter","servers":["172.18.0.2:8300"],"time":"2024-08-01T22:54:56Z","voter":true}
{"action":"bootstrap","candidates":[{"Suffrage":0,"ID":"node1","Address":"172.18.0.2:8300"}],"level":"info","msg":"starting cluster bootstrapping","time":"2024-08-01T22:54:56Z"}
{"action":"bootstrap","level":"info","msg":"notified peers this node is ready to join as voter","servers":["172.18.0.2:8300"],"time":"2024-08-01T22:54:56Z"}
{"docker_image_tag":"1.26.1","level":"info","msg":"configured versions","server_version":"1.26.1","time":"2024-08-01T22:54:57Z"}
{"action":"grpc_startup","level":"info","msg":"grpc server listening at [::]:50051","time":"2024-08-01T22:54:57Z"}
{"action":"restapi_management","docker_image_tag":"1.26.1","level":"info","msg":"Serving weaviate at http://[::]:8080","time":"2024-08-01T22:54:57Z"}
{"action":"telemetry_push","level":"info","msg":"telemetry started","payload":"\u0026{MachineID:00ce88a5-f495-4a77-9681-bd013e990904 Type:INIT Version:1.26.1 NumObjects:0 OS:linux Arch:arm64 UsedModules:[]}","time":"2024-08-01T22:54:57Z"}
{"action":"raft","last-leader-addr":"","last-leader-id":"","level":"warning","msg":"raft heartbeat timeout reached, starting election","time":"2024-08-01T22:54:57Z"}
{"action":"raft","level":"info","msg":"raft entering candidate state","node":{},"term":2,"time":"2024-08-01T22:54:57Z"}
{"action":"raft","level":"info","msg":"raft election won","tally":1,"term":2,"time":"2024-08-01T22:54:57Z"}
{"action":"raft","leader":{},"level":"info","msg":"raft entering leader state","time":"2024-08-01T22:54:57Z"}
{"action":"bootstrap","level":"info","msg":"node reporting ready, node has probably recovered cluster from raft config. Exiting bootstrap process","time":"2024-08-01T22:54:58Z"}
{"address":"172.18.0.2:8300","level":"info","msg":"current Leader","time":"2024-08-01T22:54:58Z"}
{"level":"info","msg":"starting migration from old schema","time":"2024-08-01T22:54:58Z"}
{"level":"info","msg":"legacy schema is empty, nothing to migrate","time":"2024-08-01T22:54:58Z"}
{"level":"info","msg":"migration from the old schema has been successfully completed","time":"2024-08-01T22:54:58Z"}
起動に少し時間がかかるため、数回 error ログがでていますが、起動するとでなくくなります。
docker logs weaviate-1261-t2v-transformers-1
INFO: Started server process [18]
INFO: Waiting for application startup.
INFO: CUDA_PER_PROCESS_MEMORY_FRACTION set to 1.0
INFO: CUDA_CORE set to cuda:0
INFO: Application startup complete.
INFO: Uvicorn running on http://0.0.0.0:8080 (Press CTRL+C to quit)
INFO: 172.18.0.2:60004 - "GET /.well-known/ready HTTP/1.1" 204 No Content
docker logs weaviate-1261-sum-transformers-1
INFO: Started server process [19]
INFO: Waiting for application startup.
INFO: CUDA_CORE set to cuda:0
INFO: Application startup complete.
INFO: Uvicorn running on http://0.0.0.0:8080 (Press CTRL+C to quit)
INFO: 172.18.0.2:48414 - "GET /.well-known/ready HTTP/1.1" 204 No Content
docker logs weaviate-1261-reranker-transformers-1
INFO: Started server process [20]
INFO: Waiting for application startup.
INFO: CUDA_CORE set to cuda:0
You passed along `num_labels=3` with an incompatible id to label map: {'0': 'LABEL_0'}. The number of labels wil be overwritten to 1.
You passed along `num_labels=3` with an incompatible id to label map: {'0': 'LABEL_0'}. The number of labels wil be overwritten to 1.
INFO: Application startup complete.
INFO: Uvicorn running on http://0.0.0.0:8080 (Press CTRL+C to quit)
INFO: 172.18.0.2:42662 - "GET /.well-known/ready HTTP/1.1" 204 No Content
上記は3つとも、204 で問題ありません。
ブラウザでアクセスしてみる
データを投入してみる
curl -X POST http://10.0.0.21:8080/v1/objects \
-H 'Content-Type: application/json' \
-d '{
"class": "Article",
"properties": {
"title": "Persistent Data Test",
"content": "This data should persist across container restarts."
}
}'
{"class":"Article","creationTimeUnix":1721771820813,"id":"694bf6a9-4843-451e-bf04-77d5aa446cd7","lastUpdateTimeUnix":1721771820813,"properties":{"content":"This data should persist across contain...
データの一覧を取得してみる
curl -X POST http://10.0.0.21:8080/v1/graphql \
-H 'Content-Type: application/json' \
-d '{"query":"{ Get { Article { title content _additional { id } } } }"}' | jq
{
"data": {
"Get": {
"Article": [
{
"_addit
:
ベクトル検索してみる
curl -X POST http://10.0.0.21:8080/v1/graphql \
-H 'Content-Type: application/json' \
-d '{"query":"{ Get { Article(nearText: {concepts: [\"Persistent Data Test\"]}) { title content _additional { id } } } }"}' | jq
{
"data": {
"Get": {
"Article": [
{
"_additional": {
"id": "b27668f6-1f7a-403a-98ef-5d75917ce76c"
},
"content": "This data should persist across container restarts.",
"title": "Persisten
:
すべてうまく動いてくれました🍻
※jtop で GPU の動きをみると、一瞬すぎてなかなかGPUが動いているところを見れませんが、何度も行っているとGPUが動くところが確認できます。
※データはコンテナ内に保存されるため、再起動しても消えません。