Skip to content

Commit

Permalink
builds pass locally
Browse files Browse the repository at this point in the history
Signed-off-by: greg pereira <[email protected]>
  • Loading branch information
Gregory-Pereira committed Jun 12, 2024
1 parent cf1ad89 commit a71b8ac
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 112 deletions.
10 changes: 4 additions & 6 deletions .env
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
# to define environment variables available to docker-compose.yml

# subman creds for RHEL builds
SUBMAN_USER=
SUBMAN_PASS=

IMAGE_REPO=quay.io/redhat-et
IMAGE_ARCH=amd64
# If this is uncommented it will pull and not rebuild
# IMAGE_REPO=quay.io/grpereir
IMAGE_REPO=quay.io/ai-lab
IMAGE_ARCH=arm64
OS_NAME=rhel9

# for services.builder.image in docker-compose.yml
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-builder.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu20.04, amazonlinux2023, rockylinux8]
os: [ubuntu20.04, amazonlinux2023, rockylinux8, rhel9]
env:
OS_NAME: ${{ matrix.os }}
IMAGE_ARCH: ${{ matrix.arch }}
Expand Down
91 changes: 0 additions & 91 deletions .github/workflows/rhel9-milvus.yaml

This file was deleted.

4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ docker-compose-devcontainer.yml.tmp
# Docker generated cache file
.docker/

# Private `subscription-manager` credentials for rhel builds
.env.rhel

**/_artifacts/**

# proxy
Expand All @@ -46,6 +49,7 @@ proxy-go/proxy-go
# Compiled source
bin/
lib/
configs/
*.a
*.so
*.so.*
Expand Down
17 changes: 8 additions & 9 deletions build/docker/builder/cpu/rhel9/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,20 @@ RUN dnf install -y make cmake automake gcc gcc-c++ \

RUN alias python3='python3.11'

# taken from .env file
RUN subscription-manager register --username $SUBMAN_USER --password $SUBMAN_PASS
# Assumes you have a valid subman subscription

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
RUN /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 source /root/install-go.sh

RUN mkdir -p /.cache/go-build && chmod -R 777 /.cache/go-build

RUN curl https://sh.rustup.rs -sSf | \
sh -s -- --default-toolchain=1.73 -y
Expand All @@ -57,14 +58,12 @@ 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 /opt/vcpkg
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 /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"]
6 changes: 5 additions & 1 deletion build/docker/builder/cpu/rhel9/install-go.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ else
fi

export PATH="$GOPATH/bin:$GOROOT/bin:$PATH"
export GOPROXY="https://proxy.golang.org,direct"
export GOSUMDB="sum.golang.org"
export GOMODCACHE="$GOPATH/pkg/mod"
export GOCACHE="$GOPATH/.cache"

mkdir -p "$GOPATH/src" "$GOPATH/bin"
mkdir -p "$GOPATH/src" "$GOPATH/bin" "$GOPATH/pkg" "$GOCACHE"
go clean --modcache
chmod -R 777 "$GOPATH" && chmod -R a+w $(go env GOTOOLDIR)
7 changes: 5 additions & 2 deletions build/docker/milvus/rhel9/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ ARG TARGETARCH
# assumes repo of codeready-builder-for-rhel-9-<arch>
RUN dnf install -y wget libgomp libaio libatomic

USER 0

COPY build/docker/milvus/rhel9/install-openblas.sh /home/install-openblas.sh
RUN chmod +x /home/install-openblas.sh
RUN TARGETARCH=$TARGETARCH /home/install-openblas.sh
Expand All @@ -38,6 +40,7 @@ ENV MALLOC_CONF=background_thread:true
# Add Tini
ADD https://github.com/krallin/tini/releases/download/v0.19.0/tini-$TARGETARCH /tini
RUN chmod +x /tini
ENTRYPOINT ["/tini", "--"]

WORKDIR /milvus
USER 1001
ENTRYPOINT ["/tini", "--"]
WORKDIR /milvus
2 changes: 0 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ services:
MINIO_ADDRESS: ${MINIO_ADDRESS}
CONAN_USER_HOME: /home/milvus
AZURE_STORAGE_CONNECTION_STRING: ${AZURITE_CONNECTION_STRING}
SUBMAN_USER: ${SUBMAN_USER}
SUBMAN_PASS: ${SUBMAN_PASS}
volumes: &builder-volumes
- .:/go/src/github.com/milvus-io/milvus:delegated
- ${DOCKER_VOLUME_DIRECTORY:-.docker}/${IMAGE_ARCH}-${OS_NAME}-ccache:/ccache:delegated
Expand Down

0 comments on commit a71b8ac

Please sign in to comment.