Skip to content

Verify the rollout status of the hosted router and registry - #4402

Merged
openshift-bot merged 2 commits into
openshift:masterfrom
stevekuznetsov:skuznets/router-registry-rollout
Jun 15, 2017
Merged

openshift-bot merged 2 commits into
openshift:masterfrom
stevekuznetsov:skuznets/router-registry-rollout

Conversation

@stevekuznetsov

Copy link
Copy Markdown
Contributor

When deploying the hosted router and registry components, we need to
ensure that they correctly roll out. The previous checks were weak in
that they either simply waited for a set amount of time and/or did one
replica check. They would fail if the router or registry took longer to
deploy or if there were un-ready or failing replicas. The oc rollout
command group contains the status endpoint for internalizing all of
the logic for determining when a rollout has succeeded or failed, so
simply using this client call will ensure that the router and registry
correctly deploy.

Signed-off-by: Steve Kuznetsov [email protected]

[test]
aos-ci-test

/cc @sdodson

@sdodson

sdodson commented Jun 9, 2017

Copy link
Copy Markdown
Member

oc rollout status does what when it hasn't completed? And it's supported in which OCP versions?

@stevekuznetsov

Copy link
Copy Markdown
Contributor Author

oc rollout status does what when it hasn't completed?

Waits, determines if it's progressing or not. When it fails to progress and fails, the client call fails.

And it's supported in which OCP versions?

3.5 and 3.6 for sure

@stevekuznetsov

Copy link
Copy Markdown
Contributor Author

More specifically, 1.4+

$ tags=()
$ for commit in $( git log --pretty=%H -- contrib/completions/bash/oc ); do if git grep -q _oc_rollout_status "${commit}"; then tags+=( $( git tag --contains "${commit}" ) ); fi; done
$ echo "${tags[@]}" | sort | uniq
v1.4.0
v1.4.0-alpha.1
v1.4.0-rc1
v1.4.1
v1.5.0
v1.5.0-alpha.0
v1.5.0-alpha.1
v1.5.0-alpha.2
v1.5.0-alpha.3
v1.5.0-rc.0
v1.5.1
v3.6.0-alpha.0
v3.6.0-alpha.1
v3.6.0-alpha.2

When deploying the hosted router and registry components, we need to
ensure that they correctly roll out. The previous checks were weak in
that they either simply waited for a set amount of time and/or did one
replica check. They would fail if the router or registry took longer to
deploy or if there were un-ready or failing replicas. The `oc rollout`
command group contains the `status` endpoint for internalizing all of
the logic for determining when a rollout has succeeded or failed, so
simply using this client call will ensure that the router and registry
correctly deploy.

Signed-off-by: Steve Kuznetsov <[email protected]>
@stevekuznetsov
stevekuznetsov force-pushed the skuznets/router-registry-rollout branch from 7608d60 to 9ba4195 Compare June 9, 2017 16:21
@stevekuznetsov

Copy link
Copy Markdown
Contributor Author

Have your newlines, tox

@sdodson can we get aos-ci on this and I think it's ready

@stevekuznetsov

Copy link
Copy Markdown
Contributor Author

TASK [openshift_hosted : Ensure OpenShift router correctly rolls out] **********
task path: /usr/share/ansible/openshift-ansible/roles/openshift_hosted/tasks/router/router.yml:93
changed: [localhost] => (item={u'name': u'router', u'certificate': {u'keyfile': u'/etc/origin/master/openshift-router.key', u'certfile': u'/etc/origin/master/openshift-router.crt', u'cafile': u'/etc/origin/master/ca.crt'}, u'replicas': u'1', u'serviceaccount': u'router', u'namespace': u'default', u'stats_port': 1936, u'edits': [{u'action': u'put', u'value': 1, u'key': u'spec.strategy.rollingParams.intervalSeconds'}, {u'action': u'put', u'value': 1, u'key': u'spec.strategy.rollingParams.updatePeriodSeconds'}, {u'action': u'put', u'value': 21600, u'key': u'spec.strategy.activeDeadlineSeconds'}], u'images': u'openshift/origin-${component}:cc2ed8f', u'selector': u'region=infra', u'ports': [u'80:80', u'443:443']}) => {
    "rc": 0, 
    "stderr": [], 
    "stdout": [
        "Waiting for rollout to finish: 0 out of 1 new replicas have been updated...", 
        "Waiting for rollout to finish: 0 out of 1 new replicas have been updated...", 
        "Waiting for rollout to finish: 0 of 1 updated replicas are available...", 
        "Waiting for latest deployment config spec to be observed by the controller loop...", 
        "replication controller \"router-1\" successfully rolled out"
    ]
}

