Read this first! : https://github.com/kubernetes/test-infra/blob/master/prow/pod-utilities.md
Note the example above is a periodic job.
- name - no change
- interval - no change
- branches - move to extra_refs. Make sure the entry is the first in the list of repos in extra_refs. (WARNING: current work directory will not work properly otherwise)
- labels - no change
- use
preset-bazel-scratch-dirandpreset-bazel-remote-cache-enabledif you are building something using bazel - use
preset-dind-enabledandpreset-kind-volume-mountsif you are running kind (Also note the resources.requests/cpu/mem bump, copy them from an existing job)
- use
- add
decorate: trueto tell prow that you are using pod utils - for every repo in before.yaml that you needed using
--repo=, add an entry in extra_refs.- Pay attention to the
path_aliasso it gets checked out in the correct directories on disk - be specific about
base_refas well. - Note the order of the repos again (see warning in 3. above)
- Pay attention to the
- spec.containers.image - no change
- spec.containers.env - no change
- switch over
args:tocommand:(make sure you addrunner.shas the first param, this is the script that runs the command)- drop
--repoas we moved them to extra_refs - drop
--job,--root,--service-account,--uploadand--scenariomagic parameters we don't need them - don't need the
bash -cstuff either, just pass the script we need as the second parameter incommandand follow that with any other params needed by your script
- drop
securityContext,resources,annotationsremain the same- Make sure any logs you need are under
$ARTIFACTS/logs/ - Make sure any references to
/go/srcis switched to/home/prow/go/srcin your scripts - if there is a
- --timeout=105above the--delimiter, usedecoration_configlike so:
decoration_config:
timeout: 105m
- Oh! for the
image:the latestkubekins-e2eimage is fine to use
For pre-submit jobs:
- No need to add
extra_refsfor the main repo, just ensurepath_aliasis correct. - current work directory will be the main repo (NOT the first entry in
extra_refs) always_run: truemeans, this CI job will run for every changeoptional: truemeans, this CI job does not have to be green for the PR to merge
Tips:
- Always start with a presubmit job, get that working and then change the periodic job, so its easier to iterate
- Keep the interval small (every hour) to get things working and then switch it over to longer/desired duration
- use
https://prow.k8s.io/?job=my-favorite-job*to see the last few runs (yes supports wild cards) - if you don't see your repos cloned correctly check the
clone-log.txtin the captured logs (click "Artifacts" link in the prow report for the failed job)
Finally, Don't forget to check the yaml indentation! when in doubt, find another CI job that does something similar and see how that is set up!
Some comments:
This way, runner.sh calls kubernetes_e2e.py, that calls kubetest, that does its magic :)