-
Notifications
You must be signed in to change notification settings - Fork 3
96 lines (82 loc) · 3.63 KB
/
periodic.yml
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: Patu Periodic Cloud Performance and Scale Testing
on:
schedule:
- cron: '0 14 * * *'
jobs:
deploy-perf-scale:
name: deploy-perf-scale
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
cni: ["patu", "flannel"]
kube-distribution: ["kubeadm"]
env:
JOB_NAME: "patu-periodic-perfscale-${{ matrix.k8s-distro }}-${{ matrix.cni }}"
MATRIX_CNI: ${{ matrix.cni }}
KUBE_DIST: ${{ matrix.k8s-distro }}
AWS_REGION: "us-east-1"
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
ANSIBLE_VAULT_PASSWORD_FILE: "/home/runner/work/patu/patu/vault-secret.txt"
ANSIBLE_PRIVATE_KEY_FILE: "/home/runner/work/patu/patu/test/ansible/periodic/patu-ci.pem"
ANSIBLE_REMOTE_USER: ${{ secrets.ANSIBLE_USER }}
ANSIBLE_HOST_KEY_CHECKING: "False"
steps:
- name: checkout
uses: actions/checkout@v2
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install Ansible and dependencies
run: pip3.10 install boto boto3 ansible-vault ansible-core==2.13.3
- name: Install amazon.aws Ansible library
run: ansible-galaxy collection install amazon.aws
- name: Create ansible ssh key and vault passwd file
run: |
echo "${{ secrets.ANSIBLE_SSH_KEY }}" > /home/runner/work/patu/patu/test/ansible/periodic/patu-ci.pem
chmod 0400 /home/runner/work/patu/patu/test/ansible/periodic/patu-ci.pem
echo "${{ secrets.ANSIBLE_VAULT_PASSWORD }}" > /home/runner/work/patu/patu/vault-secret.txt
chmod 0400 /home/runner/work/patu/patu/vault-secret.txt
- name: Deploy EC2 Playbooks
run: |
ansible-playbook -vv ./test/ansible/periodic/deploy.yml \
--extra-vars "MATRIX_CNI=${{ matrix.cni }}" \
-i /home/runner/work/patu/patu/test/ansible/periodic/inventory.txt \
--private-key /home/runner/work/patu/patu/test/ansible/periodic/patu-ci.pem
- name: Display Iperf3 Results for ${{ matrix.cni }}
run: cat ./test/ansible/periodic/iperf-results-${{ matrix.cni }}.txt
clean:
name: terminate-tagged-ec2-instances
runs-on: ubuntu-latest
if: success() || failure()
needs: [ deploy-perf-scale ]
timeout-minutes: 10
env:
AWS_REGION: "us-east-1"
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
ANSIBLE_VAULT_PASSWORD_FILE: "/home/runner/work/patu/patu/vault-secret.txt"
ANSIBLE_PRIVATE_KEY_FILE: "/home/runner/work/patu/patu/test/ansible/periodic/patu-ci.pem"
ANSIBLE_REMOTE_USER: ${{ secrets.ANSIBLE_USER }}
ANSIBLE_HOST_KEY_CHECKING: "False"
steps:
- name: checkout
uses: actions/checkout@v2
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install Ansible and dependencies
run: pip3.10 install boto boto3 ansible-vault ansible-core==2.13.3
- name: Install amazon.aws Ansible library
run: ansible-galaxy collection install amazon.aws
- name: Create ansible ssh key and vault passwd file
run: |
echo "${{ secrets.ANSIBLE_SSH_KEY }}" > /home/runner/work/patu/patu/test/ansible/periodic/patu-ci.pem
chmod 0400 /home/runner/work/patu/patu/test/ansible/periodic/patu-ci.pem
echo "${{ secrets.ANSIBLE_VAULT_PASSWORD }}" > /home/runner/work/patu/patu/vault-secret.txt
chmod 0400 /home/runner/work/patu/patu/vault-secret.txt
- name: Deploy the EC2 Terminate Playbook
run: |
ansible-playbook -vv ./test/ansible/periodic/terminate-instances.yml