- Notifications
You must be signed in to change notification settings - Fork 64
Adding Performance test script #289
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
5 commits Select commit Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| #!/bin/bash | ||
| | ||
| for i in `kubectl get appwrapper -n default |grep defaultaw | awk '{print $1}'`; do kubectl delete appwrapper $i -n default ; done | ||
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| #!/bin/bash | ||
jbusche marked this conversation as resolved. Show resolved Hide resolved | ||
| | ||
jbusche marked this conversation as resolved. Show resolved Hide resolved | ||
| read -p "How many appwrapper jobs do you want?" jobs | ||
| | ||
| # Start the timer now | ||
| SECONDS=0 | ||
| | ||
| echo "jobs number is $jobs" | ||
| export STARTTIME=`date +"%T"` | ||
| echo " " | ||
| echo "Jobs started at: $STARTTIME" |tee job-$STARTTIME.log | ||
| echo " " | ||
| | ||
| # This fixes the number of jobs to be one less so the for loop gets the right amount | ||
| ((realjobs=$jobs-1)) | ||
| | ||
| for num in $(eval echo "{0.."$realjobs"}") | ||
| do | ||
| next_num=$(($num + 1)) | ||
| echo "Submitting job $next_num" | ||
| # Had to do this OSTYPE because sed acts differently on Linux versus Mac | ||
| case "$OSTYPE" in | ||
| linux-gnu*) | ||
| sed -i "s/defaultaw-schd-spec-with-timeout-$num/defaultaw-schd-spec-with-timeout-$next_num/g" preempt-exp.yaml ;; | ||
| darwin*) | ||
| sed -i '' "s/defaultaw-schd-spec-with-timeout-$num/defaultaw-schd-spec-with-timeout-$next_num/g" preempt-exp.yaml ;; | ||
| *) | ||
| sed -i "s/defaultaw-schd-spec-with-timeout-$num/defaultaw-schd-spec-with-timeout-$next_num/g" preempt-exp.yaml ;; | ||
| esac | ||
| oc apply -f preempt-exp.yaml | ||
jbusche marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| done | ||
| | ||
| # Let's reset the original preempt-exp.yaml file back to original value | ||
| case "$OSTYPE" in | ||
| linux-gnu*) | ||
| sed -i "s/defaultaw-schd-spec-with-timeout-$next_num/defaultaw-schd-spec-with-timeout-1/g" preempt-exp.yaml ;; | ||
| darwin*) | ||
| sed -i '' "s/defaultaw-schd-spec-with-timeout-$next_num/defaultaw-schd-spec-with-timeout-1/g" preempt-exp.yaml ;; | ||
| *) | ||
| sed -i "s/defaultaw-schd-spec-with-timeout-$next_num/defaultaw-schd-spec-with-timeout-1/g" preempt-exp.yaml ;; | ||
| esac | ||
| | ||
| # Check for all jobs to report complete | ||
| jobstatus=`oc get jobs --no-headers --field-selector status.successful=1 |wc -l` | ||
| | ||
| while [ $jobstatus -lt $jobs ] | ||
| do | ||
| echo "Number of completed jobs is: " $jobstatus " and the goal is: " $jobs | ||
| sleep 10 | ||
| jobstatus=`oc get jobs --no-headers --field-selector status.successful=1 |wc -l` | ||
| done | ||
| | ||
| echo " " | ||
| export FINISHTIME=`date +"%T"` | ||
| echo "All $jobstatus jobs finished: $FINISHTIME" |tee -a job-$STARTTIME.log | ||
| echo "Total amount of time for $jobs appwrappers is: $SECONDS seconds" |tee -a job-$STARTTIME.log | ||
| echo " " | ||
| echo "Test results are stored in this file: job-$next_num-$STARTTIME.log" | ||
| | ||
| # Rename the log to show the number of jobs used | ||
| mv job-$STARTTIME.log job-$next_num-$STARTTIME.log | ||
| | ||
| #Ask if you want to auto-cleanup the appwrapper jobs | ||
| echo "Do you want to cleanup the most recently created appwrappers? [Y/n]" | ||
| read DELETE | ||
| if [[ $DELETE == "Y" || $DELETE == "y" ]]; then | ||
| echo "OK, deleting" | ||
| ./cleanup.sh | ||
jbusche marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| else | ||
| echo "OK, you'll need to cleanup yourself later using ./cleanup.sh" | ||
| fi | ||
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| apiVersion: mcad.ibm.com/v1beta1 | ||
| kind: AppWrapper | ||
| metadata: | ||
| name: defaultaw-schd-spec-with-timeout-1 | ||
| namespace: default | ||
| spec: | ||
| schedulingSpec: | ||
| minAvailable: 1 | ||
| requeuing: | ||
| timeInSeconds: 120 | ||
| growthType: "exponential" | ||
| priority: 9 | ||
| resources: | ||
| Items: [] | ||
| GenericItems: | ||
| - replicas: 1 | ||
| completionstatus: Complete | ||
| custompodresources: | ||
| - replicas: 1 | ||
| requests: | ||
| cpu: 500m | ||
| memory: 512M | ||
| nvidia.com/gpu: 0 | ||
| limits: | ||
| cpu: 500m | ||
| memory: 512M | ||
| nvidia.com/gpu: 0 | ||
| generictemplate: | ||
| apiVersion: batch/v1 | ||
| kind: Job | ||
| metadata: | ||
| namespace: default | ||
| name: defaultaw-schd-spec-with-timeout-1 | ||
| # labels: | ||
| # appwrapper.mcad.ibm.com: defaultaw-schd-spec-with-timeout-1 | ||
| spec: | ||
| parallelism: 1 | ||
| completions: 1 | ||
| template: | ||
| metadata: | ||
| namespace: default | ||
| labels: | ||
| appwrapper.mcad.ibm.com: "defaultaw-schd-spec-with-timeout-1" | ||
| spec: | ||
| containers: | ||
| - name: defaultaw-schd-spec-with-timeout-1 | ||
| image: ubuntu:latest | ||
jbusche marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| command: [ "/bin/bash", "-c", "--" ] | ||
| args: [ "sleep 10" ] | ||
| resources: | ||
| requests: | ||
| memory: "512Mi" | ||
| cpu: "500m" | ||
| limits: | ||
| memory: "512Mi" | ||
| cpu: "500m" | ||
| restartPolicy: Never | ||
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.