Skip to content

Commit

Permalink
[BUGFIX] agent Faiss on ARM doesn't have libquadmath (#2559)
Browse files Browse the repository at this point in the history
Signed-off-by: kpango <kpango@vdaas.org>
  • Loading branch information
kpango authored Aug 2, 2024
1 parent ba5a9d5 commit 70d9daa
Show file tree
Hide file tree
Showing 13 changed files with 62 additions and 56 deletions.
31 changes: 16 additions & 15 deletions .github/workflows/dockers-agent-faiss-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,42 +27,43 @@ on:
- "v*.*.*-*"
pull_request:
paths:
- "!internal/**/*_test.go"
- "!internal/db/**"
- "!internal/k8s/**"
- ".github/actions/docker-build/action.yaml"
- ".github/workflows/_docker-image.yaml"
- ".github/workflows/dockers-agent-faiss-image.yml"
- "Makefile"
- "apis/grpc/**"
- "cmd/agent/core/faiss/**"
- "dockers/agent/core/faiss/Dockerfile"
- "go.mod"
- "go.sum"
- "internal/**"
- "!internal/**/*_test.go"
- "!internal/db/**"
- "!internal/k8s/**"
- "apis/grpc/**"
- "pkg/agent/core/faiss/**"
- "cmd/agent/core/faiss/**"
- "dockers/agent/core/faiss/Dockerfile"
- "versions/GO_VERSION"
- "versions/FAISS_VERSION"
- "versions/GO_VERSION"
pull_request_target:
paths:
- "!internal/**/*_test.go"
- "!internal/db/**"
- "!internal/k8s/**"
- ".github/actions/docker-build/action.yaml"
- ".github/workflows/_docker-image.yaml"
- ".github/workflows/dockers-agent-faiss-image.yml"
- "Makefile"
- "apis/grpc/**"
- "cmd/agent/core/faiss/**"
- "dockers/agent/core/faiss/Dockerfile"
- "go.mod"
- "go.sum"
- "internal/**"
- "!internal/**/*_test.go"
- "!internal/db/**"
- "!internal/k8s/**"
- "apis/grpc/**"
- "pkg/agent/core/faiss/**"
- "cmd/agent/core/faiss/**"
- "dockers/agent/core/faiss/Dockerfile"
- "versions/GO_VERSION"
- "versions/FAISS_VERSION"
- "versions/GO_VERSION"
jobs:
build:
uses: ./.github/workflows/_docker-image.yaml
with:
target: agent-faiss
platforms: linux/amd64
secrets: inherit
16 changes: 10 additions & 6 deletions .github/workflows/dockers-agent-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,29 +30,33 @@ on:
- ".github/actions/docker-build/action.yaml"
- ".github/workflows/_docker-image.yaml"
- ".github/workflows/dockers-agent-image.yml"
- "Makefile"
- "dockers/agent/core/agent/Dockerfile"
- "rust/Cargo.lock"
- "rust/Cargo.toml"
- "rust/bin/agent/**"
- "rust/libs/ngt/**"
- "rust/libs/ngt-rs/**"
- "rust/libs/ngt/**"
- "rust/libs/proto/**"
- "dockers/agent/core/agent/Dockerfile"
- "versions/RUST_VERSION"
- "versions/FAISS_VERSION"
- "versions/NGT_VERSION"
- "versions/RUST_VERSION"
pull_request_target:
paths:
- ".github/actions/docker-build/action.yaml"
- ".github/workflows/_docker-image.yaml"
- ".github/workflows/dockers-agent-image.yml"
- "Makefile"
- "dockers/agent/core/agent/Dockerfile"
- "rust/Cargo.lock"
- "rust/Cargo.toml"
- "rust/bin/agent/**"
- "rust/libs/ngt/**"
- "rust/libs/ngt-rs/**"
- "rust/libs/ngt/**"
- "rust/libs/proto/**"
- "dockers/agent/core/agent/Dockerfile"
- "versions/RUST_VERSION"
- "versions/FAISS_VERSION"
- "versions/NGT_VERSION"
- "versions/RUST_VERSION"
jobs:
build:
uses: ./.github/workflows/_docker-image.yaml
Expand Down
30 changes: 16 additions & 14 deletions .github/workflows/dockers-agent-ngt-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,38 +27,40 @@ on:
- "v*.*.*-*"
pull_request:
paths:
- "!internal/**/*_test.go"
- "!internal/db/**"
- "!internal/k8s/**"
- ".github/actions/docker-build/action.yaml"
- ".github/workflows/_docker-image.yaml"
- ".github/workflows/dockers-agent-ngt-image.yml"
- "Makefile"
- "apis/grpc/**"
- "cmd/agent/core/ngt/**"
- "dockers/agent/core/ngt/Dockerfile"
- "go.mod"
- "go.sum"
- "internal/**"
- "!internal/**/*_test.go"
- "!internal/db/**"
- "internal/k8s/**"
- "apis/grpc/**"
- "pkg/agent/core/ngt/**"
- "cmd/agent/core/ngt/**"
- "dockers/agent/core/ngt/Dockerfile"
- "versions/GO_VERSION"
- "versions/NGT_VERSION"
- "versions/GO_VERSION"
pull_request_target:
paths:
- "!internal/**/*_test.go"
- "!internal/db/**"
- "!internal/k8s/**"
- ".github/actions/docker-build/action.yaml"
- ".github/workflows/_docker-image.yaml"
- ".github/workflows/dockers-agent-ngt-image.yml"
- "Makefile"
- "apis/grpc/**"
- "cmd/agent/core/ngt/**"
- "dockers/agent/core/ngt/Dockerfile"
- "go.mod"
- "go.sum"
- "internal/**"
- "!internal/**/*_test.go"
- "!internal/db/**"
- "internal/k8s/**"
- "apis/grpc/**"
- "pkg/agent/core/ngt/**"
- "cmd/agent/core/ngt/**"
- "dockers/agent/core/ngt/Dockerfile"
- "versions/GO_VERSION"
- "versions/NGT_VERSION"
- "versions/GO_VERSION"
jobs:
build:
uses: ./.github/workflows/_docker-image.yaml
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ PBDOCS = apis/docs/v1/docs.md
LDFLAGS = -static -fPIC -pthread -std=gnu++23 -lstdc++ -lm -z relro -z now -flto=auto -march=native -mtune=native -fno-plt -Ofast -fvisibility=hidden -ffp-contract=fast -fomit-frame-pointer -fmerge-all-constants -funroll-loops -falign-functions=32 -ffunction-sections -fdata-sections