@stevekuznetsov

Copy link
Copy Markdown
Contributor Author

jUnit reports:

@sdodson

sdodson commented Jun 9, 2017

Copy link
Copy Markdown
Member

I'd expect up to a minute or more in environments that actually require images to be pulled. Especially for whichever is deployed first as pod, deployer, and the actual image need to be pulled.

@sdodson

sdodson commented Jun 9, 2017

Copy link
Copy Markdown
Member

aos-ci-test

@stevekuznetsov

Copy link
Copy Markdown
Contributor Author

I'd expect up to a minute or more in environments that actually require images to be pulled. Especially for whichever is deployed first as pod, deployer, and the actual image need to be pulled.

I would too -- but the cluster isn't valid if this doesn't happen, so it's kind of a moot point. I am more worried that it would have made CI significantly slower.

@stevekuznetsov

Copy link
Copy Markdown
Contributor Author

Job only failed on checking other job statuses

@sdodson

sdodson commented Jun 9, 2017

Copy link
Copy Markdown
Member

[merge]

@stevekuznetsov

Copy link
Copy Markdown
Contributor Author

AOS CI decided not to work? WTF?

@stevekuznetsov

Copy link
Copy Markdown
Contributor Author

aos-ci-test

@openshift-bot

Copy link
Copy Markdown

error: aos-ci-jenkins/OS_3.6_NOT_containerized for 9ba4195 (logs)

@openshift-bot

Copy link
Copy Markdown

error: aos-ci-jenkins/OS_3.5_containerized for 9ba4195 (logs)

@openshift-bot

Copy link
Copy Markdown

error: aos-ci-jenkins/OS_3.5_NOT_containerized for 9ba4195 (logs)

@openshift-bot

Copy link
Copy Markdown

error: aos-ci-jenkins/OS_3.6_containerized for 9ba4195 (logs)

@stevekuznetsov

Copy link
Copy Markdown
Contributor Author

@sdodson looks like it's throwing a fit... no logs? Can we re-test?

@sdodson

sdodson commented Jun 12, 2017

Copy link
Copy Markdown
Member

aos-ci-test

@0xmichalis

Copy link
Copy Markdown
Contributor

I wouldn't use rollout status in a script/Ansible playbook before kubernetes/kubernetes#40224 is fixed. @mfojtik was working at it but I am not sure of his status on it.

@stevekuznetsov

Copy link
Copy Markdown
Contributor Author

@Kargakis do we see that often? I've switched the Origin Aggregated Logging tests to use oc rollout status to verify their deployments, and that job has more than 100 builds without anyone observing that issue.

@stevekuznetsov

Copy link
Copy Markdown
Contributor Author

Or are you more concerned about customer environments rather than CI flake

@0xmichalis

Copy link
Copy Markdown
Contributor

Or are you more concerned about customer environments rather than CI flake

Exactly. kubernetes/kubernetes#40224 needs to be fixed for rollout status prime time.

@stevekuznetsov

Copy link
Copy Markdown
Contributor Author

