Skip to content

Commit

Permalink
[bugfix] gcc environment for ARM
Browse files Browse the repository at this point in the history
Signed-off-by: kpango <[email protected]>
  • Loading branch information
kpango committed Feb 8, 2024
1 parent 4c93f1b commit 7c7ea29
Show file tree
Hide file tree
Showing 7 changed files with 133 additions and 0 deletions.
84 changes: 84 additions & 0 deletions .github/workflows/dockers-agent-faiss-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
#
# 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-faiss"
on:
push:
branches:
- "main"
- "release/v*.*"
- "!release/v*.*.*"
tags:
- "*.*.*"
- "v*.*.*"
- "*.*.*-*"
- "v*.*.*-*"
paths:
- ".github/actions/docker-build/actions.yaml"
- ".github/workflows/_docker-image.yaml"
- ".github/workflows/dockers-agent-faiss-image.yml"
- "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"
pull_request:
paths:
- ".github/actions/docker-build/actions.yaml"
- ".github/workflows/_docker-image.yaml"
- ".github/workflows/dockers-agent-faiss-image.yml"
- "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"
pull_request_target:
paths:
- ".github/actions/docker-build/actions.yaml"
- ".github/workflows/_docker-image.yaml"
- ".github/workflows/dockers-agent-faiss-image.yml"
- "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"
jobs:
build:
uses: ./.github/workflows/_docker-image.yaml
with:
target: agent-faiss
platforms: linux/amd64
secrets: inherit
1 change: 1 addition & 0 deletions .github/workflows/dockers-agent-ngt-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,5 @@ jobs:
uses: ./.github/workflows/_docker-image.yaml
with:
target: agent-ngt
platforms: linux/amd64,linux/arm64
secrets: inherit
1 change: 1 addition & 0 deletions .github/workflows/dockers-helm-operator-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,5 @@ jobs:
uses: ./.github/workflows/_docker-image.yaml
with:
target: operator/helm
platforms: linux/amd64,linux/arm64
secrets: inherit
12 changes: 12 additions & 0 deletions dockers/agent/core/faiss/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ ENV REPO vald
ENV PKG agent/core/faiss
ENV PKG_INTERNAL agent/internal
ENV APP_NAME faiss
ENV AARCH aarch_64
ENV XARCH x86_64

# skipcq: DOK-DL3008
RUN apt-get update && apt-get install -y --no-install-recommends \
Expand All @@ -50,6 +52,16 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
intel-mkl \
unzip \
upx \
&& if [ "${TARGETARCH}" = "amd64" ] ; then \
apt install -y --no-install-recommends --fix-missing gcc-${XARCH}-${TARGETOS}-gnu; \
export CC=${XARCH}-${TARGETOS}-gnu-gcc; \
export CC_FOR_TARGET=${CC}; \
elif [ "${TARGETARCH}" = "arm64" ] ; then \
apt install -y --no-install-recommends --fix-missing gcc-${AARCH}-${TARGETOS}-gnu; \
export CC=${AARCH}-${TARGETOS}-gnu-gcc; \
export CC_FOR_TARGET=${CC}; \
fi; \
&& ldconfig \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

Expand Down
12 changes: 12 additions & 0 deletions dockers/agent/core/ngt/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ ENV REPO vald
ENV PKG agent/core/ngt
ENV PKG_INTERNAL agent/internal
ENV APP_NAME ngt
ENV AARCH aarch_64
ENV XARCH x86_64

# skipcq: DOK-DL3008
RUN apt-get update && apt-get install -y --no-install-recommends \
Expand All @@ -52,6 +54,16 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
libopenblas-dev \
unzip \
upx \
&& if [ "${TARGETARCH}" = "amd64" ] ; then \
apt install -y --no-install-recommends --fix-missing gcc-${XARCH}-${TARGETOS}-gnu; \
export CC=${XARCH}-${TARGETOS}-gnu-gcc; \
export CC_FOR_TARGET=${CC}; \
elif [ "${TARGETARCH}" = "arm64" ] ; then \
apt install -y --no-install-recommends --fix-missing gcc-${AARCH}-${TARGETOS}-gnu; \
export CC=${AARCH}-${TARGETOS}-gnu-gcc; \
export CC_FOR_TARGET=${CC}; \
fi; \
&& ldconfig \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

Expand Down
12 changes: 12 additions & 0 deletions dockers/operator/helm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ ENV PATH ${PATH}:${GOROOT}/bin:${GOPATH}/bin
ENV ORG vdaas
ENV REPO vald
ENV APP_NAME helm-operator
ENV AARCH aarch_64
ENV XARCH x86_64

# skipcq: DOK-DL3008
RUN apt-get clean \
Expand All @@ -62,6 +64,16 @@ RUN apt-get clean \
curl \
upx \
git \
&& if [ "${TARGETARCH}" = "amd64" ] ; then \
apt install -y --no-install-recommends --fix-missing gcc-${XARCH}-${TARGETOS}-gnu; \
export CC=${XARCH}-${TARGETOS}-gnu-gcc; \
export CC_FOR_TARGET=${CC}; \
elif [ "${TARGETARCH}" = "arm64" ] ; then \
apt install -y --no-install-recommends --fix-missing gcc-${AARCH}-${TARGETOS}-gnu; \
export CC=${AARCH}-${TARGETOS}-gnu-gcc; \
export CC_FOR_TARGET=${CC}; \
fi; \
&& ldconfig \
&& apt-get clean \
&& rm -rf \
/var/lib/apt/lists/* \
Expand Down
11 changes: 11 additions & 0 deletions dockers/tools/benchmark/job/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ ENV PKG tools/benchmark/${APP_NAME}
ENV BUILD_DIR=/usr/local
ENV LIB_DIR=/usr/local/lib
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${LIB_DIR}:/lib
ENV AARCH aarch_64
ENV XARCH x86_64

# skipcq: DOK-DL3008, DOK-DL3003
RUN apt-get update && apt-get install -y --no-install-recommends \
Expand All @@ -54,6 +56,15 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
upx \
g++ \
git \
&& if [ "${TARGETARCH}" = "amd64" ] ; then \
apt install -y --no-install-recommends --fix-missing gcc-${XARCH}-${TARGETOS}-gnu; \
export CC=${XARCH}-${TARGETOS}-gnu-gcc; \
export CC_FOR_TARGET=${CC}; \
elif [ "${TARGETARCH}" = "arm64" ] ; then \
apt install -y --no-install-recommends --fix-missing gcc-${AARCH}-${TARGETOS}-gnu; \
export CC=${AARCH}-${TARGETOS}-gnu-gcc; \
export CC_FOR_TARGET=${CC}; \
fi; \
&& ldconfig \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
Expand Down

0 comments on commit 7c7ea29

Please sign in to comment.