From d98e7b9afb8f1f598e75faada5d23d84bcb0d5d0 Mon Sep 17 00:00:00 2001 From: greg pereira Date: Wed, 12 Jun 2024 15:35:32 -0700 Subject: [PATCH] add workflow Signed-off-by: greg pereira --- .../workflows/ai-lab-remote-rhel-build.yaml | 72 +++++++++++++++++++ build/docker/builder/cpu/rhel9/Dockerfile | 1 + build/docker/milvus/rhel9/Dockerfile | 4 +- 3 files changed, 76 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/ai-lab-remote-rhel-build.yaml diff --git a/.github/workflows/ai-lab-remote-rhel-build.yaml b/.github/workflows/ai-lab-remote-rhel-build.yaml new file mode 100644 index 0000000000000..decff9a58414c --- /dev/null +++ b/.github/workflows/ai-lab-remote-rhel-build.yaml @@ -0,0 +1,72 @@ +name: Remote RHEL Build + +on: + workflow_dispatch: + + pull_request: + branches: + - master + paths: + - 'build/docker/builder/cpu/rhel9/**' + - '.github/workflows/ai-lab-remote-rhel-build.yaml' + +env: + AWS_REGION: us-east-1 + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + TF_VAR_vpc_id: ${{ secrets.VPC_ID }} + TF_VAR_rh_access: ${{ secrets.RH_ACCESS }} + TF_VAR_rh_org: ${{ secrets.RH_ORG }} + TF_VAR_ami_id: ${{ secrets.AMI_ID }} + +jobs: + podman-remote: + runs-on: ubuntu-24.04 + steps: + - name: Setup Terraform + uses: hashicorp/setup-terraform@v3.1.1 + with: + terraform_version: "1.7.5" + terraform_wrapper: false + + - name: Checkout + uses: actions/checkout@v4.1.6 + with: + path: main + + # - name: sshkeygen for ansible + # run: ssh-keygen -t rsa -b 4096 -f ~/.ssh/id_rsa -N "" + + - name: Terraform Init + run: terraform init + + - name: Terraform Apply + run: terraform apply -auto-approve + + - name: Terraform Output + id: terraform-output + run: | + echo "id=$(terraform output id | xargs)" >> $GITHUB_OUTPUT + echo "url=$(terraform output host | xargs)" >> $GITHUB_OUTPUT + echo "ssh_public_key=$(terraform output ssh_public_key | xargs)" >> $GITHUB_OUTPUT + echo "pem_filename=$(terraform output pem_filename | xargs)" >> $GITHUB_OUTPUT + working-directory: terraform-test-environment-module + + - name: Install podman remote + run: | + sudo apt-get install -y podman podman-remote + sudo apt-get install -y jq + + # - name: jq parse the terraform state for the public ip + # run: | + # PUBLIC_IP=$(terraform output -json | jq -r '.public_ip.value') + # podman system connection add terraform --identity ~/.ssh/id_rsa ssh://ec2-user@$PUBLIC_IP/run/user/1000/podman/podman.sock + # podman system connection list + + # - name: Build image + # run: | + # podman-remote build -f build/docker/builder/cpu/rhel9/Containerfile . + + - name: Terraform Destroy + if: always() + run: terraform destroy -auto-approve diff --git a/build/docker/builder/cpu/rhel9/Dockerfile b/build/docker/builder/cpu/rhel9/Dockerfile index df01b1a398f5e..6913832fa3d94 100644 --- a/build/docker/builder/cpu/rhel9/Dockerfile +++ b/build/docker/builder/cpu/rhel9/Dockerfile @@ -37,6 +37,7 @@ RUN dnf install -y make cmake automake gcc gcc-c++ \ RUN alias python3='python3.11' # Assumes you have a valid subman subscription + # 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/milvus/rhel9/Dockerfile b/build/docker/milvus/rhel9/Dockerfile index ccb6594e3c212..cd7f2defbfee8 100644 --- a/build/docker/milvus/rhel9/Dockerfile +++ b/build/docker/milvus/rhel9/Dockerfile @@ -14,11 +14,13 @@ FROM registry.access.redhat.com/ubi9/ubi:9.4-947.1717074712 ARG TARGETARCH -# assumes repo of codeready-builder-for-rhel-9- RUN dnf install -y wget libgomp libaio libatomic USER 0 +# Assumes you have a valid subman subscription + # This gets used for the codeready-builder-for-rhel-9- stream for openblas-devel + 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