forked from milvus-io/milvus
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: greg pereira <grpereir@redhat.com>
- Loading branch information
1 parent
7550808
commit bff6c7e
Showing
10 changed files
with
274 additions
and
88 deletions.
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
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,91 @@ | ||
name: Publish Builder | ||
# TODO: do not trigger action for some document file update | ||
|
||
# This workflow is triggered on pushes or pull request to the repository. | ||
on: | ||
push: | ||
# file paths to consider in the event. Optional; defaults to all. | ||
paths: | ||
- 'build/docker/builder/cpu/**' | ||
- '.github/workflows/publish-builder.yaml' | ||
- '!**.md' | ||
pull_request: | ||
# file paths to consider in the event. Optional; defaults to all. | ||
paths: | ||
- 'build/docker/builder/cpu/**' | ||
- '.github/workflows/publish-builder.yaml' | ||
- '!**.md' | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: ${{ github.event_name == 'pull_request' }} | ||
|
||
jobs: | ||
publish-builder: | ||
name: ${{ matrix.arch }} ${{ matrix.os }} | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 500 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [rockylinux8] | ||
arch: [arm64] | ||
env: | ||
OS_NAME: ${{ matrix.os }} | ||
IMAGE_ARCH: ${{ matrix.arch }} | ||
steps: | ||
- name: Maximize build space | ||
uses: easimon/maximize-build-space@master | ||
if: ${{ ! startsWith(runner.name, 'self') }} # skip this step if it is self-hosted runner | ||
with: | ||
root-reserve-mb: 20480 | ||
# overprovision-lvm: 'true' | ||
swap-size-mb: 1024 | ||
remove-dotnet: 'true' | ||
remove-android: 'true' | ||
remove-haskell: 'true' | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Get version from system time after release step | ||
id: extracter | ||
run: | | ||
echo "::set-output name=version::$(date +%Y%m%d)" | ||
echo "::set-output name=sha_short::$(git rev-parse --short=7 HEAD)" | ||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: | | ||
milvusdb/milvus-env | ||
tags: | | ||
type=raw,enable=true,value=${{ matrix.os }}-{{date 'YYYYMMDD'}}-{{sha}} | ||
type=raw,enable=true,value=${{ matrix.os }}-latest | ||
# - name: Setup upterm session | ||
# uses: lhotari/action-upterm@v1 | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
with: | ||
platforms: arm64 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Login to Docker Hub | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USER }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- name: Build and push | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
platforms: linux/amd64,linux/arm64 | ||
push: ${{ github.event_name != 'pull_request' }} | ||
tags: ${{ steps.meta.outputs.tags }} | ||
file: build/docker/builder/cpu/${{ matrix.os }}/Dockerfile | ||
- name: Bump Builder Version | ||
uses: ./.github/actions/bump-builder-version | ||
if: success() && github.event_name == 'push' && github.repository == 'milvus-io/milvus' && matrix.os == 'ubuntu20.04' | ||
with: | ||
tag: "${{ steps.extracter.outputs.version }}-${{ steps.extracter.outputs.sha_short }}" | ||
type: cpu | ||
token: ${{ secrets.ALL_CONTRIBUTORS_TOKEN }} |
This file was deleted.
Oops, something went wrong.
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,68 @@ | ||
FROM registry.access.redhat.com/ubi9/ubi:9.4-947.1717074712 as vcpkg-installer | ||
USER 0 | ||
RUN dnf install -y wget zip git gcc gcc-c++ cmake dnf-plugins-core ninja-build | ||
RUN dnf install -y perl-IPC-Cmd perl-Digest-SHA perl-FindBin perl-File-Compare perl-File-Copy | ||
|
||
ENV VCPKG_FORCE_SYSTEM_BINARIES 1 | ||
|
||
RUN mkdir /opt/vcpkg && \ | ||
wget -qO- vcpkg.tar.gz https://github.com/microsoft/vcpkg/archive/master.tar.gz | tar --strip-components=1 -xz -C /opt/vcpkg && \ | ||
rm -rf vcpkg.tar.gz | ||
|
||
# empty the vscpkg toolchains linux.cmake file to avoid the error | ||
RUN echo "" > /opt/vcpkg/scripts/toolchains/linux.cmake | ||
|
||
# install azure-identity-cpp azure-storage-blobs-cpp gtest via vcpkg | ||
RUN /opt/vcpkg/bootstrap-vcpkg.sh -disableMetrics && \ | ||
ln -s /opt/vcpkg/vcpkg /usr/local/bin/vcpkg && \ | ||
vcpkg version && \ | ||
vcpkg install azure-identity-cpp azure-storage-blobs-cpp gtest | ||
|
||
######################################################################################## | ||
FROM registry.access.redhat.com/ubi9/ubi:9.4-947.1717074712 | ||
|
||
ARG TARGETARCH | ||
ARG SUBMAN_USER | ||
ARG SUBMAN_PASS | ||
USER 0 | ||
|
||
# basic deps | ||
RUN dnf install -y libaio libuuid-devel \ | ||
perl-IPC-Cmd perl-Digest-SHA \ | ||
libtool ninja-build wget \ | ||
python3.11 python3.11-pip | ||
|
||
RUN alias python3='python3.11' | ||
|
||
# taken from .env file | ||
RUN subscription-manager register --username $SUBMAN_USER --password $SUBMAN_PASS | ||
|
||
COPY build/docker/builder/cpu/rhel9/install-rpms.sh /root/install-rpms.sh | ||
RUN chmod +x /root/install-rpms.sh | ||
RUN TARGETARCH=$TARGETARCH /root/install-rpms.sh | ||
|
||
# Install conan and Go | ||
RUN python3.11 -m pip install conan==1.61.0 | ||
|
||
COPY build/docker/builder/cpu/rhel9/install-go.sh /root/install-go.sh | ||
RUN chmod +x /root/install-go.sh | ||
RUN TARGETARCH=$TARGETARCH /root/install-go.sh | ||
|
||
RUN curl https://sh.rustup.rs -sSf | \ | ||
sh -s -- --default-toolchain=1.73 -y | ||
|
||
ENV PATH=/root/.cargo/bin:/usr/local/bin:/usr/local/go/bin:$PATH | ||
|
||
ENV VCPKG_FORCE_SYSTEM_BINARIES 1 | ||
|
||
# RUN mkdir /opt/vcpkg && \ | ||
# wget -qO- vcpkg.tar.gz https://github.com/microsoft/vcpkg/archive/master.tar.gz | tar --strip-components=1 -xz -C /opt/vcpkg && \ | ||
# rm -rf vcpkg.tar.gz | ||
COPY --from=vcpkg-installer/opt/vcpkg COPY --from=vcpkg-installer | ||
|
||
COPY --from=vcpkg-installer /root/.cache/vcpkg /root/.cache/vcpkg | ||
COPY --chown=0:0 build/docker/builder/entrypoint.sh / | ||
|
||
USER 1001 | ||
ENTRYPOINT [ "/entrypoint.sh" ] | ||
CMD ["tail", "-f", "/dev/null"] |
This file was deleted.
Oops, something went wrong.
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,41 @@ | ||
#/bin/bash | ||
if [[ -z "$GOROOT" ]]; then | ||
GOROOT=/usr/local/go | ||
fi | ||
|
||
mkdir -p $GOROOT | ||
|
||
RUN_MODE="" | ||
if [[ -z "$TARGETARCH" ]]; then | ||
TARGETARCH=$(uname -m) | ||
echo "\$TARGETARCH not set - defaulting to host system" | ||
fi | ||
|
||
if [[ "$TARGETARCH" == "arm64" ]] || [[ "$TARGETARCH" == "aarch64" ]]; then | ||
RUN_MODE="arm64" | ||
elif [[ "$TARGETARCH" == "amd64" ]] || [[ "$TARGETARCH" == "x86_64" ]]; then | ||
RUN_MODE="amd64" | ||
else | ||
echo "invalid \$TARGETARCH, build failure. | ||
Supported options: ['arm64', 'aarch64', 'amd64', 'x86_64']" | ||
exit 1 | ||
fi | ||
|
||
export GO111MODULE="on" | ||
|
||
if [[ -z "$GOPATH" ]]; then | ||
export GOPATH="/go" | ||
fi | ||
|
||
if [[ "$RUN_MODE" == "arm64" ]] || [[ "$RUN_MODE" == "amd64" ]] ; then | ||
wget -qO- "https://go.dev/dl/go1.21.10.linux-$RUN_MODE.tar.gz" | tar --strip-components=1 -xz -C $GOROOT | ||
else | ||
echo "uncaught \$RUN_MODE based on invalid \$TARGETARCH." | ||
exit 1 | ||
fi | ||
|
||
export PATH="$GOPATH/bin:$GOROOT/bin:$PATH" | ||
|
||
mkdir -p "$GOPATH/src" "$GOPATH/bin" | ||
go clean --modcache | ||
chmod -R 777 "$GOPATH" && chmod -R a+w $(go env GOTOOLDIR) |
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,35 @@ | ||
#/bin/bash | ||
RUN_MODE="" | ||
if [[ -z "$TARGETARCH" ]]; then | ||
TARGETARCH=$(uname -m) | ||
echo "\$TARGETARCH not set - defaulting to host system" | ||
fi | ||
|
||
if [[ "$TARGETARCH" == "arm64" ]] || [[ "$TARGETARCH" == "aarch64" ]]; then | ||
RUN_MODE="aarch64" | ||
elif [[ "$TARGETARCH" == "amd64" ]] || [[ "$TARGETARCH" == "x86_64" ]]; then | ||
RUN_MODE="x86_64" | ||
else | ||
echo "invalid \$TARGETARCH, build failure. | ||
Supported options: ['arm64', 'aarch64', 'amd64', 'x86_64']" | ||
exit 1 | ||
fi | ||
|
||
if [[ "$RUN_MODE" == "aarch64" ]]; then | ||
dnf install -y \ | ||
https://www.rpmfind.net/linux/centos-stream/9-stream/AppStream/aarch64/os/Packages/perl-Unicode-EastAsianWidth-12.0-7.el9.noarch.rpm \ | ||
https://www.rpmfind.net/linux/centos-stream/9-stream/AppStream/aarch64/os/Packages/perl-Text-Unidecode-1.30-16.el9.noarch.rpm \ | ||
https://www.rpmfind.net/linux/centos-stream/9-stream/AppStream/aarch64/os/Packages/perl-libintl-perl-1.32-4.el9.aarch64.rpm \ | ||
https://www.rpmfind.net/linux/centos-stream/9-stream/CRB/aarch64/os/Packages/texinfo-6.7-15.el9.aarch64.rpm | ||
dnf install -y --enablerepo=codeready-builder-for-rhel-9-aarch64-rpms openblas-devel | ||
elif [[ "$RUN_MODE" == "x86_64" ]]; then | ||
dnf install -y \ | ||
https://www.rpmfind.net/linux/centos-stream/9-stream/AppStream/x86_64/os/Packages/perl-Unicode-EastAsianWidth-12.0-7.el9.noarch.rpm \ | ||
https://www.rpmfind.net/linux/centos-stream/9-stream/AppStream/x86_64/os/Packages/perl-Text-Unidecode-1.30-16.el9.noarch.rpm \ | ||
https://www.rpmfind.net/linux/centos-stream/9-stream/AppStream/x86_64/os/Packages/perl-libintl-perl-1.32-4.el9.x86_64.rpm \ | ||
https://www.rpmfind.net/linux/centos-stream/9-stream/CRB/x86_64/os/Packages/texinfo-6.7-15.el9.x86_64.rpm | ||
dnf install -y --enablerepo=codeready-builder-for-rhel-9-x86_64-rpms openblas-devel | ||
else | ||
echo "uncaught runmode based on invalid \$TARGETARCH." | ||
exit 1 | ||
fi |
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,22 @@ | ||
RUN_MODE="" | ||
if [[ -z "$TARGETARCH" ]]; then | ||
TARGETARCH=$(uname -m) | ||
echo "\$TARGETARCH not set - defaulting to host system" | ||
fi | ||
|
||
if [[ "$TARGETARCH" == "arm64" ]] || [[ "$TARGETARCH" == "aarch64" ]]; then | ||
RUN_MODE="aarch64" | ||
elif [[ "$TARGETARCH" == "amd64" ]] || [[ "$TARGETARCH" == "x86_64" ]]; then | ||
RUN_MODE="x86_64" | ||
else | ||
echo "invalid \$TARGETARCH, build failure. | ||
Supported options: ['arm64', 'aarch64', 'amd64', 'x86_64']" | ||
exit 1 | ||
fi | ||
|
||
if [[ "$RUN_MODE" == "aarch64" ]] || [[ "$RUN_MODE" == "x86_64" ]]; then | ||
dnf install -y --enablerepo=codeready-builder-for-rhel-9-$RUN_MODE-rpms openblas-devel | ||
else | ||
echo "uncaught runmode based on invalid \$TARGETARCH." | ||
exit 1 | ||
fi |
Oops, something went wrong.