-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1021 from kruize/mvp_demo
Merge 0.0.20_rm changes from mvp_demo to master
- Loading branch information
Showing
80 changed files
with
5,634 additions
and
3,468 deletions.
There are no files selected for viewing
This file contains 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,27 @@ | ||
name: Get PR Number | ||
|
||
on: | ||
workflow_call: | ||
outputs: | ||
pr_number: | ||
value: ${{ jobs.get_pr_number.outputs.output1 }} | ||
|
||
jobs: | ||
get_pr_number: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
output1: ${{ steps.pr.outputs.pr_number }} | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Get PR number | ||
id: pr | ||
run: | | ||
echo "Commit SHA: ${{ github.sha }}" | ||
pr_number=$(curl -s -X GET \ | ||
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ | ||
"https://api.github.com/repos/${{ github.repository }}/commits/${{ github.sha }}/pulls" \ | ||
| jq -r '.[0].number') | ||
echo "pr_number=${pr_number}" | ||
echo "pr_number=${pr_number}" >> $GITHUB_OUTPUT |
This file contains 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
This file contains 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 |
---|---|---|
|
@@ -29,7 +29,9 @@ jobs: | |
- name: Build autotune | ||
run: | | ||
echo Build autotune | ||
./build.sh -i autotune_operator:test | ||
pr_number=${{ github.event.pull_request.number }} | ||
echo "pr_number=${pr_number}" >> "$GITHUB_ENV" | ||
./build.sh -i autotune_operator:pr_${pr_number} | ||
docker images | grep autotune | ||
- name: Check cluster info on minikube | ||
run: | | ||
|
@@ -48,11 +50,15 @@ jobs: | |
echo "***************************************************************" | ||
cat ./manifests/autotune/autotune-operator-deployment.yaml_template | ||
echo "***************************************************************" | ||
./deploy.sh -c minikube -i autotune_operator:test | ||
echo "PR_NUMBER = ${{ env.pr_number }}" | ||
./deploy.sh -c minikube -i autotune_operator:pr_${{ env.pr_number }} | ||
sleep 20 | ||
- name: Capture ffdc logs | ||
if: always() | ||
run: | | ||
echo "Capturing ffdc logs" | ||
./scripts/ffdc.sh -d ${GITHUB_WORKSPACE} | ||
- name: Archive results | ||
if: always() | ||
|
@@ -76,6 +82,8 @@ jobs: | |
steps: | ||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | ||
- uses: actions/checkout@v3 | ||
with: | ||
repository: kruize/autotune | ||
- name: Setup Minikube | ||
uses: manusa/[email protected] | ||
with: | ||
|
@@ -84,7 +92,9 @@ jobs: | |
- name: Build crc | ||
run: | | ||
echo Build crc | ||
./build.sh -i autotune_operator:test | ||
pr_number=${{ github.event.pull_request.number }} | ||
echo "pr_number=${pr_number}" >> "$GITHUB_ENV" | ||
./build.sh -i autotune_operator:pr_${pr_number} | ||
docker images | grep autotune | ||
- name: Check cluster info on minikube | ||
run: | | ||
|
@@ -102,12 +112,13 @@ jobs: | |
cp ./manifests/crc/default-db-included-installation/minikube/kruize-crc-minikube.yaml ./manifests/crc/default-db-included-installation/minikube/kruize-crc-minikube.yaml.old | ||
sed -e "s/imagePullPolicy: Always/imagePullPolicy: IfNotPresent/g" ./manifests/crc/default-db-included-installation/minikube/kruize-crc-minikube.yaml.old > ./manifests/crc/default-db-included-installation/minikube/kruize-crc-minikube.yaml | ||
cat ./manifests/crc/default-db-included-installation/minikube/kruize-crc-minikube.yaml | ||
cd tests | ||
./test_autotune.sh -c minikube -i autotune_operator:test --testsuite=remote_monitoring_tests --testcase=test_e2e --resultsdir=${GITHUB_WORKSPACE} | ||
echo "PR_NUMBER = ${{ env.pr_number }}" | ||
./test_autotune.sh -c minikube -i autotune_operator:pr_${{ env.pr_number }} --testsuite=remote_monitoring_tests --testcase=test_e2e --resultsdir=${GITHUB_WORKSPACE} | ||
- name: Capture ffdc logs | ||
if: always() | ||
run: | | ||
echo "Capturing ffdc logs" | ||
./scripts/ffdc.sh -m crc -d ${GITHUB_WORKSPACE}/kruize_test_results | ||
- name: Archive results | ||
if: always() | ||
|
@@ -123,3 +134,54 @@ jobs: | |
path: ./crc_results.tar | ||
retention-days: 2 | ||
|
||
|
||
test_crc_manifest_build: | ||
# The type of runner that the job will run on | ||
runs-on: ubuntu-20.04 | ||
|
||
steps: | ||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | ||
- uses: actions/checkout@v3 | ||
- name: Setup Minikube | ||
uses: manusa/[email protected] | ||
with: | ||
minikube version: 'v1.16.0' | ||
kubernetes version: 'v1.19.2' | ||
|
||
- name: Check cluster info on minikube | ||
run: | | ||
kubectl cluster-info | ||
kubectl get pods -n kube-system | ||
- name: Install Prometheus on minikube | ||
run: | | ||
echo Install Prometheus on minikube | ||
cd scripts | ||
./prometheus_on_minikube.sh -as | ||
- name: Test with manifest kruize build in crc mode | ||
run: | | ||
echo Test with manifest kruize build in crc mode | ||
echo "***************************************************************" | ||
cd tests | ||
./test_autotune.sh -c minikube --testsuite=remote_monitoring_tests --testcase=test_e2e --resultsdir=${GITHUB_WORKSPACE} | ||
- name: Capture ffdc logs | ||
if: always() | ||
run: | | ||
./scripts/ffdc.sh -m crc -d ${GITHUB_WORKSPACE}/kruize_test_results | ||
- name: Archive results | ||
if: always() | ||
run: | | ||
cd ${GITHUB_WORKSPACE} | ||
tar cvf crc_manifest_results.tar kruize_test_results | ||
- name: Upload results | ||
if: always() | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: crc-manifest-results | ||
path: ./crc_manifest_results.tar | ||
retention-days: 2 | ||
|
This file contains 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 |
---|---|---|
|
@@ -15,18 +15,26 @@ on: | |
workflow_dispatch: | ||
|
||
jobs: | ||
get_pr: | ||
uses: ./.github/workflows/get-pr-number.yaml | ||
|
||
# This workflow contains three jobs called "build job" , "deploy autotune" and "deploy crc" | ||
build_job: | ||
needs: get_pr | ||
# The type of runner that the job will run on | ||
runs-on: ubuntu-20.04 | ||
|
||
steps: | ||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | ||
- uses: actions/checkout@v3 | ||
- name: Get PR number | ||
run: | | ||
echo "PR_NUMBER=${{ needs.get_pr.outputs.pr_number }}" >> $GITHUB_ENV | ||
- name: Build monitoring | ||
run: | | ||
echo Build monitoring | ||
./build.sh -i autotune_operator:test -o autotune_optuna:test | ||
./build.sh -i autotune_operator:pr_${{ env.PR_NUMBER }} -o autotune_optuna:pr_${{ env.PR_NUMBER }} | ||
docker images | grep autotune | ||
- name: docker login | ||
uses: docker/login-action@v2 | ||
|
@@ -35,17 +43,21 @@ jobs: | |
password: ${{ secrets.DOCKER_PASSWORD }} | ||
- name: Docker Push | ||
run: | | ||
docker tag autotune_operator:test kruize/autotune_operator:test | ||
docker push kruize/autotune_operator:test | ||
docker tag autotune_operator:pr_${{ env.PR_NUMBER }} kruize/autotune_operator:pr_${{ env.PR_NUMBER }} | ||
docker push kruize/autotune_operator:pr_${{ env.PR_NUMBER }} | ||
deploy_autotune: | ||
# The type of runner that the job will run on | ||
needs: build_job | ||
needs: [build_job, get_pr] | ||
|
||
runs-on: ubuntu-20.04 | ||
|
||
steps: | ||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | ||
- uses: actions/checkout@v3 | ||
- name: Get PR number | ||
run: | | ||
echo "PR_NUMBER=${{ needs.get_pr.outputs.pr_number }}" >> $GITHUB_ENV | ||
- name: Setup Minikube | ||
uses: manusa/[email protected] | ||
with: | ||
|
@@ -57,13 +69,14 @@ jobs: | |
kubectl get pods -n kube-system | ||
- name: Install Prometheus on minikube | ||
run: | | ||
echo Install Prometheus on minikube | ||
echo Install Prometheus on minikube | ||
cd scripts | ||
./prometheus_on_minikube.sh -as | ||
- name: Deploy kruize in experiment mode | ||
run: | | ||
echo Deploy Kruize in experiment mode | ||
./deploy.sh -c minikube -i kruize/autotune_operator:test | ||
echo "PR_NUMBER = ${{ env.PR_NUMBER }}" | ||
./deploy.sh -c minikube -i kruize/autotune_operator:pr_${{ env.PR_NUMBER }} | ||
sleep 20 | ||
- name: Capture ffdc logs | ||
if: always() | ||
|
@@ -85,12 +98,15 @@ jobs: | |
|
||
deploy_crc: | ||
# The type of runner that the job will run on | ||
needs: build_job | ||
needs: [build_job, get_pr] | ||
runs-on: ubuntu-20.04 | ||
|
||
steps: | ||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | ||
- uses: actions/checkout@v3 | ||
- name: Get PR number | ||
run: | | ||
echo "PR_NUMBER=${{ needs.get_pr.outputs.pr_number }}" >> $GITHUB_ENV | ||
- name: Setup Minikube | ||
uses: manusa/[email protected] | ||
with: | ||
|
@@ -102,7 +118,7 @@ jobs: | |
kubectl get pods -n kube-system | ||
- name: Install Prometheus on minikube | ||
run: | | ||
echo Install Prometheus on minikube | ||
echo Install Prometheus on minikube | ||
cd scripts | ||
./prometheus_on_minikube.sh -as | ||
- name: Deploy Kruize in crc mode | ||
|
@@ -113,7 +129,8 @@ jobs: | |
sed -e "s/imagePullPolicy: Always/imagePullPolicy: IfNotPresent/g" ./manifests/crc/default-db-included-installation/minikube/kruize-crc-minikube.yaml.old > ./manifests/crc/default-db-included-installation/minikube/kruize-crc-minikube.yaml | ||
cat ./manifests/crc/default-db-included-installation/minikube/kruize-crc-minikube.yaml | ||
cd tests | ||
./test_autotune.sh -c minikube -i kruize/autotune_operator:test --testsuite=remote_monitoring_tests --testcase=test_e2e --resultsdir=${GITHUB_WORKSPACE} | ||
echo "PR_NUMBER = ${{ env.PR_NUMBER }}" | ||
./test_autotune.sh -c minikube -i kruize/autotune_operator:pr_${{ env.PR_NUMBER }} --testsuite=remote_monitoring_tests --testcase=test_e2e --resultsdir=${GITHUB_WORKSPACE} | ||
- name: Capture ffdc logs | ||
if: always() | ||
run: | | ||
|
This file contains 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 @@ | ||
__pycache__/ |
This file contains 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
Oops, something went wrong.