forked from milvus-io/milvus
-
Notifications
You must be signed in to change notification settings - Fork 1
72 lines (59 loc) · 2.26 KB
/
ai-lab-remote-rhel-build.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
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/[email protected]
with:
terraform_version: "1.7.5"
terraform_wrapper: false
- name: Checkout
uses: actions/[email protected]
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