Skip to content

Commit

Permalink
Merge pull request kubernetes#173 from stevekuznetsov/skuznets/sync-u…
Browse files Browse the repository at this point in the history
…pstream

Rebase
  • Loading branch information
stevekuznetsov authored Sep 4, 2018
2 parents f8c612f + 5796dbc commit 06e110b
Show file tree
Hide file tree
Showing 117 changed files with 2,798 additions and 3,458 deletions.
58 changes: 52 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,25 +28,71 @@ the different services interact.

## Automated testing

Test anything with the following pattern:
### If you are using kubekins | bootstrap

Assume your job looks something like

```yaml
- name: foo-bar-test
interval: 1h
agent: kubernetes
spec:
containers:
- image: gcr.io/k8s-testimages/kubekins-e2e:latest-master
args:
- --repo=github.com/foo/bar
- --timeout=90
- --scenario=execute
- --
- make
- test
```
You can see both images use the [same entrypoint script](/images/bootstrap/entrypoint.sh):
```sh
/usr/local/bin/runner.sh \
./test-infra/jenkins/bootstrap.py \
--job="${JOB_NAME}" \
--service-account="${GOOGLE_APPLICATION_CREDENTIALS}" \
--upload='gs://kubernetes-jenkins/logs' \
"$@"
```

So to mimic the run locally, you can dump all the args to the entrypoint script, like:

```sh
git clone https://github.com/kubernetes/test-infra
test-infra/jenkins/bootstrap.py --job=J --repo=R --service-account=S.json --upload=gs://B
test-infra/jenkins/bootstrap.py --job=foo-bar-test \
--repo=github.com/foo/bar \
--service-account=S.json \
--upload=gs://B \
--timeout=90 \
--scenario=execute \
-- \
make \
test
```

The `--job=J` flag specifies what test job to run.
The `--repo=R` (or `--bare`) flag controls what we check out from git.
where `--service-account` is the service account you want to activate for your job, and
`--upload` is the gcs bucket where you want to upload your job results to.

Anyone can reconfigure our CI system with a test-infra PR that updates the
appropriate files. Detailed instructions follow:
### If you are using podutils:

Unfortunately there's no easy way to test it locally - you can follow [getting started](/prow/getting_started.md)
to schedule a job against your own prow cluster.

We are working on have a utility to run the job locally - https://github.com/kubernetes/test-infra/issues/6590

### E2E Testing

Our e2e testing uses [kubetest](/kubetest) to build/deploy/test kubernetes
clusters on various providers. Please see those documents for additional details
about this tool as well as e2e testing generally.

Anyone can reconfigure our CI system with a test-infra PR that updates the
appropriate files. Detailed instructions follow:

### Create a new job

Create a PR in this repo to add/update/remove a job or suite. Specifically
Expand Down
2 changes: 2 additions & 0 deletions boskos/resources.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,8 @@ resources:
- k8s-jenkins-charts
- k8s-jenkins-cvm
- k8s-jenkins-garbagecollector
- k8s-jenkins-gci-kubemark
- k8s-jkns-clusterloader
- k8s-jkns-e2e-bazel
- k8s-jkns-e2e-etcd3
- k8s-jkns-e2e-gce
Expand Down
16 changes: 13 additions & 3 deletions config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,19 @@

This is a central place for Kubernetes-project specific configs for other tools in this repo.

### UNDER MIGRATION

Directory structure:
## Directory structure:

[jobs/](./jobs) : job configs for Kubernetes Prow deployment, potentially testgrid configs as well
[tests](./tests) : validation tests for the configs

## Adding new jobs to Prow:

1. Find or create an org/repo directory under config/jobs, eg: config/jobs/kubernetes-sigs/kustomize for jobs related to https://github.com/kubernetes-sigs/kustomize.

1. Create an OWNERS file and add appropriate approver/reviewer for your job.

1. Add a *.yaml file (the base name has to be unique), and follow https://github.com/kubernetes/test-infra/tree/master/prow#how-to-add-new-jobs for adding new prowjobs.

Also please read [`create-a-new-job`]

[`create-a-new-job`]: /README.md#create-a-new-job
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
approvers:
- nikhiljindal
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
presubmits:
GoogleCloudPlatform/k8s-multicluster-ingress:
- name: pull-kubernetes-multicluster-ingress-test
branches:
- master
always_run: true
labels:
preset-service-account: "true"
spec:
containers:
- image: gcr.io/k8s-testimages/kubekins-e2e:v20180829-29e661965-master
args:
- "--repo=github.com/GoogleCloudPlatform/$(REPO_NAME)=$(PULL_REFS)"
- "--root=/go/src"
- "--upload=gs://kubernetes-jenkins/pr-logs"
- --scenario=execute
- --
- make
- --
- -j
- "5"
- test
- coveralls
- vet
- fmt
- lint
volumeMounts:
- name: coveralls
mountPath: /etc/coveralls-token
readOnly: true
volumes:
- name: coveralls
secret:
secretName: k8s-multicluster-ingress-coveralls-token

