Merge pull request #13052 from spowelljr/useAwsBucket

time-to-k8s: Store chart and JSON files in AWS
pull/13055/head
Steven Powell 2021-11-29 14:35:37 -08:00 committed by GitHub
commit 9c35d50e4a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 21 additions and 13 deletions

View File

@ -11,18 +11,16 @@ jobs:
time-to-k8s-public-chart:
if: github.repository == 'kubernetes/minikube'
runs-on: ubuntu-20.04
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: 'us-west-1'
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: ${{env.GO_VERSION}}
stable: true
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@master
with:
project_id: ${{ secrets.GCP_PROJECT_ID }}
service_account_key: ${{ secrets.GCP_TIME_TO_K8S_SA_KEY }}
export_default_credentials: true
- name: Benchmark time-to-k8s for Docker
run: |
./hack/benchmark/time-to-k8s/public-chart/public-chart.sh docker

View File

@ -161,6 +161,8 @@ func createChart(benchmarks []benchmark, chartOutputPath string) {
*xy = make(plotter.XYs, n)
}
var maxTotal float64
for i, b := range benchmarks {
date := float64(b.Date.Unix())
xyValues := []struct {
@ -181,6 +183,9 @@ func createChart(benchmarks []benchmark, chartOutputPath string) {
xy.Y = xyValue.value
xy.X = date
}
if b.Total > maxTotal {
maxTotal = b.Total
}
}
p := plot.New()
@ -190,7 +195,7 @@ func createChart(benchmarks []benchmark, chartOutputPath string) {
p.X.Label.Text = "date"
p.X.Tick.Marker = plot.TimeTicks{Format: "2006-01-02"}
p.Y.Label.Text = "time (seconds)"
p.Y.Max = 95
p.Y.Max = maxTotal + 15
steps := []struct {
xys plotter.XYs

View File

@ -18,6 +18,7 @@ set -e
# container-runtime (docker or containerd)
RUNTIME="$1"
BUCKET="s3://time-to-k8s"
install_minikube() {
make
@ -34,21 +35,25 @@ generate_chart() {
go run ./hack/benchmark/time-to-k8s/public-chart/generate-chart.go --csv ./hack/benchmark/time-to-k8s/time-to-k8s-repo/output.csv --output ./chart.png --past-runs ./runs.json
}
copy() {
aws s3 cp "$1" "$2"
}
cleanup() {
rm ./runs.json
rm ./hack/benchmark/time-to-k8s/time-to-k8s-repo/output.csv
rm ./chart.png
}
gsutil -m cp "gs://minikube-time-to-k8s/$RUNTIME-runs.json" ./runs.json
copy "$BUCKET/$RUNTIME-runs.json" ./runs.json
install_minikube
run_benchmark
generate_chart
gsutil -m cp ./runs.json "gs://minikube-time-to-k8s/$RUNTIME-runs.json"
gsutil -m cp ./runs.json "gs://minikube-time-to-k8s/$(date +'%Y-%m-%d')-$RUNTIME.json"
gsutil -m cp ./chart.png "gs://minikube-time-to-k8s/$RUNTIME-chart.png"
copy ./runs.json "$BUCKET/$RUNTIME-runs.json"
copy ./runs.json "$BUCKET/$(date +'%Y-%m-%d')-$RUNTIME.json"
copy ./chart.png "$BUCKET/$RUNTIME-chart.png"
cleanup

View File

@ -9,8 +9,8 @@ weight: -99999999
## Docker
![Docker Benchmarks](https://storage.googleapis.com/minikube-time-to-k8s/docker-chart.png)
![Docker Benchmarks](https://time-to-k8s.s3.us-west-1.amazonaws.com/docker-chart.png)
## Containerd
![Containerd Benchmarks](https://storage.googleapis.com/minikube-time-to-k8s/containerd-chart.png)
![Containerd Benchmarks](https://time-to-k8s.s3.us-west-1.amazonaws.com/containerd-chart.png)