Commit 604cf831 authored by JinHai-CN's avatar JinHai-CN
Browse files

Merge remote-tracking branch 'main/0.5.1' into 0.5.1


Former-commit-id: caa0111442bc4afd7f85c8a5de68e2bd88c7ba0c
parents a4a114c8 3bf12c0d
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -14,6 +14,7 @@ Please mark all change in change log and use the ticket from JIRA.
- \#115 - Using new structure for tasktable
- \#139 - New config option use_gpu_threshold
- \#146 - Add only GPU and only CPU version for IVF_SQ8 and IVF_FLAT
- \#164 - Add CPU version for building index

## Improvement
- \#64 - Improvement dump function in scheduler
@@ -26,6 +27,7 @@ Please mark all change in change log and use the ticket from JIRA.
- \#130 - Set task state MOVED after resource copy it completed
- \#149 - Improve large query optimizer pass
- \#156 - Not return error when search_resources and index_build_device set cpu
- \#159 - Change the configuration name from 'use_gpu_threshold' to 'gpu_search_threshold'

## Task

README_CN.md

0 → 100644
+197 −0
Original line number Diff line number Diff line
![Milvuslogo](https://raw.githubusercontent.com/milvus-io/docs/master/assets/milvus_logo.png)

![LICENSE](https://img.shields.io/badge/license-Apache--2.0-brightgreen)
![Language](https://img.shields.io/badge/language-C%2B%2B-blue)
[![codebeat badge](https://codebeat.co/badges/e030a4f6-b126-4475-a938-4723d54ec3a7?style=plastic)](https://codebeat.co/projects/github-com-jinhai-cn-milvus-master)

![Release](https://img.shields.io/badge/release-v0.5.0-orange)
![Release_date](https://img.shields.io/badge/release_date-October-yellowgreen)

- [Slack 频道](https://join.slack.com/t/milvusio/shared_invite/enQtNzY1OTQ0NDI3NjMzLWNmYmM1NmNjOTQ5MGI5NDhhYmRhMGU5M2NhNzhhMDMzY2MzNDdlYjM5ODQ5MmE3ODFlYzU3YjJkNmVlNDQ2ZTk)
- [Twitter](https://twitter.com/milvusio)
- [Facebook](https://www.facebook.com/io.milvus.5)
- [博客](https://www.milvus.io/blog/)
- [CSDN](https://zilliz.blog.csdn.net/)
- [中文官网](https://www.milvus.io/zh-CN/)

# 欢迎来到 Milvus

## Milvus 是什么

Milvus 是一款开源的、针对海量特征向量的相似性搜索引擎。基于异构众核计算框架设计,成本更低,性能更好。在有限的计算资源下,十亿向量搜索仅毫秒响应。

Milvus 提供稳定的 Python、Java 以及 C++ 的 API 接口。

通过 [版本发布说明](https://milvus.io/docs/zh-CN/release/v0.5.0/) 获取最新发行版本的 Milvus。

- 异构众核

  Milvus 基于异构众核计算框架设计,成本更低,性能更好。

- 多元化索引

  Milvus 支持多种索引方式,使用量化索引、基于树的索引和图索引等算法。

- 资源智能管理

  Milvus 根据实际数据规模和可利用资源,智能调节优化查询计算和索引构建过程。

- 水平扩容

  Milvus 支持在线 / 离线扩容,仅需执行简单命令,便可弹性伸缩计算节点和存储节点。

- 高可用性

  Milvus 集成了 Kubernetes 框架,能有效避免单点障碍情况的发生。

- 简单易用

  Milvus 安装简单,使用方便,并可使您专注于特征向量。

- 可视化监控

  您可以使用基于 Prometheus 的图形化监控,以便实时跟踪系统性能。

## 整体架构

![Milvus_arch](https://github.com/milvus-io/docs/blob/master/assets/milvus_arch.png)

## 开始使用 Milvus

### 硬件要求

| 硬件设备 | 推荐配置                              |
| -------- | ------------------------------------- |
| CPU      | Intel CPU Haswell 及以上              |
| GPU      | NVIDIA Pascal 系列及以上              |
| 内存     | 8 GB 或以上(取决于具体向量数据规模) |
| 硬盘     | SATA 3.0 SSD 及以上                   |

### 使用 Docker

您可以方便地使用 Docker 安装 Milvus。具体请查看 [Milvus 安装指南](https://milvus.io/docs/zh-CN/userguide/install_milvus/)

### 从源代码编译

#### 软件要求

- Ubuntu 18.04 及以上
- CMake 3.14 及以上
- CUDA 10.0 及以上
- NVIDIA driver 418 及以上

#### 编译

##### 第一步 安装依赖项

```shell
$ cd [Milvus sourcecode path]/core
$ ./ubuntu_build_deps.sh
```

##### 第二步 编译

```shell
$ cd [Milvus sourcecode path]/core
$ ./build.sh -t Debug
or 
$ ./build.sh -t Release
```

当您成功编译后,所有 Milvus 必需组件将安装在`[Milvus root path]/core/milvus`路径下。

##### 启动 Milvus 服务

```shell
$ cd [Milvus root path]/core/milvus
```

`LD_LIBRARY_PATH` 中添加 `lib/` 目录:

```shell
$ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path/to/milvus/lib
```

启动 Milvus 服务:

```shell
$ cd scripts
$ ./start_server.sh
```

若要停止 Milvus 服务,请使用如下命令:

```shell
$ ./stop_server.sh
```

若需要修改 Milvus 配置文件 `conf/server_config.yaml``conf/log_config.conf`,请查看 [Milvus 配置](https://milvus.io/docs/zh-CN/reference/milvus_config/)

### 开始您的第一个 Milvus 程序

#### 运行 Python 示例代码

请确保系统的 Python 版本为 [Python 3.5](https://www.python.org/downloads/) 或以上。

安装 Milvus Python SDK。

```shell
# Install Milvus Python SDK
$ pip install pymilvus==0.2.3
```

创建 `example.py` 文件,并向文件中加入 [Python 示例代码](https://github.com/milvus-io/pymilvus/blob/master/examples/advanced_example.py)

运行示例代码

```shell
# Run Milvus Python example
$ python3 example.py
```

#### 运行 C++ 示例代码

```shell
 # Run Milvus C++ example
 $ cd [Milvus root path]/core/milvus/bin
 $ ./sdk_simple
```

#### 运行 Java 示例代码

请确保系统的 Java 版本为 Java 8 或以上。

请从[此处](https://github.com/milvus-io/milvus-sdk-java/tree/master/examples)获取 Java 示例代码。

## 贡献者指南

我们由衷欢迎您推送贡献。关于贡献流程的详细信息,请参阅 [贡献者指南](https://github.com/milvus-io/milvus/blob/master/CONTRIBUTING.md)。本项目遵循 Milvus [行为准则](https://github.com/milvus-io/milvus/blob/master/CODE_OF_CONDUCT.md)。如果您希望参与本项目,请遵守该准则的内容。

我们使用 [GitHub issues](https://github.com/milvus-io/milvus/issues/new/choose) 追踪问题和补丁。若您希望提出问题或进行讨论,请加入我们的社区。

## 加入 Milvus 社区

欢迎加入我们的 [Slack 频道](https://join.slack.com/t/milvusio/shared_invite/enQtNzY1OTQ0NDI3NjMzLWNmYmM1NmNjOTQ5MGI5NDhhYmRhMGU5M2NhNzhhMDMzY2MzNDdlYjM5ODQ5MmE3ODFlYzU3YjJkNmVlNDQ2ZTk) 以便与其他用户和贡献者进行交流。

## Milvus 路线图

请阅读我们的[路线图](https://milvus.io/docs/zh-CN/roadmap/)以获得更多即将开发的新功能。

## 相关链接

[Milvus 官方网站](https://www.milvus.io/)

[Milvus 文档](https://www.milvus.io/docs/en/userguide/install_milvus/)

[Milvus 在线训练营](https://github.com/milvus-io/bootcamp)

[Milvus 博客](https://www.milvus.io/blog/)

[Milvus CSDN](https://zilliz.blog.csdn.net/)

[Milvus 路线图](https://milvus.io/docs/en/roadmap/)

## 许可协议

[Apache 许可协议2.0版](https://github.com/milvus-io/milvus/blob/master/LICENSE)
+1 −1
Original line number Diff line number Diff line
@@ -36,7 +36,7 @@ cache_config:
engine_config:
  use_blas_threshold: 20            # if nq <  use_blas_threshold, use SSE, faster with fluctuated response times
                                    # if nq >= use_blas_threshold, use OpenBlas, slower with stable response times
  use_gpu_threshold: 1000
  gpu_search_threshold: 1000        # threshold beyond which the search computation is executed on GPUs only

resource_config:
  search_resources:                 # define the GPUs used for search computation, must be in format: gpux
+17 −12
Original line number Diff line number Diff line
@@ -104,10 +104,7 @@ JobMgr::build_task(const JobPtr& job) {

void
JobMgr::calculate_path(const TaskPtr& task) {
    if (task->type_ != TaskType::SearchTask) {
        return;
    }

    if (task->type_ == TaskType::SearchTask) {
        if (task->label()->Type() != TaskLabelType::SPECIFIED_RESOURCE) {
            return;
        }
@@ -118,6 +115,14 @@ JobMgr::calculate_path(const TaskPtr& task) {
        auto dest = spec_label->resource();
        ShortestPath(src.lock(), dest.lock(), res_mgr_, path);
        task->path() = Path(path, path.size() - 1);
    } else if (task->type_ == TaskType::BuildIndexTask) {
        auto spec_label = std::static_pointer_cast<SpecResLabel>(task->label());
        auto src = res_mgr_->GetDiskResources()[0];
        auto dest = spec_label->resource();
        std::vector<std::string> path;
        ShortestPath(src.lock(), dest.lock(), res_mgr_, path);
        task->path() = Path(path, path.size() - 1);
    }
}

}  // namespace scheduler
+6 −6
Original line number Diff line number Diff line
@@ -55,8 +55,8 @@ load_simple_config() {
    // get resources
    auto gpu_ids = get_gpu_pool();

    int32_t build_gpu_id;
    config.GetResourceConfigIndexBuildDevice(build_gpu_id);
    int32_t index_build_device_id;
    config.GetResourceConfigIndexBuildDevice(index_build_device_id);

    // create and connect
    ResMgrInst::GetInstance()->Add(ResourceFactory::Create("disk", "DISK", 0, true, false));
@@ -70,15 +70,15 @@ load_simple_config() {
    for (auto& gpu_id : gpu_ids) {
        ResMgrInst::GetInstance()->Add(ResourceFactory::Create(std::to_string(gpu_id), "GPU", gpu_id, true, true));
        ResMgrInst::GetInstance()->Connect("cpu", std::to_string(gpu_id), pcie);
        if (build_gpu_id == gpu_id) {
        if (index_build_device_id == gpu_id) {
            find_build_gpu_id = true;
        }
    }

    if (not find_build_gpu_id) {
    if (not find_build_gpu_id && index_build_device_id != server::CPU_DEVICE_ID) {
        ResMgrInst::GetInstance()->Add(
            ResourceFactory::Create(std::to_string(build_gpu_id), "GPU", build_gpu_id, true, true));
        ResMgrInst::GetInstance()->Connect("cpu", std::to_string(build_gpu_id), pcie);
            ResourceFactory::Create(std::to_string(index_build_device_id), "GPU", index_build_device_id, true, true));
        ResMgrInst::GetInstance()->Connect("cpu", std::to_string(index_build_device_id), pcie);
    }
}

Loading