Rhel9 milvus #11
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
name: AI-lab remove 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 }} | |
REGISTRY_USER: ${{ secrets.REGISTRY_USER }} | |
REGISTRY_PASS: ${{ secrets.REGISTRY_PASS }} | |
SUBMAN_USER: ${{ secrets.SUBMAN_USER }} | |
SUBMAN_PASS: ${{ secrets.SUBMAN_PASS }} | |
jobs: | |
rhel9-milvus: | |
runs-on: ubuntu-24.04 | |
strategy: | |
fail-fast: false | |
max-parallel: 1 | |
steps: | |
- name: Setup Terraform | |
uses: hashicorp/[email protected] | |
with: | |
terraform_version: "1.7.5" | |
- name: Checkout | |
uses: actions/[email protected] | |
- 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: Set up Python | |
uses: actions/[email protected] | |
with: | |
python-version: '3.11' | |
- name: Install Ansible | |
run: | | |
python3 -m pip install --upgrade pip | |
pip install ansible | |
- name: Ansible Collections | |
working-directory: build/ci/rhel-ansible | |
run: ansible-galaxy install -r requirements.yml | |
- name: Install jq | |
run: | | |
apt-get install -y jq | |
- name: Provision | |
working-directory: build/ci/rhel-ansible | |
run: | | |
PUBLIC_IP=$(terraform output -json | jq -r '.public_ip.value') | |
echo "[test_environment]" > inventory.ini | |
echo $PUBLIC_IP >> inventory.ini | |
ansible-playbook playbook.yaml \ | |
-i terraform-test-environment-module/hosts.ini \ | |
--extra-vars "image_name=${{ matrix.image_name }}" \ | |
--extra-vars "ssh_public_key='${{ steps.terraform-output.outputs.ssh_public_key }}'" \ | |
--extra-vars "registry_user=${{ secrets.REGISTRY_USER }}" \ | |
--extra-vars "registry_password=${{ secrets.REGISTRY_PASSWORD }}" | |
- name: Terraform Destroy | |
if: always() | |
run: terraform destroy -auto-approve |