NGT_LDFLAGS = -fopenmp -lopenblas -llapack
FAISS_LDFLAGS = $(NGT_LDFLAGS) -lgfortran -lquadmath
FAISS_LDFLAGS = $(NGT_LDFLAGS) -lgfortran
HDF5_LDFLAGS = -lhdf5 -lhdf5_hl -lsz -laec -lz -ldl
CGO_LDFLAGS = $(FAISS_LDFLAGS) $(HDF5_LDFLAGS)

Expand Down
3 changes: 1 addition & 2 deletions dockers/agent/core/agent/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ ENV REPO=vald
ENV RUST_HOME=/usr/loacl/lib/rust
ENV TZ=Etc/UTC
ENV USER=root
ENV RUSTUP_HOME=${RUST_HOME}/rustup
ENV CARGO_HOME=${RUST_HOME}/cargo
ENV RUSTUP_HOME=${RUST_HOME}/rustup
ENV PATH=${CARGO_HOME}/bin:${RUSTUP_HOME}/bin:/usr/local/bin:${PATH}

WORKDIR ${HOME}/rust/src/github.com/${ORG}/${REPO}
Expand Down Expand Up @@ -75,7 +75,6 @@ RUN --mount=type=bind,target=.,rw \
libomp-dev \
libopenblas-dev \
gfortran \
libquadmath0 \
&& ldconfig \
&& echo "${LANG} UTF-8" > /etc/locale.gen \
&& ln -fs /usr/share/zoneinfo/${TZ} /etc/localtime \
Expand Down
1 change: 0 additions & 1 deletion dockers/agent/core/faiss/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ RUN --mount=type=bind,target=.,rw \
libomp-dev \
libopenblas-dev \
gfortran \
libquadmath0 \
&& ldconfig \
&& echo "${LANG} UTF-8" > /etc/locale.gen \
&& ln -fs /usr/share/zoneinfo/${TZ} /etc/localtime \
Expand Down
3 changes: 1 addition & 2 deletions dockers/ci/base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ ENV REPO=vald
ENV RUST_HOME=/usr/loacl/lib/rust
ENV TZ=Etc/UTC
ENV USER=root
ENV CARGO_HOME=${RUST_HOME}/cargo
ENV RUSTUP_HOME=${RUST_HOME}/rustup
ENV CARGO_HOME=${RUST_HOME}/cargo
ENV PATH=${CARGO_HOME}/bin:${GOPATH}/bin:${GOROOT}/bin:${RUSTUP_HOME}/bin:/usr/local/bin:${PATH}

WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}
Expand Down Expand Up @@ -83,7 +83,6 @@ RUN --mount=type=bind,target=.,rw \
libomp-dev \
libopenblas-dev \
gfortran \
libquadmath0 \
gawk \
gnupg2 \
graphviz \
Expand Down
1 change: 0 additions & 1 deletion dockers/dev/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ RUN --mount=type=bind,target=.,rw \
libomp-dev \
libopenblas-dev \
gfortran \
libquadmath0 \
gawk \
gnupg2 \
graphviz \
Expand Down
10 changes: 5 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ replace (
gonum.org/v1/gonum => gonum.org/v1/gonum v0.15.0
gonum.org/v1/hdf5 => gonum.org/v1/hdf5 v0.0.0-20210714002203-8c5d23bc6946
gonum.org/v1/plot => gonum.org/v1/plot v0.14.0
google.golang.org/api => google.golang.org/api v0.189.0
google.golang.org/api => google.golang.org/api v0.190.0
google.golang.org/appengine => google.golang.org/appengine v1.6.8
google.golang.org/genproto => google.golang.org/genproto v0.0.0-20240730163845-b1a4ccb954bf
google.golang.org/genproto/googleapis/api => google.golang.org/genproto/googleapis/api v0.0.0-20240730163845-b1a4ccb954bf
Expand Down Expand Up @@ -406,7 +406,7 @@ require (
gonum.org/v1/hdf5 v0.0.0-00010101000000-000000000000
gonum.org/v1/plot v0.14.0
google.golang.org/genproto/googleapis/api v0.0.0-20240725223205-93522f1f2a9f
google.golang.org/genproto/googleapis/rpc v0.0.0-20240725223205-93522f1f2a9f
google.golang.org/genproto/googleapis/rpc v0.0.0-20240730163845-b1a4ccb954bf
google.golang.org/grpc v1.65.0
google.golang.org/protobuf v1.34.2
gopkg.in/yaml.v2 v2.4.0
Expand All @@ -422,7 +422,7 @@ require (

require (
cloud.google.com/go v0.115.0 // indirect
cloud.google.com/go/auth v0.7.2 // indirect
cloud.google.com/go/auth v0.7.3 // indirect
cloud.google.com/go/auth/oauth2adapt v0.2.3 // indirect
cloud.google.com/go/compute/metadata v0.5.0 // indirect
cloud.google.com/go/iam v1.1.12 // indirect
Expand Down Expand Up @@ -462,7 +462,7 @@ require (
github.com/google/gnostic-models v0.6.8 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8 // indirect
github.com/google/s2a-go v0.1.7 // indirect
github.com/google/s2a-go v0.1.8 // indirect
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
github.com/google/wire v0.6.0 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect
Expand Down Expand Up @@ -514,7 +514,7 @@ require (
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
google.golang.org/api v0.189.0 // indirect
google.golang.org/genproto v0.0.0-20240725223205-93522f1f2a9f // indirect
google.golang.org/genproto v0.0.0-20240730163845-b1a4ccb954bf // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/apiextensions-apiserver v0.30.1 // indirect
Expand Down
14 changes: 9 additions & 5 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ cloud.google.com/go/auth v0.5.1/go.mod h1:vbZT8GjzDf3AVqCcQmqeeM32U9HBFc32vVVAbw
cloud.google.com/go/auth v0.6.0/go.mod h1:b4acV+jLQDyjwm4OXHYjNvRi4jvGBzHWJRtJcy+2P4g=
cloud.google.com/go/auth v0.6.1/go.mod h1:eFHG7zDzbXHKmjJddFG/rBlcGp6t25SwRUiEQSlO4x4=
cloud.google.com/go/auth v0.7.0/go.mod h1:D+WqdrpcjmiCgWrXmLLxOVq1GACoE36chW6KXoEvuIw=
cloud.google.com/go/auth v0.7.2 h1:uiha352VrCDMXg+yoBtaD0tUF4Kv9vrtrWPYXwutnDE=
cloud.google.com/go/auth v0.7.2/go.mod h1:VEc4p5NNxycWQTMQEDQF0bd6aTMb6VgYDXEwiJJQAbs=
cloud.google.com/go/auth v0.7.3 h1:98Vr+5jMaCZ5NZk6e/uBgf60phTk/XN84r8QEWB9yjY=
cloud.google.com/go/auth v0.7.3/go.mod h1:HJtWUx1P5eqjy/f6Iq5KeytNpbAcGolPhOgyop2LlzA=
cloud.google.com/go/auth/oauth2adapt v0.2.2/go.mod h1:wcYjgpZI9+Yu7LyYBg4pqSiaRkfEK3GQcpb7C/uyF1Q=
cloud.google.com/go/auth/oauth2adapt v0.2.3 h1:MlxF+Pd3OmSudg/b1yZ5lJwoXCEaeedAguodky1PcKI=
cloud.google.com/go/auth/oauth2adapt v0.2.3/go.mod h1:tMQXOfZzFuNuUxOypHlQEXgdfX5cuhwU+ffUuXRJE8I=
Expand Down Expand Up @@ -96,6 +97,7 @@ cloud.google.com/go/longrunning v0.1.1/go.mod h1:UUFxuDWkv22EuY93jjmDMFT5GPQKeFV
cloud.google.com/go/longrunning v0.4.1/go.mod h1:4iWDqhBZ70CvZ6BfETbvam3T8FMvLK+eFj0E6AaRQTo=
cloud.google.com/go/longrunning v0.5.1/go.mod h1:spvimkwdz6SPWKEt/XBij79E9fiTkHSQl/fRUUQJYJc=
cloud.google.com/go/longrunning v0.5.2/go.mod h1:nqo6DQbNV2pXhGDbDMoN2bWz68MjZUzqv2YttZiveCs=
cloud.google.com/go/longrunning v0.5.6/go.mod h1:vUaDrWYOMKRuhiv6JBnn49YxCPz2Ayn9GqyjaBT8/mA=
cloud.google.com/go/longrunning v0.5.7/go.mod h1:8GClkudohy1Fxm3owmBGid8W0pSgodEMwEAztp38Xng=
cloud.google.com/go/longrunning v0.5.9/go.mod h1:HD+0l9/OOW0za6UWdKJtXoFAX/BGg/3Wj8p10NeWF7c=
cloud.google.com/go/longrunning v0.5.10/go.mod h1:tljz5guTr5oc/qhlUjBlk7UAIFMOGuPNxkNDZXlLics=
Expand Down Expand Up @@ -146,6 +148,7 @@ cloud.google.com/go/talent v1.6.12/go.mod h1:nT9kNVuJhZX2QgqKZS6t6eCWZs5XEBYRBv6
cloud.google.com/go/texttospeech v1.7.11/go.mod h1:Ua125HU+WT2IkIo5MzQtuNpNEk72soShJQVdorZ1SAE=
cloud.google.com/go/tpu v1.6.11/go.mod h1:W0C4xaSj1Ay3VX/H96FRvLt2HDs0CgdRPVI4e7PoCDk=
cloud.google.com/go/trace v1.10.11/go.mod h1:fUr5L3wSXerNfT0f1bBg08W4axS2VbHGgYcfH4KuTXU=
cloud.google.com/go/translate v1.10.3/go.mod h1:GW0vC1qvPtd3pgtypCv4k4U8B7EdgK9/QEF2aJEUovs=
cloud.google.com/go/translate v1.10.7/go.mod h1:mH/+8tvcItuy1cOWqU+/Y3iFHgkVUObNIQYI/kiFFiY=
cloud.google.com/go/video v1.22.0/go.mod h1:CxPshUNAb1ucnzbtruEHlAal9XY+SPG2cFqC/woJzII=
cloud.google.com/go/videointelligence v1.11.11/go.mod h1:dab2Ca3AXT6vNJmt3/6ieuquYRckpsActDekLcsd6dU=
Expand Down Expand Up @@ -411,8 +414,9 @@ github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8 h1:FKHo8hFI3A+7w0aUQu
github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8/go.mod h1:K1liHPHnj73Fdn/EKuT8nrFqBihUSKXoLYU0BuatOYo=
github.com/google/s2a-go v0.1.3/go.mod h1:Ej+mSEMGRnqRzjc7VtF+jdBwYG5fuJfiZ8ELkjEwM0A=
github.com/google/s2a-go v0.1.4/go.mod h1:Ej+mSEMGRnqRzjc7VtF+jdBwYG5fuJfiZ8ELkjEwM0A=
github.com/google/s2a-go v0.1.7 h1:60BLSyTrOV4/haCDW4zb1guZItoSq8foHCXrAnjBo/o=
github.com/google/s2a-go v0.1.7/go.mod h1:50CgR4k1jNlWBu4UfS4AcfhVe1r6pdZPygJ3R8F0Qdw=
github.com/google/s2a-go v0.1.8 h1:zZDs9gcbt9ZPLV0ndSyQk6Kacx2g/X+SKYovpnz3SMM=
github.com/google/s2a-go v0.1.8/go.mod h1:6iNWHTpQ+nfNRN5E00MSdfDwVesa8hhS32PhPO8deJA=
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4=
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ=
github.com/google/subcommands v1.2.0/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk=
Expand Down Expand Up @@ -721,14 +725,14 @@ gonum.org/v1/hdf5 v0.0.0-20210714002203-8c5d23bc6946 h1:vJpL69PeUullhJyKtTjHjENE
gonum.org/v1/hdf5 v0.0.0-20210714002203-8c5d23bc6946/go.mod h1:BQUWDHIAygjdt1HnUPQ0eWqLN2n5FwJycrpYUVUOx2I=
gonum.org/v1/plot v0.14.0 h1:+LBDVFYwFe4LHhdP8coW6296MBEY4nQ+Y4vuUpJopcE=
gonum.org/v1/plot v0.14.0/go.mod h1:MLdR9424SJed+5VqC6MsouEpig9pZX2VZ57H9ko2bXU=
google.golang.org/api v0.189.0 h1:equMo30LypAkdkLMBqfeIqtyAnlyig1JSZArl4XPwdI=
google.golang.org/api v0.189.0/go.mod h1:FLWGJKb0hb+pU2j+rJqwbnsF+ym+fQs73rbJ+KAUgy8=
google.golang.org/api v0.190.0 h1:ASM+IhLY1zljNdLu19W1jTmU6A+gMk6M46Wlur61s+Q=
google.golang.org/api v0.190.0/go.mod h1:QIr6I9iedBLnfqoD6L6Vze1UvS5Hzj5r2aUBOaZnLHo=
google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds=
google.golang.org/genproto v0.0.0-20240730163845-b1a4ccb954bf h1:OqdXDEakZCVtDiZTjcxfwbHPCT11ycCEsTKesBVKvyY=
google.golang.org/genproto v0.0.0-20240730163845-b1a4ccb954bf/go.mod h1:mCr1K1c8kX+1iSBREvU3Juo11CB+QOEWxbRS01wWl5M=
google.golang.org/genproto/googleapis/api v0.0.0-20240730163845-b1a4ccb954bf h1:GillM0Ef0pkZPIB+5iO6SDK+4T9pf6TpaYR6ICD5rVE=
google.golang.org/genproto/googleapis/api v0.0.0-20240730163845-b1a4ccb954bf/go.mod h1:OFMYQFHJ4TM3JRlWDZhJbZfra2uqc3WLBZiaaqP4DtU=
google.golang.org/genproto/googleapis/bytestream v0.0.0-20240722135656-d784300faade/go.mod h1:5/MT647Cn/GGhwTpXC7QqcaR5Cnee4v4MKCU1/nwnIQ=
google.golang.org/genproto/googleapis/bytestream v0.0.0-20240730163845-b1a4ccb954bf/go.mod h1:5/MT647Cn/GGhwTpXC7QqcaR5Cnee4v4MKCU1/nwnIQ=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240730163845-b1a4ccb954bf h1:liao9UHurZLtiEwBgT9LMOnKYsHze6eA6w1KQCMVN2Q=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240730163845-b1a4ccb954bf/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY=
google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc=
Expand Down
1 change: 0 additions & 1 deletion hack/docker/gen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,6 @@ var (
}
faissBuildDeps = []string{
"gfortran",
"libquadmath0",
}
devContainerDeps = []string{
"gawk",
Expand Down
4 changes: 2 additions & 2 deletions rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion versions/PROMETHEUS_STACK_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
61.6.0
61.6.1

0 comments on commit 70d9daa

Please sign in to comment.