Skip to content

Commit

Permalink
Merge pull request openshift#862 from smarterclayton/launch2
Browse files Browse the repository at this point in the history
Enable ci-operator image-registry job
  • Loading branch information
smarterclayton authored May 17, 2018
2 parents 1b6bc94 + 10339e0 commit 0da4061
Show file tree
Hide file tree
Showing 4 changed files with 111 additions and 26 deletions.
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,13 @@ prow-jobs: prow-cluster-jobs
$(MAKE) applyTemplate WHAT=projects/acs-engine/build.yaml
.PHONY: prow-jobs

projects: gcsweb kube-state-metrics oauth-proxy origin-stable origin-release prometheus test-bases image-pruner-setup autoscaler descheduler node-problem-detector publishing-bot cluster-capacity content-mirror
projects: gcsweb kube-state-metrics oauth-proxy origin-stable origin-release prometheus test-bases image-pruner-setup autoscaler descheduler node-problem-detector publishing-bot cluster-capacity content-mirror image-registry
.PHONY: projects

image-registry:
oc create configmap ci-operator-image-registry --from-file=projects/image-registry/config.json -o yaml --dry-run | oc apply -f -
.PHONY: image-registry

cluster-capacity:
$(MAKE) apply WHAT=projects/kubernetes/cluster-capacity.yaml
.PHONY: cluster-capacity
Expand Down
32 changes: 31 additions & 1 deletion cluster/ci/config/prow/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ plank:
default_decoration_config:
timeout: 7200000000000 # 2h
grace_period: 15000000000 # 15s
artifact_dir: /tmp/artifacts
utility_images:
clonerefs: "registry.svc.ci.openshift.org/ci/clonerefs:latest-json"
initupload: "registry.svc.ci.openshift.org/ci/initupload:latest-json"
Expand Down Expand Up @@ -1011,13 +1012,41 @@ presubmits:
context: ci/openshift-jenkins/unit
rerun_command: "/test unit"
trigger: "((?m)^/test( all| unit),?(\\s+|$))"
- name: pull-ci-image-registry-unit
agent: kubernetes
context: ci/prow/unit
branches:
- master
rerun_command: "/test unit"
always_run: false
trigger: "((?m)^/test( unit),?(\\s+|$))"
decorate: true
spec:
serviceAccountName: ci-operator
containers:
- name: test
image: docker-registry.default.svc:5000/ci/ci-operator:latest
env:
- name: CONFIG_SPEC
valueFrom:
configMapKeyRef:
name: ci-operator-image-registry
key: config.json
command:
- ci-operator
args:
- --delete-when-idle=10m
- --artifact-dir=/tmp/artifacts
- --dry-run=false
- --target=unit
- name: pull-ci-image-registry-e2e
agent: kubernetes
context: ci/prow/e2e
branches:
- master
rerun_command: "/test e2e"
trigger: "/test e2e"
always_run: false
trigger: "((?m)^/test( e2e),?(\\s+|$))"
decorate: true
spec:
serviceAccountName: ci-operator
Expand Down Expand Up @@ -1064,6 +1093,7 @@ presubmits:
export RPM_REPO="$( curl -q "${RPM_REPO_BASEURL_REF}" 2>/dev/null)"
ci-operator \
--delete-when-idle=10m --dry-run=false \
--artifact-dir=/tmp/artifacts \
--secret-dir=/usr/local/e2e-gcp-cluster-profile --template=/usr/local/e2e-gcp \
--target=e2e-gcp
Expand Down
57 changes: 33 additions & 24 deletions cluster/ci/config/prow/jobs/cluster-launch-e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,36 +54,17 @@ objects:

containers:

# Runs an install
- name: ansible
image: ${IMAGE_ANSIBLE}
volumeMounts:
- name: shared-tmp
mountPath: /tmp
- name: cluster-profile
mountPath: /usr/share/ansible/openshift-ansible/inventory/dynamic/injected
env:
- name: INSTANCE_PREFIX
value: ${NAMESPACE}-${JOB_NAME_HASH}
command:
- /usr/local/bin/entrypoint-${CLUSTER_TYPE}
args:
- ansible-playbook
- -vv
- -e
- openshift_test_repo=${RPM_REPO}
- -e
- oreg_url=${IMAGE_FORMAT}
- playbooks/${CLUSTER_TYPE}/openshift-cluster/launch.yml

# Once admin.kubeconfig exists, executes shared tests
- name: e2e
- name: test
image: ${IMAGE_TESTS}
volumeMounts:
- name: shared-tmp
mountPath: /tmp/shared
- name: cluster-profile
mountPath: /tmp/cluster
env:
- name: HOME
value: /tmp/home
command:
- /bin/bash
- -c
Expand All @@ -94,6 +75,7 @@ objects:
trap 'touch /tmp/shared/exit' EXIT
trap 'kill $(jobs -p); exit 0' TERM
mkdir -p "${HOME}"
export KUBECONFIG=/tmp/shared/admin.kubeconfig
while true; do
Expand All @@ -113,13 +95,40 @@ objects:
cp /tmp/cluster/ssh-privatekey ~/.ssh/google_compute_engine || true
export PROVIDER_ARGS='-provider=gce -gce-zone=us-east1-c -gce-project=openshift-gce-devel-ci'
fi
mkdir -p /tmp/output
cd /tmp/output
set -x
ginkgo -v -noColor -nodes=40 $( which extended.test ) -- \
-suite "${TEST_SUITE}" -ginkgo.focus="${TEST_FOCUS}" -ginkgo.focus="${TEST_SKIP}" \
-e2e-output-dir /tmp/output -report-dir /tmp/output/junit \
-test.timeout=2h ${PROVIDER_ARGS-}
# Runs an install
- name: setup
image: ${IMAGE_ANSIBLE}
volumeMounts:
- name: shared-tmp
mountPath: /tmp
- name: cluster-profile
mountPath: /usr/share/ansible/openshift-ansible/inventory/dynamic/injected
env:
- name: INSTANCE_PREFIX
value: ${NAMESPACE}-${JOB_NAME_HASH}
command:
- /usr/local/bin/entrypoint-${CLUSTER_TYPE}
args:
- ansible-playbook
- -vv
- -e
- openshift_test_repo=${RPM_REPO}
- -e
- oreg_url=${IMAGE_FORMAT}
- playbooks/${CLUSTER_TYPE}/openshift-cluster/launch.yml

# Performs cleanup of all created resources
- name: cleanup
- name: teardown
image: ${IMAGE_ANSIBLE}
volumeMounts:
- name: shared-tmp
Expand Down
42 changes: 42 additions & 0 deletions projects/image-registry/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"tag_specification": {
"namespace": "openshift",
"name": "origin-v3.10",
"tag": "",
"tag_overrides": {}
},
"base_rpm_images": [
{
"namespace": "openshift",
"name": "origin-v3.10",
"tag": "base",
"as": "base"
}
],
"test_base_image": {
"namespace": "ci",
"name": "release-with-clonerefs",
"tag": "golang-1.9"
},

"binary_build_commands": "make build",
"test_binary_build_commands": "OS_GOFLAGS='-race' make build",
"rpm_build_commands": "make build-rpms",

"images": [
{
"from": "base",
"to": "docker-registry",
"context_dir": "images/dockerregistry/"
}
],

"tests": [
{
"as": "unit",
"from": "test-bin",
"commands": "ARTIFACT_DIR=/tmp/artifacts JUNIT_REPORT=1 hack/test-go.sh",
"artifact_dir": "/tmp/artifacts"
}
]
}

0 comments on commit 0da4061

Please sign in to comment.