postsubmits:
GoogleCloudPlatform/k8s-multicluster-ingress:
- name: ci-kubemci-image-push
branches:
- master
labels:
preset-service-account: "true"
preset-dind-enabled: "true"
spec:
containers:
- image: gcr.io/k8s-testimages/kubekins-e2e:v20180829-29e661965-master
args:
- "--repo=k8s.io/test-infra=master"
- "--root=/go/src/"
- "--timeout=90"
- --scenario=execute
- --
- make
- --
- -C
- images/kubemci
- push-latest
# docker-in-docker needs privileged mode
securityContext:
privileged: true

periodics:
- interval: 6h
name: ci-kubernetes-multicluster-ingress-test
labels:
preset-service-account: "true"
spec:
containers:
- image: gcr.io/k8s-testimages/kubekins-e2e:v20180829-29e661965-master
args:
- --repo=github.com/GoogleCloudPlatform/k8s-multicluster-ingress=master
- --root=/go/src
- --timeout=50
- --service-account=/etc/service-account/service-account.json
- --upload=gs://kubernetes-jenkins/logs
- --scenario=execute
- --
- make
- --
- -j
- "5"
- test
- coveralls
- vet
- fmt
- lint
volumeMounts:
- name: coveralls
mountPath: /etc/coveralls-token
readOnly: true
volumes:
- name: coveralls
secret:
secretName: k8s-multicluster-ingress-coveralls-token

- interval: 60m
name: ci-kubemci-ingress-conformance
labels:
preset-service-account: "true"
preset-k8s-ssh: "true"
spec:
containers:
- args:
- --timeout=110
- --bare
- --scenario=kubernetes_e2e
- --
- --check-leaked-resources
- --env=GCE_GLBC_IMAGE=gcr.io/k8s-ingress-image-push/ingress-gce-glbc-amd64:master
- --extract=ci/latest
- --gcp-node-image=gci
- --gcp-project-type=ingress-project
- --gcp-zone=us-central1-f
- --provider=gce
- --test_args=--ginkgo.focus=\[Feature:kubemci\] --minStartupPods=8
- --timeout=90m
image: gcr.io/k8s-testimages/e2e-kubemci:latest
imagePullPolicy: Always
2 changes: 2 additions & 0 deletions config/jobs/apache-spark-on-k8s/spark-integration/OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
approvers:
- foxish
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
periodics:
- interval: 2h
name: spark-periodic-default-gke
labels:
preset-service-account: "true"
preset-k8s-ssh: "true"
preset-dind-enabled: "true"
spec:
containers:
- image: gcr.io/k8s-testimages/kubekins-e2e:v20180829-29e661965-master
args:
- "--job=$(JOB_NAME)"
- "--repo=github.com/apache-spark-on-k8s/spark-integration=master"
- "--upload=gs://kubernetes-jenkins/logs/"
- "--timeout=150"
- --scenario=kubernetes_e2e
- --
- --check-leaked-resources
- --cluster=
- --deployment=gke
- --extract=gke
- --gcp-node-image=gci
- --gcp-zone=us-central1-f
- --gke-environment=prod
- --provider=gke
- --test=false
- --test-cmd=../e2e/e2e-prow.sh
- --test-cmd-name=spark-integration
- --timeout=120m
# docker-in-docker needs privileged mode
securityContext:
privileged: true
resources:
requests:
cpu: 6
memory: "8Gi"

- interval: 2h
name: spark-periodic-latest-gke
labels:
preset-service-account: "true"
preset-k8s-ssh: "true"
preset-dind-enabled: "true"
spec:
containers:
- image: gcr.io/k8s-testimages/kubekins-e2e:v20180829-29e661965-master
args:
- "--job=$(JOB_NAME)"
- "--repo=github.com/apache-spark-on-k8s/spark-integration=master"
- "--upload=gs://kubernetes-jenkins/logs/"
- "--timeout=150"
- --scenario=kubernetes_e2e
- --
- --check-leaked-resources
- --cluster=
- --deployment=gke
- --extract=gke-latest
- --gcp-node-image=gci
- --gcp-zone=us-central1-f
- --gke-environment=prod
- --provider=gke
- --test=false
- --test-cmd=../e2e/e2e-prow.sh
- --test-cmd-name=spark-integration
- --timeout=120m
# docker-in-docker needs privileged mode
securityContext:
privileged: true
resources:
requests:
cpu: 6
memory: "8Gi"
4 changes: 4 additions & 0 deletions config/jobs/containerd/cri/OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
approvers:
- yujuhong
- Random-Liu
- dchen1107
Loading

0 comments on commit 06e110b

Please sign in to comment.