Install Milvus db using docker-compose and access using python
Create a docker network to keep the milvus components together
docker network create milvus
Download milvus-standalone-docker-compose.yml and save it as docker-compose.yml
https://milvus.io/docs/install_standalone-docker-compose.md
or use the docker-compose.yml provided here
* did minor code changes to fix volumn error for local docker install
Open terminal session in the same folder as docker-compose.yml file
Execute the docker compose command, this will download MongoDb and install in local docker
docker-compose up -d
Verify the container is running
docker ps
View container logs
docker logs milvus-standalone
Stop the container (when needed)
docker-compose down
Sample code to access Milvus
Demonstrates the basic operations of PyMilvus, a Python SDK of Milvus.
- connect to Milvus
- create collection
- insert data
- create index
- search, query, and hybrid search on entities
- delete entities by PK
- drop collection
Go to the code folder and run notebook or execute the command
python hello_milvus.py
https://github.ibm.com/Alexander-Seymour/milvus-techzone/blob/main/README.md
In case docker-compose is not installed, follow this page for install
https://github.com/docker/compose/releases