Add Documentations about DEV container (#7768)

Signed-off-by: xiaofan-luan <xiaofan.luan@zilliz.com>
pull/7727/head
Xiaofan 2021-09-13 09:46:02 +08:00 committed by GitHub
parent 3d6ec9c127
commit 759abd450a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 55 additions and 0 deletions

View File

@ -73,6 +73,57 @@ export OS_NAME=centos7
build/builder.sh make
```
## Dev Containers
Users can also get into the dev containers for development.
Enter root path of Milvus project on your host machine, execute the following commands:
```shell
$ ./scripts/devcontainer.sh up # start Dev container
Creating network "milvus-distributed_milvus" with the default driver
Creating milvus_jaeger_1 ... done
Creating milvus_minio_1 ... done
Creating milvus_pulsar_1 ... done
Creating milvus_etcd_1 ... done
Creating milvus_ubuntu_1 ... done
```
Check running state of Dev Container:
```shell
docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
8835ee913953 quay.io/coreos/etcd:v3.4.13 "etcd -advertise-cli…" 30 seconds ago Up 29 seconds 2379-2380/tcp milvus-distributed_etcd_1
3bd7912f5e98 milvusdb/milvus-distributed-dev:amd64-ubuntu18.04-20201209-104246 "autouseradd --user …" 30 seconds ago Up 29 seconds 22/tcp, 7777/tcp milvus-distributed_ubuntu_1
9fa983091d3d apachepulsar/pulsar:2.6.1 "bin/pulsar standalo…" 30 seconds ago Up 29 seconds milvus-distributed_pulsar_1
80687651517b jaegertracing/all-in-one:latest "/go/bin/all-in-one-…" 30 seconds ago Up 29 seconds 5775/udp, 5778/tcp, 14250/tcp, 14268/tcp, 6831-6832/udp, 16686/tcp milvus-distributed_jaeger_1
22190b591d74 minio/minio:RELEASE.2020-12-03T00-03-10Z
```
3bd7912f5e98 is the docker of milvus dev, other containers are used as unit test dependencies. you can run compile and unit inside the container, enter it:
```shell
docker exec -ti 3bd7912f5e98 bash
```
Compile the project and run unit test, see details at the DEVELOPMENT.md
```shell
make all
```
```shell
make unittest
```
Stop Dev Container
```shell
./scripts/devcontainer.sh down # close Dev container
```
## E2E Tests
Milvus uses Python SDK to write test cases to verify the correctness of Milvus functions. Before run E2E tests, you need a running Milvus:
@ -103,3 +154,7 @@ docker-compose run --rm pytest /bin/bash -c "pytest --host ${MILVUS_SERVICE_IP}"
The scripts directly under [`build/`](.) are used to build and test. They will ensure that the `builder` Docker image is built (based on [`build/docker/builder`] ) and then execute the appropriate command in that container. These scripts will both ensure that the right data is cached from run to run for incremental builds and will copy the results back out of the container. You can specify a different registry/name for `builder` by setting `IMAGE_REPO` which defaults to `milvusdb`.
The `builder.sh` is execute by first creating a “docker volume“ directory in `.docker/`. The `.docker/` directory is used to cache the third-party package and compiler cache data. It speeds up recompilation by caching previous compilations and detecting when the same compilation is being done again.
## CROSS DEBUGGING
Need detailed documentation about how to cross debugging between host machine IDE and Dev containers, TODO.