Skip to content

Commit 533f0dd

Browse files
authored
Add amazonlinux image, prepare to remove Centos7 image, remove openblas image (milvus-io#26368)
Signed-off-by: Enwei Jiao <[email protected]>
1 parent 74fb244 commit 533f0dd

File tree

19 files changed

+309
-439
lines changed

19 files changed

+309
-439
lines changed

.github/mergify.yml

+123-131
Large diffs are not rendered by default.

.github/workflows/code-checker.yaml

+20-28
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,11 @@ on:
2929

3030
jobs:
3131
ubuntu:
32-
name: ${{ matrix.name }}
33-
runs-on: ${{ matrix.os }}
32+
name: Code Checker AMD64 Ubuntu 20.04
33+
runs-on: ubuntu-latest
3434
timeout-minutes: 180
3535
strategy:
3636
fail-fast: false
37-
matrix:
38-
include:
39-
- name: Code Checker AMD64 Ubuntu 20.04
40-
os: ubuntu-20.04
41-
env:
42-
UBUNTU: 20.04
4337
steps:
4438
- name: Checkout
4539
uses: actions/checkout@v2
@@ -50,7 +44,6 @@ jobs:
5044
echo "corehash=${CORE_HASH}" >> $GITHUB_ENV
5145
echo "Set CCache hash to ${CORE_HASH}"
5246
- name: Cache CCache Volumes
53-
# uses: actions/cache@v3
5447
uses: pat-s/always-upload-cache@v3
5548
with:
5649
path: .docker/amd64-ubuntu20.04-ccache
@@ -63,21 +56,22 @@ jobs:
6356
key: ubuntu20.04-go-mod-${{ hashFiles('**/go.sum') }}
6457
restore-keys: ubuntu20.04-go-mod-
6558
- name: Cache Conan Packages
66-
# uses: actions/cache@v3
6759
uses: pat-s/always-upload-cache@v3
6860
with:
6961
path: .docker/amd64-ubuntu20.04-conan
7062
key: ubuntu20.04-conan-${{ hashFiles('internal/core/conanfile.*') }}
7163
restore-keys: ubuntu20.04-conan-
64+
# - name: Setup upterm session
65+
# uses: lhotari/action-upterm@v1
7266
- name: Code Check
7367
env:
7468
OS_NAME: 'ubuntu20.04'
7569
run: |
7670
./build/builder.sh /bin/bash -c "make check-proto-product && make verifiers"
77-
centos:
78-
name: Code Checker CentOS 7
79-
# Run in centos docker
80-
runs-on: ubuntu-20.04
71+
amazonlinux:
72+
name: Code Checker Amazonlinux 2023
73+
# Run in amazonlinux docker
74+
runs-on: ubuntu-latest
8175
timeout-minutes: 180
8276
steps:
8377
- name: Checkout
@@ -89,33 +83,31 @@ jobs:
8983
echo "corehash=${CORE_HASH}" >> $GITHUB_ENV
9084
echo "Set CCache hash to ${CORE_HASH}"
9185
- name: Cache CCache Volumes
92-
# uses: actions/cache@v3
9386
uses: pat-s/always-upload-cache@v3
9487
with:
95-
path: .docker/amd64-centos7-ccache
96-
key: centos7-ccache-${{ env.corehash }}
97-
restore-keys: centos7-ccache-
88+
path: .docker/amd64-amazonlinux2023-ccache
89+
key: amazonlinux2023-ccache-${{ env.corehash }}
90+
restore-keys: amazonlinux2023-ccache-
9891
- name: Cache Third Party
9992
uses: actions/cache@v3
10093
with:
10194
path: .docker/thirdparty
102-
key: centos7-thirdparty-${{ hashFiles('internal/core/thirdparty/**') }}
103-
restore-keys: centos7-thirdparty-
95+
key: amazonlinux2023-thirdparty-${{ hashFiles('internal/core/thirdparty/**') }}
96+
restore-keys: amazonlinux2023-thirdparty-
10497
- name: Cache Go Mod Volumes
10598
uses: actions/cache@v3
10699
with:
107-
path: .docker/amd64-centos7-go-mod
108-
key: centos7-go-mod-${{ hashFiles('**/go.sum') }}
109-
restore-keys: centos7-go-mod-
100+
path: .docker/amd64-amazonlinux2023-go-mod
101+
key: amazonlinux2023-go-mod-${{ hashFiles('**/go.sum') }}
102+
restore-keys: amazonlinux2023-go-mod-
110103
- name: Cache Conan Packages
111-
# uses: actions/cache@v3
112104
uses: pat-s/always-upload-cache@v3
113105
with:
114-
path: .docker/amd64-centos7-conan
115-
key: centos7-conan-${{ hashFiles('internal/core/conanfile.*') }}
116-
# restore-keys: centos7-conan-
106+
path: .docker/amd64-amazonlinux2023-conan
107+
key: amazonlinux2023-conan-${{ hashFiles('internal/core/conanfile.*') }}
108+
restore-keys: amazonlinux2023-conan-
117109
- name: Code Check
118110
env:
119-
OS_NAME: 'centos7'
111+
OS_NAME: 'amazonlinux2023'
120112
run: |
121113
./build/builder.sh /bin/bash -c "make install"

.github/workflows/publish-builder.yaml

+6-2
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,17 @@ on:
1818

1919
jobs:
2020
publish-builder:
21-
name: AMD64 ${{ matrix.os }}
21+
name: ${{ matrix.arch }} ${{ matrix.os }}
2222
runs-on: ubuntu-latest
2323
timeout-minutes: 60
2424
strategy:
2525
fail-fast: false
2626
matrix:
27-
os: [ubuntu20.04, centos7]
27+
os: [ubuntu20.04, amazonlinux2023]
28+
arch: [amd64]
2829
env:
2930
OS_NAME: ${{ matrix.os }}
31+
IMAGE_ARCH: ${{ matrix.arch }}
3032
steps:
3133
- name: Checkout
3234
uses: actions/checkout@v2
@@ -35,6 +37,8 @@ jobs:
3537
run: |
3638
echo "::set-output name=version::$(date +%Y%m%d)"
3739
echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
40+
# - name: Setup upterm session
41+
# uses: lhotari/action-upterm@v1
3842
- name: Docker Pull
3943
shell: bash
4044
run: |

.github/workflows/publish-milvus-base.yaml

-81
This file was deleted.

build/build_image.sh

+11-10
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,21 @@ OS_NAME="${OS_NAME:-ubuntu20.04}"
2828
MILVUS_IMAGE_REPO="${MILVUS_IMAGE_REPO:-milvusdb/milvus}"
2929
MILVUS_IMAGE_TAG="${MILVUS_IMAGE_TAG:-latest}"
3030

31-
MILVUS_BASE_IMAGE_REPO="${MILVUS_BASE_IMAGE_REPO:-milvusdb/milvus-base}"
32-
MILVUS_BASE_IMAGE_TAG="local"
31+
if [ -z "$IMAGE_ARCH" ]; then
32+
MACHINE=$(uname -m)
33+
if [ "$MACHINE" = "x86_64" ]; then
34+
IMAGE_ARCH="amd64"
35+
else
36+
IMAGE_ARCH="arm64"
37+
fi
38+
39+
fi
40+
3341
BUILD_ARGS=""
3442

3543
pushd "${toplevel}"
36-
BUILD_BASE_IMAGE=${BUILD_BASE_IMAGE:-"false"}
37-
38-
# Seperate base dockerfile to ignore install dependencies when build milvus image
39-
if [[ ${OS_NAME} == "ubuntu20.04" && ${BUILD_BASE_IMAGE} == "true" ]]; then
40-
docker build -f "./build/docker/milvus/${OS_NAME}/Dockerfile.base" -t "${MILVUS_BASE_IMAGE_REPO}:${MILVUS_BASE_IMAGE_TAG}" .
41-
BUILD_ARGS="--build-arg MILVUS_BASE_IMAGE_REPO=${MILVUS_BASE_IMAGE_REPO} --build-arg MILVUS_BASE_IMAGE_TAG=${MILVUS_BASE_IMAGE_TAG}"
42-
fi
4344

44-
docker build ${BUILD_ARGS} -f "./build/docker/milvus/${OS_NAME}/Dockerfile" -t "${MILVUS_IMAGE_REPO}:${MILVUS_IMAGE_TAG}" .
45+
docker build ${BUILD_ARGS} --platform linux/${IMAGE_ARCH} -f "./build/docker/milvus/${OS_NAME}/Dockerfile" -t "${MILVUS_IMAGE_REPO}:${MILVUS_IMAGE_TAG}" .
4546

4647
image_size=$(docker inspect ${MILVUS_IMAGE_REPO}:${MILVUS_IMAGE_TAG} -f '{{.Size}}'| awk '{ byte =$1 /1024/1024/1024; print byte " GB" }')
4748

build/builder.sh

+10-23
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ set -euo pipefail
55
# Absolute path to the toplevel milvus directory.
66
toplevel=$(dirname "$(cd "$(dirname "${0}")"; pwd)")
77

8+
if [[ -f "$toplevel/.env" ]]; then
9+
export $(cat $toplevel/.env | xargs)
10+
fi
11+
812
export OS_NAME="${OS_NAME:-ubuntu20.04}"
913

1014
pushd "${toplevel}"
@@ -19,34 +23,17 @@ if [[ "${1-}" == "down" ]]; then
1923
exit 0
2024
fi
2125

22-
# Attempt to run in the container with the same UID/GID as we have on the host,
23-
# as this results in the correct permissions on files created in the shared
24-
# volumes. This isn't always possible, however, as IDs less than 100 are
25-
# reserved by Debian, and IDs in the low 100s are dynamically assigned to
26-
# various system users and groups. To be safe, if we see a UID/GID less than
27-
# 500, promote it to 501. This is notably necessary on macOS Lion and later,
28-
# where administrator accounts are created with a GID of 20. This solution is
29-
# not foolproof, but it works well in practice.
30-
uid=$(id -u)
31-
gid=$(id -g)
32-
[ "$uid" -lt 500 ] && uid=501
33-
[ "$gid" -lt 500 ] && gid=$uid
34-
35-
mkdir -p "${DOCKER_VOLUME_DIRECTORY:-.docker}/amd64-${OS_NAME}-ccache"
36-
mkdir -p "${DOCKER_VOLUME_DIRECTORY:-.docker}/amd64-${OS_NAME}-go-mod"
37-
mkdir -p "${DOCKER_VOLUME_DIRECTORY:-.docker}/amd64-${OS_NAME}-vscode-extensions"
38-
mkdir -p "${DOCKER_VOLUME_DIRECTORY:-.docker}/amd64-${OS_NAME}-conan"
26+
mkdir -p "${DOCKER_VOLUME_DIRECTORY:-.docker}/${IMAGE_ARCH}-${OS_NAME}-ccache"
27+
mkdir -p "${DOCKER_VOLUME_DIRECTORY:-.docker}/${IMAGE_ARCH}-${OS_NAME}-go-mod"
28+
mkdir -p "${DOCKER_VOLUME_DIRECTORY:-.docker}/${IMAGE_ARCH}-${OS_NAME}-vscode-extensions"
29+
mkdir -p "${DOCKER_VOLUME_DIRECTORY:-.docker}/${IMAGE_ARCH}-${OS_NAME}-conan"
3930
chmod -R 777 "${DOCKER_VOLUME_DIRECTORY:-.docker}"
4031

4132
docker-compose pull --ignore-pull-failures builder
42-
if [[ "${CHECK_BUILDER:-}" == "1" ]]; then
33+
if [[ "${CHECK_BUILDER:-1}" == "1" ]]; then
4334
docker-compose build builder
4435
fi
4536

46-
if [[ "$(id -u)" != "0" ]]; then
47-
docker-compose run --no-deps --rm -u "$uid:$gid" builder "$@"
48-
else
49-
docker-compose run --no-deps --rm --entrypoint "/tini -- /entrypoint.sh" builder "$@"
50-
fi
37+
docker-compose run --no-deps --rm builder "$@"
5138

5239
popd
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Copyright (C) 2019-2022 Zilliz. All rights reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
4+
# with the License. You may obtain a copy of the License at
5+
#
6+
# http://www.apache.org/licenses/LICENSE-2.0
7+
#
8+
# Unless required by applicable law or agreed to in writing, software distributed under the License
9+
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
10+
# or implied. See the License for the specific language governing permissions and limitations under the License.
11+
12+
FROM amazonlinux:2023
13+
14+
ARG TARGETARCH
15+
16+
RUN yum install -y wget g++ gcc gdb libstdc++-static git make unzip tar which \
17+
autoconf automake golang python3 python3-pip perl-FindBin texinfo \
18+
pkg-config libuuid-devel libaio && \
19+
rm -rf /var/cache/yum/*
20+
21+
RUN pip3 install conan==1.58.0
22+
23+
RUN echo "target arch $TARGETARCH"
24+
RUN if [ "$TARGETARCH" = "amd64" ]; then CMAKE_SUFFIX=x86_64; else CMAKE_SUFFIX=aarch64; fi &&\
25+
wget -qO- "https://cmake.org/files/v3.24/cmake-3.24.4-linux-$CMAKE_SUFFIX.tar.gz" | tar --strip-components=1 -xz -C /usr/local
26+
27+
RUN mkdir /tmp/ccache && wget -qO- https://github.com/ccache/ccache/releases/download/v4.8.2/ccache-4.8.2.tar.gz | tar --strip-components=1 -xz -C /tmp/ccache &&\
28+
cd /tmp/ccache && mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr .. && make && make install &&\
29+
rm -rf /tmp/ccache
30+
31+
# https://github.com/golang/go/issues/22040 Due to this issue, ld.gold cannot be used in the ARM environment, so the official golang package cannot be used. You need to use the golang package that comes with yum.
32+
# Install Go
33+
# ENV GOPATH /go
34+
# ENV GOROOT /usr/local/go
35+
# ENV GO111MODULE on
36+
# ENV PATH $GOPATH/bin:$GOROOT/bin:$PATH
37+
# RUN mkdir -p /usr/local/go && wget -qO- "https://go.dev/dl/go1.20.7.linux-$TARGETARCH.tar.gz" | tar --strip-components=1 -xz -C /usr/local/go && \
38+
# mkdir -p "$GOPATH/src" "$GOPATH/bin" && \
39+
# go clean --modcache && \
40+
# chmod -R 777 "$GOPATH" && chmod -R a+w $(go env GOTOOLDIR)
41+
42+
# refer: https://code.visualstudio.com/docs/remote/containers-advanced#_avoiding-extension-reinstalls-on-container-rebuild
43+
RUN mkdir -p /home/milvus/.vscode-server/extensions \
44+
/home/milvus/.vscode-server-insiders/extensions \
45+
&& chmod -R 777 /home/milvus
46+
47+
COPY --chown=0:0 build/docker/builder/entrypoint.sh /
48+
49+
ENTRYPOINT [ "/entrypoint.sh" ]
50+
CMD ["tail", "-f", "/dev/null"]

0 commit comments

Comments
 (0)