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-dir
andpreset-bazel-remote-cache-enabled
if you are building something using bazel - use
preset-dind-enabled
andpreset-kind-volume-mounts
if you are running kind (Also note the resources.requests/cpu/mem bump, copy them from an existing job)
- use
- add
decorate: true
to 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_alias
so it gets checked out in the correct directories on disk - be specific about
base_ref
as 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.sh
as the first param, this is the script that runs the command)- drop
--repo
as we moved them to extra_refs - drop
--job
,--root
,--service-account
,--upload
and--scenario
magic parameters we don't need them - don't need the
bash -c
stuff either, just pass the script we need as the second parameter incommand
and follow that with any other params needed by your script
- drop
securityContext
,resources
,annotations
remain the same- Make sure any logs you need are under
$ARTIFACTS/logs/
- Make sure any references to
/go/src
is switched to/home/prow/go/src
in your scripts - if there is a
- --timeout=105
above the--
delimiter, usedecoration_config
like so:
decoration_config:
timeout: 105m
- Oh! for the
image:
the latestkubekins-e2e
image is fine to use
For pre-submit jobs:
- No need to add
extra_refs
for the main repo, just ensurepath_alias
is correct. - current work directory will be the main repo (NOT the first entry in
extra_refs
) always_run: true
means, this CI job will run for every changeoptional: true
means, 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.txt
in 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 :)