Rhel9 milvus #16
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/setup-terraform@v3.1.1 | |
with: | |
terraform_version: "1.7.5" | |
- name: Checkout | |
uses: actions/checkout@v4.1.6 | |
- 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/setup-python@v5.1.0 | |
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.yaml | |
- name: Install jq and build inventory | |
run: | | |
sudo apt-get install -y jq | |
export PUBLIC_IP=$(terraform output -json | jq -r '.public_ip.value') | |
echo "[test_environment]" > build/ci/rhel-ansible/inventory.ini | |
echo "$PUBLIC_IP" >> build/ci/rhel-ansible/inventory.ini | |
cat build/ci/rhel-ansible/inventory.ini | |
- name: Setup tmate session | |
uses: mxschmitt/action-tmate@v3.18 | |
timeout-minutes: 10 | |
with: | |
detached: false | |
limit-access-to-actor: true | |
- name: Provision | |
working-directory: build/ci/rhel-ansible | |
run: | | |
ansible-playbook playbook.yaml \ | |
-i inventory.ini \ | |
--extra-vars "image_name=${{ matrix.image_name }}" \ | |
--extra-vars "registry_user=${{ secrets.REGISTRY_USER }}" \ | |
--extra-vars "registry_pass=${{ secrets.REGISTRY_PASS }}" \ | |
--extra-vars "subman_user=${{ secrets.SUBMAN_USER }} \ | |
--extra-vars "subman_pass=${{ secrets.SUBMAN_PASS }} | |
- name: Terraform Destroy | |
if: always() | |
run: terraform destroy -auto-approve |