Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add memory check for runners for VTOrc tests #15317

Merged
merged 1 commit into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we turn this into a int representing GB needed so we could also add this easily to other templates (with different values) if we need to? Or is that premature at this point?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In favor. But also fine to merge as is for now and to iterate later.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can extend it when we need it.

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
Loading