Skip to content

Latest commit

 

History

History
74 lines (60 loc) · 5.33 KB

CONTRIBUTING.md

File metadata and controls

74 lines (60 loc) · 5.33 KB

Contributing

This brief guide is addressed to developers aiming to extend this repository.

Table of Contents

Every benchmark has a dedicated YAML folder under yaml/benchmarks. It is sufficient to edit whatever file under its folder without the need of applying anything immediately: Kustomize will automatically merge and apply all the YAML specified by command line files upong launching benchmarks-dedicated CronJob files.

Change the Docker images to be used

As described in the Docker images section, there are currentl two Docker images being used:

A Kubernetes CronJob launches periodic jobs in Docker containers. The base CronJob file of this repository yaml/base/kubemarks-pkb-cronjob.yaml mainly executes PerfKit Benchmarker, which in turn needs to launch benchmarks in Docker containers so that the Kubernetes scheduler can allocate those onto pods. marcomicera/kubemarks-cronjob and marcomicera/kubemarks-pkb are the Docker images launched by the CronJob and PerfKit Benchmarker, respectively.

The first (marcomicera/kubemarks-cronjob) is defined in the base CronJob file yaml/base/kubemarks-pkb-cronjob.yaml.

The second image (marcomicera/kubemarks-pkb) is defined in the PKB_IMAGE variable of the PKB's starting script scripts/pkb/start.sh. Since the second must be launched by the former, one must build and upload the (marcomicera/kubemarks-cronjob) image with its build and upload script upon changing the name of the image launched by PerfKit Benchmarker (marcomicera/kubemarks-pkb).

All Dockerfiles can be found in the docker folder.

Add additional results writers

PerfKit Benchmarker can be easily extended with additional results writers. It is enough to add a SamplePublisher child class in perfkitbenchmarker/publisher.py and add it to the list of publishers (SampleCollector's class method _PublishersFromFlags()).
Results publishers must be enabled by means of flags, which are declared at the beginning of that very same file. PerfKit Benchmarker is finally launched by the PKB's starting script, which holds a PKB_FLAGS variable containing all the flags to be passed to PerfKit Benchmarker.

Add new benchmarks

New benchmarks must be integrated in PerfKit Benchmarker: guidelines on how to do so are available in its CONTRIBUTING.md file.

Run benchmarks locally

  1. Start minikube on your local machine:

    $ minikube start
  2. Add the current user to the docker group:

    $ newgrp docker
  3. To use a local Docker image:

    1. Run a local Docker registry:
      $ docker run -d -p 5000:5000 --restart=always --name registry registry:2
    2. Build the Docker image:
      $ docker build -t kubemarks-pkb docker/kubemarks-pkb/ && docker tag kubemarks-pkb:latest marcomicera/kubemarks-pkb
  4. Run it

When you're done:

  1. Stop the local Docker registry:
    $ docker container stop registry
  2. Remove its container:
    $ docker container rm -v registry
  3. Stop minikube;
    $ minikube stop