Skip to content

Commit

Permalink
feat: add memory check for runners for VTOrc
Browse files Browse the repository at this point in the history
Signed-off-by: Manan Gupta <[email protected]>
  • Loading branch information
GuptaManan100 committed Feb 21, 2024
1 parent 27be916 commit 2131477
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/cluster_endtoend_vtorc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,15 @@ jobs:
draft=$(echo "$PR_DATA" | jq .draft -r)
echo "is_draft=${draft}" >> $GITHUB_OUTPUT
- name: Check Memory
run: |
totalMem=$(free -g | awk 'NR==2 {print $2}')
echo "total memory $totalMem GB"
if [[ "$totalMem" -lt 15 ]]; then
echo "Less memory than required"
exit 1
fi
- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@v3
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/cluster_endtoend_vtorc_mysql57.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,15 @@ jobs:
draft=$(echo "$PR_DATA" | jq .draft -r)
echo "is_draft=${draft}" >> $GITHUB_OUTPUT
- name: Check Memory
run: |
totalMem=$(free -g | awk 'NR==2 {print $2}')
echo "total memory $totalMem GB"
if [[ "$totalMem" -lt 15 ]]; then
echo "Less memory than required"
exit 1
fi
- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@v3
Expand Down
11 changes: 11 additions & 0 deletions test/ci_workflow_gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@ var (
"vtgate_topo_consul",
"tabletmanager_consul",
}
clustersRequiringMemoryCheck = []string{
"vtorc",
}
clusterRequiring16CoresMachines = []string{
"onlineddl_vrepl",
"onlineddl_vrepl_stress",
Expand All @@ -154,6 +157,7 @@ type unitTest struct {
type clusterTest struct {
Name, Shard, Platform string
FileName string
MemoryCheck bool
MakeTools, InstallXtraBackup bool
Docker bool
LimitResourceUsage bool
Expand Down Expand Up @@ -351,6 +355,13 @@ func generateClusterWorkflows(list []string, tpl string) {
break
}
}
memoryCheckClusters := canonnizeList(clustersRequiringMemoryCheck)
for _, memCheckCluster := range memoryCheckClusters {
if memCheckCluster == cluster {
test.MemoryCheck = true
break
}
}
xtraBackupClusters := canonnizeList(clustersRequiringXtraBackup)
for _, xtraBackupCluster := range xtraBackupClusters {
if xtraBackupCluster == cluster {
Expand Down
13 changes: 13 additions & 0 deletions test/templates/cluster_endtoend_test.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,19 @@ jobs:
draft=$(echo "$PR_DATA" | jq .draft -r)
echo "is_draft=${draft}" >> $GITHUB_OUTPUT

{{if .MemoryCheck}}

- name: Check Memory
run: |
totalMem=$(free -g | awk 'NR==2 {print $2}')
echo "total memory $totalMem GB"
if [[ "$totalMem" -lt 15 ]]; then
echo "Less memory than required"
exit 1
fi

{{end}}

- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@v3
Expand Down
13 changes: 13 additions & 0 deletions test/templates/cluster_endtoend_test_mysql57.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,19 @@ jobs:
draft=$(echo "$PR_DATA" | jq .draft -r)
echo "is_draft=${draft}" >> $GITHUB_OUTPUT

{{if .MemoryCheck}}

- name: Check Memory
run: |
totalMem=$(free -g | awk 'NR==2 {print $2}')
echo "total memory $totalMem GB"
if [[ "$totalMem" -lt 15 ]]; then
echo "Less memory than required"
exit 1
fi

{{end}}

- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@v3
Expand Down

0 comments on commit 2131477

Please sign in to comment.