Hmmm -- can we add failed_when: no to this to make it best-effort? It will block until it either correctly determines that the rollout succeeded or fails on some bug (but we won't care).

In the interim do we have a better solution for verifying the rollout status? This hit some other people as well where it was as bad as the router image being missing and the installer reported 100% happy.

Should we just do the oc rollout status call, ignore the output, and the check the .spec.replicas versus the .status as a sanity check?

@0xmichalis

Copy link
Copy Markdown
Contributor

failed_when: no followed by another task that verifies the status of the RC (check that openshift.io/deployment.phase == Complete).

@stevekuznetsov

Copy link
Copy Markdown
Contributor Author

@Kargakis why RC, not DC?

until: "'Running' not in openshift_hosted_registry_rc_phase.stdout"
delay: 15
reties: 40
failed_when: "'Failed' in openshift_hosted_registry_rc_phase.stdout"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you figure out if this fails early or does it hit max retries?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't fail early, unfortunately. No way to do that it seems

oc rollout status deploymentconfig {{ openshift_hosted_registry_name }} \
--namespace {{ openshift_hosted_registry_namespace }} \
--config {{ openshift.common.config_base }}/master/admin.kubeconfig
failed_when: no

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we tend to gravitate towards false

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ack

@stevekuznetsov

Copy link
Copy Markdown
Contributor Author

@sdodson updated PTAL

@openshift openshift deleted a comment from openshift-bot Jun 12, 2017
@stevekuznetsov
stevekuznetsov force-pushed the skuznets/router-registry-rollout branch 2 times, most recently from c38e128 to bb2a75b Compare June 13, 2017 14:00
@stevekuznetsov

Copy link
Copy Markdown
Contributor Author

aos-ci-test

@stevekuznetsov

Copy link
Copy Markdown
Contributor Author

PLEASE

@openshift openshift deleted a comment from openshift-bot Jun 13, 2017
We cannot rely on the `watch.Until` call in the `rollout status`
subcommand for the time being, so we need to ignore the result of this
call. This will make the rollout status check best-effort, so we need to
follow it with a poll for the actual status of the rollout, which we can
extract from the `openshift.io/deployment.phase` annotation on the
ReplicationControllers. This annotation can have only three values --
`Running`, `Complete` and `Failed`. If we poll on this attribute until
we stop seeing `Running`, we can then inspect the last result for
`Failed`; if it's present, we have failed the deployment.

Signed-off-by: Steve Kuznetsov <[email protected]>
@stevekuznetsov
stevekuznetsov force-pushed the skuznets/router-registry-rollout branch from bb2a75b to acb7831 Compare June 13, 2017 18:50
@openshift-bot

Copy link
Copy Markdown

error: "aos-ci-jenkins/OS_3.5_NOT_containerized, aos-ci-jenkins/OS_3.5_NOT_containerized_e2e_tests" for bb2a75b (logs)

@openshift-bot

Copy link
Copy Markdown

error: aos-ci-jenkins/OS_3.6_NOT_containerized for bb2a75b (logs)

@openshift-bot

Copy link
Copy Markdown

error: aos-ci-jenkins/OS_3.6_containerized for bb2a75b (logs)

@openshift-bot

Copy link
Copy Markdown

error: aos-ci-jenkins/OS_3.5_containerized for bb2a75b (logs)

@openshift-bot

Copy link
Copy Markdown

Evaluated for openshift ansible test up to acb7831

@openshift-bot

Copy link
Copy Markdown

@sdodson

sdodson commented Jun 14, 2017

Copy link
Copy Markdown
Member

aos-ci-test

@openshift-bot

Copy link
Copy Markdown

success: "aos-ci-jenkins/OS_3.5_NOT_containerized, aos-ci-jenkins/OS_3.5_NOT_containerized_e2e_tests" for acb7831 (logs)

@sdodson

sdodson commented Jun 14, 2017

Copy link
Copy Markdown
Member

[merge]

@openshift-bot

Copy link
Copy Markdown

success: "aos-ci-jenkins/OS_3.5_containerized, aos-ci-jenkins/OS_3.5_containerized_e2e_tests" for acb7831 (logs)

@openshift-bot

Copy link
Copy Markdown

success: "aos-ci-jenkins/OS_3.6_NOT_containerized, aos-ci-jenkins/OS_3.6_NOT_containerized_e2e_tests" for acb7831 (logs)

@openshift-bot

Copy link
Copy Markdown

success: "aos-ci-jenkins/OS_3.6_containerized, aos-ci-jenkins/OS_3.6_containerized_e2e_tests" for acb7831 (logs)

@sdodson

sdodson commented Jun 14, 2017

Copy link
Copy Markdown
Member

[merge]

@stevekuznetsov

Copy link
Copy Markdown
Contributor Author

@openshift-bot, the last build failed from the following flakes:

  • tox failed on timeouts:
--- FAIL: TestPackageUpdateRepoDisabled (3.11s)
	common.go:80: got exit code 2, want 0
	common.go:98: 
		$ (cd /data/src/github.com/openshift/openshift-ansible/test/integration/openshift_health_checker/preflight && ansible-playbook -i /dev/null playbooks/package_update_repo_disabled.yml)
		...
		PLAY RECAP *********************************************************************
		localhost                  : ok=1    changed=0    unreachable=0    failed=1   
		
		
		Failure summary:
		
		  1. Host:     localhost
		     Play:     Start container for specified test host
		     Task:     start container
		     Message:  Error connecting: Error while fetching server API version: Timeout value connect was Timeout(connect=60, read=60, total=None), but it must be an int, float or None.

@stevekuznetsov

Copy link
Copy Markdown
Contributor Author

@sdodson can you re-tag for merge please

@sdodson

sdodson commented Jun 15, 2017

Copy link
Copy Markdown
Member

[merge][severity: bug]

@openshift-bot

Copy link
Copy Markdown

Evaluated for openshift ansible merge up to acb7831

@openshift-bot

openshift-bot commented Jun 15, 2017 •

Copy link
Copy Markdown

continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/merge_pull_request_openshift_ansible/574/) (Base Commit: 7608068) (PR Branch Commit: acb7831) (Extended Tests: bug)

@openshift-bot
openshift-bot merged commit dfb6830 into openshift:master Jun 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants