-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
implement ngt-rs and its unit test and add GitHub Actions workflows #2478
Merged
Merged
Changes from 5 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
95eaa1d
implement test
kmrmt 0fe948b
update rust dependencies
kmrmt 0b0cb20
fix
kmrmt f24c989
make format
kmrmt 2e95de4
add Github Actions workflows
kmrmt 4ec9b07
fix
kmrmt 5234248
fix
kmrmt afc1db5
fix
kmrmt 0b98486
fix
kmrmt a8061f3
fix
kmrmt 23f0c70
fix
kmrmt 9a6ab44
fix
kmrmt 138e1c9
fix
kmrmt 7bb5a4b
fix
kmrmt e24bf3a
Merge branch 'main' into feature/agent/implement-ngt-rs-test
kpango File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
# | ||
# Copyright (C) 2019-2024 vdaas.org vald team <[email protected]> | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# You may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# https://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
name: "Build docker image: agent-ngt" | ||
on: | ||
push: | ||
branches: | ||
- "main" | ||
- "release/v*.*" | ||
- "!release/v*.*.*" | ||
tags: | ||
- "*.*.*" | ||
- "v*.*.*" | ||
- "*.*.*-*" | ||
- "v*.*.*-*" | ||
paths: | ||
- ".github/actions/docker-build/action.yaml" | ||
- ".github/workflows/_docker-image.yaml" | ||
- ".github/workflows/dockers-agent-ngt-rust-image.yml" | ||
- "rust/Cargo.lock" | ||
- "rust/Cargo.toml" | ||
- "rust/bin/agent/**" | ||
- "rust/libs/ngt/**" | ||
- "rust/libs/ngt-rs/**" | ||
- "rust/libs/proto/**" | ||
- "dockers/agent/core/ngt-rust/Dockerfile" | ||
- "versions/RUST_VERSION" | ||
- "versions/NGT_VERSION" | ||
pull_request: | ||
paths: | ||
- ".github/actions/docker-build/action.yaml" | ||
- ".github/workflows/_docker-image.yaml" | ||
- ".github/workflows/dockers-agent-image.yml" | ||
- "rust/Cargo.lock" | ||
- "rust/Cargo.toml" | ||
- "rust/bin/agent/**" | ||
- "rust/libs/ngt/**" | ||
- "rust/libs/ngt-rs/**" | ||
- "rust/libs/proto/**" | ||
- "dockers/agent/core/agent/Dockerfile" | ||
- "versions/RUST_VERSION" | ||
- "versions/NGT_VERSION" | ||
pull_request_target: | ||
paths: | ||
- ".github/actions/docker-build/action.yaml" | ||
- ".github/workflows/_docker-image.yaml" | ||
- ".github/workflows/dockers-agent-image.yml" | ||
- "rust/Cargo.lock" | ||
- "rust/Cargo.toml" | ||
- "rust/bin/agent/**" | ||
- "rust/libs/ngt/**" | ||
- "rust/libs/ngt-rs/**" | ||
- "rust/libs/proto/**" | ||
- "dockers/agent/core/agent/Dockerfile" | ||
- "versions/RUST_VERSION" | ||
- "versions/NGT_VERSION" | ||
jobs: | ||
build: | ||
uses: ./.github/workflows/_docker-image.yaml | ||
with: | ||
target: agent-ngt-rust | ||
secrets: inherit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
# syntax = docker/dockerfile:latest | ||
# | ||
# Copyright (C) 2019-2024 vdaas.org vald team <[email protected]> | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# You may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# https://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
ARG DISTROLESS_IMAGE=gcr.io/distroless/cc-debian12 | ||
ARG DISTROLESS_IMAGE_TAG=nonroot | ||
ARG MAINTAINER="vdaas.org vald team <[email protected]>" | ||
|
||
FROM --platform=${TARGETPLATFORM} ubuntu:devel AS builder | ||
|
||
ARG TARGETARCH | ||
ARG TARGETOS | ||
ARG RUST_VERSION | ||
|
||
ENV RUST_HOME /usr/local/lib/rust | ||
ENV RUSTUP_HOME ${RUST_HOME}/rustup | ||
ENV CARGO_HOME ${RUST_HOME}/cargo | ||
ENV DEBIAN_FRONTEND noninteractive | ||
ENV INITRD No | ||
ENV LANG en_US.UTF-8 | ||
ENV PATH ${PATH}:${RUSTUP_HOME}/bin:${CARGO_HOME}/bin | ||
ENV ORG vdaas | ||
ENV REPO vald | ||
ENV PKG agent/core/ngt | ||
ENV APP_NAME ngt | ||
|
||
# skipcq: DOK-DL3008 | ||
RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
build-essential \ | ||
ca-certificates \ | ||
cmake \ | ||
curl \ | ||
g++ \ | ||
gcc \ | ||
git \ | ||
liblapack-dev \ | ||
libomp-dev \ | ||
libopenblas-dev \ | ||
unzip \ | ||
upx \ | ||
&& ldconfig \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/Makefile.d | ||
COPY Makefile.d . | ||
WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO} | ||
COPY Makefile . | ||
COPY .git . | ||
|
||
WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/cmd | ||
COPY cmd . | ||
|
||
WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/versions | ||
COPY versions . | ||
|
||
WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/rust | ||
COPY rust . | ||
|
||
WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO} | ||
RUN make ngt/install | ||
RUN make rust/install | ||
kmrmt marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
RUN make rust/target/release/agent \ | ||
&& mv ./rust/target/release/agent "/usr/bin/${APP_NAME}" | ||
|
||
WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}/cmd/${PKG} | ||
RUN cp sample.yaml /tmp/config.yaml | ||
|
||
FROM --platform=${TARGETPLATFORM} ${DISTROLESS_IMAGE}:${DISTROLESS_IMAGE_TAG} | ||
LABEL maintainer="${MAINTAINER}" | ||
|
||
ENV APP_NAME ngt | ||
|
||
COPY --from=builder /usr/bin/${APP_NAME} /usr/bin/${APP_NAME} | ||
COPY --from=builder /tmp/config.yaml /etc/server/config.yaml | ||
|
||
USER nonroot:nonroot | ||
|
||
ENTRYPOINT ["/usr/bin/ngt"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
# Vald Agent | ||
|
||
<!-- introduction sentence --> | ||
|
||
⚠ This image is under developing and runs incorrectly. | ||
|
||
`vald-agent` is the docker image for the vald-agent component. | ||
|
||
This image is responsible for the following: | ||
|
||
- Store index data along with the user request. | ||
- The store destination is In-Memory, Volume Mounts, Persistent Volume, or External Storage(⚠). | ||
- Search the nearest neighbor vectors of the request vector and return the search result. | ||
|
||
⚠ When you'd like to use the external storage, it requires [vald-agent-sidecar](https://hub.docker.com/r/vdaas/vald-agent-sidecar/tags?page=1&name=latest) on the Kubernetes cluster. | ||
|
||
For more details, please refer to the [component document](https://vald.vdaas.org/docs/overview/component/agent). | ||
|
||
<div align="center"> | ||
<img src="https://github.com/vdaas/vald/blob/main/assets/image/readme.svg?raw=true" width="50%" /> | ||
</div> | ||
|
||
[![latest Image](https://img.shields.io/docker/v/vdaas/vald-agent/latest?label=vald-agent)](https://hub.docker.com/r/vdaas/vald-agent/tags?page=1&name=latest) | ||
[![License: Apache 2.0](https://img.shields.io/github/license/vdaas/vald.svg?style=flat-square)](https://opensource.org/licenses/Apache-2.0) | ||
[![latest ver.](https://img.shields.io/github/release/vdaas/vald.svg?style=flat-square)](https://github.com/vdaas/vald/releases/latest) | ||
[![Twitter](https://img.shields.io/badge/twitter-follow-blue?logo=twitter&style=flat-square)](https://twitter.com/vdaas_vald) | ||
|
||
## Requirement | ||
|
||
<!-- FIXME: If image has some requirements, describe here with :warning: emoji --> | ||
|
||
### linux/amd64 | ||
|
||
- CPU instruction: requires `AVX2` or `AVX512` | ||
|
||
### linux/arm64 | ||
|
||
⚠ This image does NOT support running on M1/M2 Mac. | ||
|
||
## Get Started | ||
|
||
<!-- Get Started --> | ||
<!-- Vald Agent requires more chapter Agent Standalone --> | ||
|
||
You can use `vald-agent` in 3 ways. | ||
|
||
1. One of the components of the Vald cluster | ||
- Refer to [Get Started](https://vald.vdaas.org/docs/tutotial/get-started/). | ||
1. Standalone on the Kubernetes cluster | ||
- Refer to [Vald Agent Standalone on Kubernetes](https://vald.vdaas.org/docs/tutorial/vald-agent-standalone-on-k8s/) | ||
1. Standalone on Docker | ||
- Refer to [Vald Agent Standalone on Docker](https://vald.vdaas.org/docs/tutorial/vald-agent-standalone-on-docker/) | ||
|
||
## Versions | ||
|
||
| tag | linux/amd64 | linux/arm64 | description | | ||
| :------ | :---------: | :---------: | :------------------------------------------------------------------------------------------------------------------------------ | | ||
| latest | ✅ | ✅ | the latest image is the same as the latest version of [vdaas/vald](https://github.com/vdaas/vald) repository version. | | ||
| nightly | ✅ | ✅ | the nightly applies the main branch's source code of the [vdaas/vald](https://github.com/vdaas/vald) repository. | | ||
| vX.Y.Z | ✅ | ✅ | the vX.Y.Z image applies the source code of the [vdaas/vald](https://github.com/vdaas/vald) repository. | | ||
| pr-XXX | ✅ | ❌ | the pr-XXX image applies the source code of the pull request XXX of the [vdaas/vald](https://github.com/vdaas/vald) repository. | | ||
|
||
## Dockerfile | ||
|
||
<!-- FIXME --> | ||
|
||
The `Dockerfile` of this image is [here](https://github.com/vdaas/vald/blob/main/dockers/agent/core/agent/Dockerfile). | ||
|
||
## About Vald Project | ||
|
||
<!-- About Vald Project --> | ||
<!-- This chapter is static --> | ||
|
||
The information about the Vald project, please refer to the following: | ||
|
||
- [Official website](https://vald.vdaas.org) | ||
- [GitHub](https://github.com/vdaas/vald) | ||
|
||
## Contacts | ||
|
||
We're love to support you! | ||
Please feel free to contact us anytime with your questions or issue reports. | ||
|
||
- [Official Slack WS](https://join.slack.com/t/vald-community/shared_invite/zt-db2ky9o4-R_9p2sVp8xRwztVa8gfnPA) | ||
- [GitHub Issue](https://github.com/vdaas/vald/issues) | ||
|
||
## License | ||
|
||
This product is under the terms of the Apache License v2.0; refer [LICENSE](https://github.com/vdaas/vald/blob/main/LICENSE) file. |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pin versions in apt get install. Instead of
apt-get install <package>
useapt-get install <package>=<version>