From e2d8ecc6c30099796ac1d52074d727e30f376b9c Mon Sep 17 00:00:00 2001 From: greg pereira Date: Sun, 23 Jun 2024 17:35:28 -0700 Subject: [PATCH] swap user ec2 to root Signed-off-by: greg pereira --- .../workflows/ai-lab-remote-rhel-build.yaml | 2 +- build/ci/rhel-ansible/playbook.yaml | 37 ++++++++++++------- build/docker/builder/cpu/rhel9/Dockerfile | 3 ++ .../docker/builder/cpu/rhel9/install-rpms.sh | 2 + 4 files changed, 29 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ai-lab-remote-rhel-build.yaml b/.github/workflows/ai-lab-remote-rhel-build.yaml index 2a7c1180b7a99..9d66c2817ea17 100644 --- a/.github/workflows/ai-lab-remote-rhel-build.yaml +++ b/.github/workflows/ai-lab-remote-rhel-build.yaml @@ -71,7 +71,7 @@ jobs: - name: Setup tmate session # if: ${{ failure() }} uses: mxschmitt/action-tmate@v3.18 - timeout-minutes: 17 + timeout-minutes: 25 with: detached: true limit-access-to-actor: true diff --git a/build/ci/rhel-ansible/playbook.yaml b/build/ci/rhel-ansible/playbook.yaml index a443e5f9d06b2..f796f5c078fc0 100644 --- a/build/ci/rhel-ansible/playbook.yaml +++ b/build/ci/rhel-ansible/playbook.yaml @@ -24,7 +24,7 @@ - name: remove podman for clean docker install ansible.builtin.shell: | - sudo dnf -y remove \ + dnf -y remove \ docker \ docker-client \ docker-client-latest \ @@ -65,9 +65,11 @@ cd /tmp export ARCH=$(uname -m) if [[ "$ARCH" == "arm64" ]] || [[ "$ARCH" == "aarch64" ]]; then + echo "aarch64 selected" curl -sLO https://github.com/docker/compose/releases/download/v2.28.0/docker-compose-linux-aarch64 sudo mv /tmp/docker-compose-linux-aarch64 /usr/bin/docker-compose elif [[ "$ARCH" == "amd64" ]] || [[ "$ARCH" == "x86_64" ]]; then + echo "x86_64 selected" curl -sLO https://github.com/docker/compose/releases/download/v2.28.0/docker-compose-linux-x86_64 sudo mv /tmp/docker-compose-linux-x86_64 /usr/bin/docker-compose fi @@ -79,29 +81,36 @@ password: "{{ registry_pass }}" registry: quay.io + - name: Register to subscription manager + ansible.builtin.shell: | + subscription-manager register --username "{{ subman_user }}" --password "{{ subman_pass }}" --force + - name: Clone Git repository + become: false ansible.builtin.git: repo: https://github.com/redhat-et/milvus.git - dest: "/home/ec2-user/milvus" + dest: "/tmp/milvus" version: "rhel9-milvus" clone: yes update: yes - name: DEBUG - sleep ansible.builtin.shell: | - sleep 400 + sleep 900 - name: Make the builder image async: 1000 poll: 0 register: builder_result - become: true - ansible.builtin.shell: | set -x - cd /home/ec2-user/milvus/ + cd /tmp/milvus/ + sudo su + echo $TARGETARCH + export TARGETARCH=$(uname -m) + echo $TARGETARCH ./build/builder.sh make install - ls -al /home/ec2-user/milvus/ + ls -al /tmp/milvus/ set +x - name: Check on the builder image @@ -117,12 +126,12 @@ poll: 0 register: milvus_result ansible.builtin.shell: | - cd /home/ec2-user/milvus - ls -al /home/ec2-user/milvus - mv /home/ec2-user/milvus/bin /home/ec2-user/milvus/build/docker/milvus/rhel9/ - mv /home/ec2-user/milvus/configs /home/ec2-user/milvus/build/docker/milvus/rhel9/ - mv /home/ec2-user/milvus/lib /home/ec2-user/milvus/build/docker/milvus/rhel9/ - sudo su && /home/ec2-user/milvus/build/build_image.sh make + cd /tmp/milvus + ls -al /tmp/milvus + mv /tmp/milvus/bin /tmp/milvus/build/docker/milvus/rhel9/ + mv /tmp/milvus/configs /tmp/milvus/build/docker/milvus/rhel9/ + mv /tmp/milvus/lib /tmp/milvus/build/docker/milvus/rhel9/ + /tmp/milvus/build/build_image.sh make - name: Check on the milvus image async_status: @@ -134,7 +143,7 @@ - name: log docker images ansible.builtin.shell: | - sudo su && docker images + docker images - name: DEBUG - sleep ansible.builtin.shell: | diff --git a/build/docker/builder/cpu/rhel9/Dockerfile b/build/docker/builder/cpu/rhel9/Dockerfile index 7779122be21ca..cd77935160e21 100644 --- a/build/docker/builder/cpu/rhel9/Dockerfile +++ b/build/docker/builder/cpu/rhel9/Dockerfile @@ -37,7 +37,10 @@ RUN dnf install -y make cmake automake gcc gcc-c++ \ RUN alias python3='python3.11' # Assumes you have a valid subman subscription at the host machine + # RUN subscription-manager register --username $SUBMAN_USER --password $SUBMAN_PASS --force +RUN subscription-manager attach + # This gets used for the codeready-builder-for-rhel-9- stream for openblas-devel COPY build/docker/builder/cpu/rhel9/install-rpms.sh /root/install-rpms.sh RUN chmod +x /root/install-rpms.sh diff --git a/build/docker/builder/cpu/rhel9/install-rpms.sh b/build/docker/builder/cpu/rhel9/install-rpms.sh index 008d7940eafe2..9e72e3ad6372a 100644 --- a/build/docker/builder/cpu/rhel9/install-rpms.sh +++ b/build/docker/builder/cpu/rhel9/install-rpms.sh @@ -15,6 +15,8 @@ else exit 1 fi +subscription-manager attach + 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 \