Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding -o=name to start-build #9967

Merged
merged 1 commit into from
Aug 12, 2016
Merged

Adding -o=name to start-build #9967

merged 1 commit into from
Aug 12, 2016

Conversation

jupierce
Copy link
Contributor

Fixes #8797

  • Adds -o=name to start-build
  • Leverage output method to simplify extended build test

@jupierce
Copy link
Contributor Author

[test]

@@ -302,8 +307,7 @@ func (o *StartBuildOptions) Run() error {
}
}

// TODO: support -o on this command
fmt.Fprintln(o.Out, newBuild.Name)
kcmdutil.PrintSuccess(mapper, shortOutput, o.Out, "build", newBuild.Name, "created")
Copy link
Contributor

Choose a reason for hiding this comment

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

"started" instead of "created" ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point.

@jupierce
Copy link
Contributor Author

[testextended][extended:core(secrets)]

@jupierce
Copy link
Contributor Author

@bparees Looking into this extended test failure as if it weren't a flake, but please let me know if you recognize this.

@jupierce
Copy link
Contributor Author

jupierce commented Jul 21, 2016

@bparees The console output I think key to the failure is:

F0721 14:02:37.189115       1 helpers.go:108] error: build error: non-zero (13) exit code from centos/ruby-22-centos7

if !t.BuildSuccess {
t.DumpLogs()
}
o.Expect(t.BuildSuccess).To(o.BeTrue())
Copy link
Contributor

Choose a reason for hiding this comment

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

throwing gomega errors from utility functions is problematic because the test report output will report this line as the point of failure, instead of the actual area in the test. We tend to try to avoid doing this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should now show exact line. gomega.ExpectWithOffset used.

Copy link
Contributor

Choose a reason for hiding this comment

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

cool.

@bparees
Copy link
Contributor

bparees commented Jul 21, 2016

@jupierce yeah the key error was this:

E0721 14:02:37.059708       1 postexecutorstep.go:315] /bin/sh: /tmp/rm-injections: Permission denied

which is disturbing but not (at least in any way i can see) caused by your changes. hopefully it's related to the docker daemon instability we've been seeing, but let's get a clean extended run before we merge this.

@bparees
Copy link
Contributor

bparees commented Jul 21, 2016

@jupierce please update this PR w/ a before/after example of the start-build output with and without the new flag.

@jupierce
Copy link
Contributor Author

jupierce commented Jul 21, 2016

Before PR:

# oc start-build test 2> /dev/null
test-10

After PR:

# oc start-build test 2> /dev/null
build "test-11" started
# oc start-build -o=name  test 2> /dev/null
build/test-12

start-build will still send out information to stderr (e.g. "Uploading file "test/extended/testdata/build-secrets/Dockerfile" as binary input for the build ..."), so programmatic use of -o=name should only capture stdout. This is what drove the changes in cli.go to capture stdout/stderr independently.

@bparees
Copy link
Contributor

bparees commented Jul 21, 2016

lgtm pending api review and confirming the extended tests are passing (which may be challenging w/ all the other flake issues we currently have, but i really want to keep extended tests stable and not risk piling more problems into them)

@openshift-bot openshift-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 27, 2016
@jupierce
Copy link
Contributor Author

@openshift/api-review

if len(o.FromWebhook) > 0 {
return o.RunStartBuildWebHook()
}
if len(o.ListWebhooks) > 0 {
return o.RunListBuildWebHooks()
}

mapper, _ := f.Object(kcmdutil.GetIncludeThirdPartyAPIs(cmd))
Copy link
Contributor

Choose a reason for hiding this comment

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

why are we including third party APIs here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unnecessary / removed in new commit.

@openshift-bot openshift-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 29, 2016
@bparees
Copy link
Contributor

bparees commented Aug 1, 2016

@liggitt anything else for api approval?

@liggitt
Copy link
Contributor

liggitt commented Aug 1, 2016

cli change looks fine. still seems like there are weird merge commits in the PR

@bparees
Copy link
Contributor

bparees commented Aug 1, 2016

@jupierce lgtm pending commit cleanup

@jupierce
Copy link
Contributor Author

jupierce commented Aug 1, 2016

@bparees Extraneous commit removed.

@bparees
Copy link
Contributor

bparees commented Aug 1, 2016

[merge]

(hope springs eternal)

@openshift-bot
Copy link
Contributor

openshift-bot commented Aug 1, 2016

continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/7829/) (Image: devenv-rhel7_4810)

@stevekuznetsov
Copy link
Contributor

re[test]

1 similar comment
@jupierce
Copy link
Contributor Author

jupierce commented Aug 2, 2016

re[test]

@jupierce
Copy link
Contributor Author

jupierce commented Aug 2, 2016

With flakes cleared now, extended tests found issue in test/cmd/builds.sh . It was reliant on previous output format. Last commit should address.

@openshift-bot openshift-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 2, 2016
@smarterclayton
Copy link
Contributor

Flake on deployments

STEP: deploying a few more times
Aug  2 15:41:50.726: INFO: Running 'oc deploy --namespace=extended-test-cli-deployment-nigh5-v3phy --config=/tmp/openshift/extended-test-cli-deployment-nigh5-v3phy-user.kubeconfig --latest --follow deployment-test'
Aug  2 15:42:10.944: INFO: Error running &{/data/src/github.com/openshift/origin/_output/local/bin/linux/amd64/oc [oc deploy --namespace=extended-test-cli-deployment-nigh5-v3phy --config=/tmp/openshift/extended-test-cli-deployment-nigh5-v3phy-user.kubeconfig --latest --follow deployment-test] []   Started deployment #2
Error from server: The get operation against ReplicationController could not be completed at this time, please try again.
 Started deployment #2
Error from server: The get operation against ReplicationController could not be completed at this time, please try again.
 [] <nil> 0xc8211ede40 exit status 1 <nil> true [0xc820081188 0xc8200811b0 0xc8200811b0] [0xc820081188 0xc8200811b0] [0xc820081190 0xc8200811a8] [0xa83b80 0xa83ce0] 0xc820c01bc0}:
Started deployment #2
Error from server: The get operation against ReplicationController could not be completed at this time, please try again.
Aug  2 15:42:10.956: INFO: DC: &api.DeploymentConfig{TypeMeta:unversioned.TypeMeta{Kind:"", APIVersion:""}, ObjectMeta:api.ObjectMeta{Name:"deployment-test", GenerateName:"", Namespace:"extended-test-cli-deployment-nigh5-v3phy", SelfLink:"/oapi/v1/namespaces/extended-test-cli-deployment-nigh5-v3phy/deploymentconfigs/deployment-test", UID:"17fc9baa-58e9-11e6-8703-0ea09f128a69", ResourceVersion:"6314", Generation:3, CreationTimestamp:unversioned.Time{Time:time.Time{sec:63605763683, nsec:0, loc:(*time.Location)(0x46c0300)}}, DeletionTimestamp:(*unversioned.Time)(nil), DeletionGracePeriodSeconds:(*int64)(nil), Labels:map[string]string(nil), Annotations:map[string]string(nil), OwnerReferences:[]api.OwnerReference(nil), Finalizers:[]string(nil)}, Spec:api.DeploymentConfigSpec{Strategy:api.DeploymentStrategy{Type:"Rolling", RecreateParams:(*api.RecreateDeploymentStrategyParams)(nil), RollingParams:(*api.RollingDeploymentStrategyParams)(0xc8201d9730), CustomParams:(*api.CustomDeploymentStrategyParams)(nil), Resources:api.ResourceRequirements{Limits:api.ResourceList(nil), Requests:api.ResourceList(nil)}, Labels:map[string]string(nil), Annotations:map[string]string(nil)}, MinReadySeconds:0, Triggers:[]api.DeploymentTriggerPolicy{api.DeploymentTriggerPolicy{Type:"ConfigChange", ImageChangeParams:(*api.DeploymentTriggerImageChangeParams)(nil)}}, Replicas:1, RevisionHistoryLimit:(*int32)(nil), Test:true, Paused:false, Selector:map[string]string{"name":"deployment-test"}, Template:(*api.PodTemplateSpec)(0xc820262540)}, Status:api.DeploymentConfigStatus{LatestVersion:2, ObservedGeneration:3, Replicas:0, UpdatedReplicas:0, AvailableReplicas:0, UnavailableReplicas:0, Details:(*api.DeploymentDetails)(0xc8211a3410)}}
Aug  2 15:42:10.956: INFO:   RCs: []api.ReplicationController{api.ReplicationController{TypeMeta:unversioned.TypeMeta{Kind:"", APIVersion:""}, ObjectMeta:api.ObjectMeta{Name:"deployment-test-1", GenerateName:"", Namespace:"extended-test-cli-deployment-nigh5-v3phy", SelfLink:"/api/v1/namespaces/extended-test-cli-deployment-nigh5-v3phy/replicationcontrollers/deployment-test-1", UID:"17ff2dbd-58e9-11e6-8703-0ea09f128a69", ResourceVersion:"6172", Generation:3, CreationTimestamp:unversioned.Time{Time:time.Time{sec:63605763683, nsec:0, loc:(*time.Location)(0x46c0300)}}, DeletionTimestamp:(*unversioned.Time)(nil), DeletionGracePeriodSeconds:(*int64)(nil), Labels:map[string]string{"openshift.io/deployment-config.name":"deployment-test"}, Annotations:map[string]string{"openshift.io/deployment-config.name":"deployment-test", "openshift.io/deployment.phase":"Complete", "openshift.io/deployment.replicas":"0", "openshift.io/deployment.status-reason":"caused by a config change", "openshift.io/encoded-deployment-config":"{\"kind\":\"DeploymentConfig\",\"apiVersion\":\"v1\",\"metadata\":{\"name\":\"deployment-test\",\"namespace\":\"extended-test-cli-deployment-nigh5-v3phy\",\"selfLink\":\"/oapi/v1/namespaces/extended-test-cli-deployment-nigh5-v3phy/deploymentconfigs/deployment-test\",\"uid\":\"17fc9baa-58e9-11e6-8703-0ea09f128a69\",\"resourceVersion\":\"5896\",\"generation\":1,\"creationTimestamp\":\"2016-08-02T19:41:23Z\"},\"spec\":{\"strategy\":{\"type\":\"Rolling\",\"rollingParams\":{\"updatePeriodSeconds\":1,\"intervalSeconds\":1,\"timeoutSeconds\":600,\"maxUnavailable\":\"25%\",\"maxSurge\":\"25%\",\"pre\":{\"failurePolicy\":\"Abort\",\"execNewPod\":{\"command\":[\"/bin/echo\",\"test pre hook executed\"],\"containerName\":\"myapp\"}}},\"resources\":{}},\"triggers\":[{\"type\":\"ConfigChange\"}],\"replicas\":2,\"test\":true,\"selector\":{\"name\":\"deployment-test\"},\"template\":{\"metadata\":{\"creationTimestamp\":null,\"labels\":{\"name\":\"deployment-test\"}},\"spec\":{\"containers\":[{\"name\":\"myapp\",\"image\":\"docker.io/centos:centos7\",\"command\":[\"/bin/sleep\",\"100\"],\"resources\":{},\"terminationMessagePath\":\"/dev/termination-log\",\"imagePullPolicy\":\"IfNotPresent\"}],\"restartPolicy\":\"Always\",\"terminationGracePeriodSeconds\":0,\"dnsPolicy\":\"ClusterFirst\",\"securityContext\":{}}}},\"status\":{\"latestVersion\":1,\"details\":{\"message\":\"caused by a config change\",\"causes\":[{\"type\":\"ConfigChange\"}]}}}\n", "openshift.io/deployer-pod.name":"deployment-test-1-deploy", "openshift.io/deployment-config.latest-version":"1"}, OwnerReferences:[]api.OwnerReference(nil), Finalizers:[]string(nil)}, Spec:api.ReplicationControllerSpec{Replicas:0, Selector:map[string]string{"deployment":"deployment-test-1", "deploymentconfig":"deployment-test", "name":"deployment-test"}, Template:(*api.PodTemplateSpec)(0xc820262700)}, Status:api.ReplicationControllerStatus{Replicas:0, FullyLabeledReplicas:0, ObservedGeneration:3}}, api.ReplicationController{TypeMeta:unversioned.TypeMeta{Kind:"", APIVersion:""}, ObjectMeta:api.ObjectMeta{Name:"deployment-test-2", GenerateName:"", Namespace:"extended-test-cli-deployment-nigh5-v3phy", SelfLink:"/api/v1/namespaces/extended-test-cli-deployment-nigh5-v3phy/replicationcontrollers/deployment-test-2", UID:"285cbefe-58e9-11e6-8703-0ea09f128a69", ResourceVersion:"6319", Generation:1, CreationTimestamp:unversioned.Time{Time:time.Time{sec:63605763710, nsec:0, loc:(*time.Location)(0x46c0300)}}, DeletionTimestamp:(*unversioned.Time)(nil), DeletionGracePeriodSeconds:(*int64)(nil), Labels:map[string]string{"openshift.io/deployment-config.name":"deployment-test"}, Annotations:map[string]string{"openshift.io/deployment.status-reason":"caused by a config change", "openshift.io/encoded-deployment-config":"{\"kind\":\"DeploymentConfig\",\"apiVersion\":\"v1\",\"metadata\":{\"name\":\"deployment-test\",\"namespace\":\"extended-test-cli-deployment-nigh5-v3phy\",\"selfLink\":\"/oapi/v1/namespaces/extended-test-cli-deployment-nigh5-v3phy/deploymentconfigs/deployment-test\",\"uid\":\"17fc9baa-58e9-11e6-8703-0ea09f128a69\",\"resourceVersion\":\"6311\",\"generation\":3,\"creationTimestamp\":\"2016-08-02T19:41:23Z\"},\"spec\":{\"strategy\":{\"type\":\"Rolling\",\"rollingParams\":{\"updatePeriodSeconds\":1,\"intervalSeconds\":1,\"timeoutSeconds\":600,\"maxUnavailable\":\"25%\",\"maxSurge\":\"25%\",\"pre\":{\"failurePolicy\":\"Abort\",\"execNewPod\":{\"command\":[\"/bin/echo\",\"test pre hook executed\"],\"containerName\":\"myapp\"}}},\"resources\":{}},\"triggers\":[{\"type\":\"ConfigChange\"}],\"replicas\":1,\"test\":true,\"selector\":{\"name\":\"deployment-test\"},\"template\":{\"metadata\":{\"creationTimestamp\":null,\"labels\":{\"name\":\"deployment-test\"}},\"spec\":{\"containers\":[{\"name\":\"myapp\",\"image\":\"docker.io/centos:centos7\",\"command\":[\"/bin/sleep\",\"100\"],\"resources\":{},\"terminationMessagePath\":\"/dev/termination-log\",\"imagePullPolicy\":\"IfNotPresent\"}],\"restartPolicy\":\"Always\",\"terminationGracePeriodSeconds\":0,\"dnsPolicy\":\"ClusterFirst\",\"securityContext\":{}}}},\"status\":{\"latestVersion\":2,\"observedGeneration\":2,\"details\":{\"message\":\"caused by a config change\",\"causes\":[{\"type\":\"ConfigChange\"}]}}}\n", "kubectl.kubernetes.io/desired-replicas":"1", "openshift.io/deployer-pod.name":"deployment-test-2-deploy", "openshift.io/deployment-config.latest-version":"2", "openshift.io/deployment-config.name":"deployment-test", "openshift.io/deployment.phase":"Pending", "openshift.io/deployment.replicas":"0"}, OwnerReferences:[]api.OwnerReference(nil), Finalizers:[]string(nil)}, Spec:api.ReplicationControllerSpec{Replicas:0, Selector:map[string]string{"deployment":"deployment-test-2", "deploymentconfig":"deployment-test", "name":"deployment-test"}, Template:(*api.PodTemplateSpec)(0xc820262fc0)}, Status:api.ReplicationControllerStatus{Replicas:0, FullyLabeledReplicas:0, ObservedGeneration:1}}}
Aug  2 15:42:10.957: INFO:   Deployer: deployment-test-2 &api.Pod{TypeMeta:unversioned.TypeMeta{Kind:"", APIVersion:""}, ObjectMeta:api.ObjectMeta{Name:"deployment-test-2-deploy", GenerateName:"", Namespace:"extended-test-cli-deployment-nigh5-v3phy", SelfLink:"/api/v1/namespaces/extended-test-cli-deployment-nigh5-v3phy/pods/deployment-test-2-deploy", UID:"2861ecca-58e9-11e6-8703-0ea09f128a69", ResourceVersion:"6320", Generation:0, CreationTimestamp:unversioned.Time{Time:time.Time{sec:63605763710, nsec:0, loc:(*time.Location)(0x46c0300)}}, DeletionTimestamp:(*unversioned.Time)(nil), DeletionGracePeriodSeconds:(*int64)(nil), Labels:map[string]string{"openshift.io/deployer-pod-for.name":"deployment-test-2"}, Annotations:map[string]string{"openshift.io/deployment.name":"deployment-test-2", "openshift.io/scc":"restricted"}, OwnerReferences:[]api.OwnerReference(nil), Finalizers:[]string(nil)}, Spec:api.PodSpec{Volumes:[]api.Volume{api.Volume{Name:"deployer-token-hkk3b", VolumeSource:api.VolumeSource{HostPath:(*api.HostPathVolumeSource)(nil), EmptyDir:(*api.EmptyDirVolumeSource)(nil), GCEPersistentDisk:(*api.GCEPersistentDiskVolumeSource)(nil), AWSElasticBlockStore:(*api.AWSElasticBlockStoreVolumeSource)(nil), GitRepo:(*api.GitRepoVolumeSource)(nil), Secret:(*api.SecretVolumeSource)(0xc820c77a40), NFS:(*api.NFSVolumeSource)(nil), ISCSI:(*api.ISCSIVolumeSource)(nil), Glusterfs:(*api.GlusterfsVolumeSource)(nil), PersistentVolumeClaim:(*api.PersistentVolumeClaimVolumeSource)(nil), RBD:(*api.RBDVolumeSource)(nil), FlexVolume:(*api.FlexVolumeSource)(nil), Cinder:(*api.CinderVolumeSource)(nil), CephFS:(*api.CephFSVolumeSource)(nil), Flocker:(*api.FlockerVolumeSource)(nil), DownwardAPI:(*api.DownwardAPIVolumeSource)(nil), FC:(*api.FCVolumeSource)(nil), AzureFile:(*api.AzureFileVolumeSource)(nil), ConfigMap:(*api.ConfigMapVolumeSource)(nil), VsphereVolume:(*api.VsphereVirtualDiskVolumeSource)(nil)}}}, InitContainers:[]api.Container(nil), Containers:[]api.Container{api.Container{Name:"deployment", Image:"openshift/origin-deployer:0fa9cfd", Command:[]string(nil), Args:[]string(nil), WorkingDir:"", Ports:[]api.ContainerPort(nil), Env:[]api.EnvVar{api.EnvVar{Name:"KUBERNETES_MASTER", Value:"https://172.18.10.227:8443", ValueFrom:(*api.EnvVarSource)(nil)}, api.EnvVar{Name:"OPENSHIFT_MASTER", Value:"https://172.18.10.227:8443", ValueFrom:(*api.EnvVarSource)(nil)}, api.EnvVar{Name:"BEARER_TOKEN_FILE", Value:"/var/run/secrets/kubernetes.io/serviceaccount/token", ValueFrom:(*api.EnvVarSource)(nil)}, api.EnvVar{Name:"OPENSHIFT_CA_DATA", Value:"-----BEGIN CERTIFICATE-----\nMIIC6jCCAdKgAwIBAgIBATANBgkqhkiG9w0BAQsFADAmMSQwIgYDVQQDDBtvcGVu\nc2hpZnQtc2lnbmVyQDE0NzAxNjY1MDcwHhcNMTYwODAyMTkzNTA3WhcNMjEwODAx\nMTkzNTA4WjAmMSQwIgYDVQQDDBtvcGVuc2hpZnQtc2lnbmVyQDE0NzAxNjY1MDcw\nggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDcp1CpFWAUdjs9I15TFYim\nDP+Dchs6UDV3APWki8q9gHkOL9Y/V7+0PbijwKvavN8CFc3yz+vLl8b2IEpcu05Z\n9PHnCqD0fX1vbhH7WVPagBDfBwq2nTHEer9FT0niCe1K8JanAYZGw8u0ukfvihHN\n18r9aJROTJVxz7IEOMqFIyEQrl7TWLSTtuL4UCc7yyBi4LkCBWiUOnOVvHaantuG\n0TNoawhVNrHmanfaHSDz2lltYbX7rl52FKx+W/LqBWHoND7OUE9wNXGrZx5Msyej\n/s7021mG5/LlpxXtKZZE6pXG8kiKmZqx61JLjz8FPBGYBFgk+blW03cbhWUnXFAd\nAgMBAAGjIzAhMA4GA1UdDwEB/wQEAwICpDAPBgNVHRMBAf8EBTADAQH/MA0GCSqG\nSIb3DQEBCwUAA4IBAQCPnL3YwjGNvdpqa0Is/B2vNZhvDJEK/2N+r1MnzA+FC0by\np4XHTrNnT/RVe209FpjEE758MWSLoLi+mYdOujuyzPAU+6HOAOcakLd3wiB5yP6U\nfVzbILJJGx02klY80k1u6SBIWpRDoahAJ/DAvJCI2USYR/Xf6OujgCBiww2Iujr/\n8hEYLWTBWOSUuoOBh6/O+pJkoGCobjq0XKvkYeByE/6RIm3eEeqm67G/FXvpKaQn\nDq3T5UeBqxZJLRu3exNL8mNez2AzijFxfTvHfOaXa/GQoBL/76IAO44+dA7l8zba\ne7ZpreIvACqqgXCqxRd1xueytbVy6Ip6UuU0m28e\n-----END CERTIFICATE-----\n", ValueFrom:(*api.EnvVarSource)(nil)}, api.EnvVar{Name:"OPENSHIFT_DEPLOYMENT_NAME", Value:"deployment-test-2", ValueFrom:(*api.EnvVarSource)(nil)}, api.EnvVar{Name:"OPENSHIFT_DEPLOYMENT_NAMESPACE", Value:"extended-test-cli-deployment-nigh5-v3phy", ValueFrom:(*api.EnvVarSource)(nil)}}, Resources:api.ResourceRequirements{Limits:api.ResourceList(nil), Requests:api.ResourceList(nil)}, VolumeMounts:[]api.VolumeMount{api.VolumeMount{Name:"deployer-token-hkk3b", ReadOnly:true, MountPath:"/var/run/secrets/kubernetes.io/serviceaccount", SubPath:""}}, LivenessProbe:(*api.Probe)(nil), ReadinessProbe:(*api.Probe)(nil), Lifecycle:(*api.Lifecycle)(nil), TerminationMessagePath:"/dev/termination-log", ImagePullPolicy:"IfNotPresent", SecurityContext:(*api.SecurityContext)(0xc820c77a70), Stdin:false, StdinOnce:false, TTY:false}}, RestartPolicy:"Never", TerminationGracePeriodSeconds:(*int64)(0xc821225480), ActiveDeadlineSeconds:(*int64)(0xc821225488), DNSPolicy:"ClusterFirst", NodeSelector:map[string]string(nil), ServiceAccountName:"deployer", NodeName:"172.18.10.227", SecurityContext:(*api.PodSecurityContext)(0xc8216f3280), ImagePullSecrets:[]api.LocalObjectReference{api.LocalObjectReference{Name:"deployer-dockercfg-03byf"}}, Hostname:"", Subdomain:""}, Status:api.PodStatus{Phase:"Pending", Conditions:[]api.PodCondition{api.PodCondition{Type:"Initialized", Status:"True", LastProbeTime:unversioned.Time{Time:time.Time{sec:0, nsec:0, loc:(*time.Location)(nil)}}, LastTransitionTime:unversioned.Time{Time:time.Time{sec:63605763710, nsec:0, loc:(*time.Location)(0x46c0300)}}, Reason:"", Message:""}, api.PodCondition{Type:"Ready", Status:"False", LastProbeTime:unversioned.Time{Time:time.Time{sec:0, nsec:0, loc:(*time.Location)(nil)}}, LastTransitionTime:unversioned.Time{Time:time.Time{sec:63605763710, nsec:0, loc:(*time.Location)(0x46c0300)}}, Reason:"ContainersNotReady", Message:"containers with unready status: [deployment]"}, api.PodCondition{Type:"PodScheduled", Status:"True", LastProbeTime:unversioned.Time{Time:time.Time{sec:0, nsec:0, loc:(*time.Location)(nil)}}, LastTransitionTime:unversioned.Time{Time:time.Time{sec:63605763710, nsec:0, loc:(*time.Location)(0x46c0300)}}, Reason:"", Message:""}}, Message:"", Reason:"", HostIP:"172.18.10.227", PodIP:"", StartTime:(*unversioned.Time)(0xc820b35500), InitContainerStatuses:[]api.ContainerStatus(nil), ContainerStatuses:[]api.ContainerStatus{api.ContainerStatus{Name:"deployment", State:api.ContainerState{Waiting:(*api.ContainerStateWaiting)(0xc8208e23a0), Running:(*api.ContainerStateRunning)(nil), Terminated:(*api.ContainerStateTerminated)(nil)}, LastTerminationState:api.ContainerState{Waiting:(*api.ContainerStateWaiting)(nil), Running:(*api.ContainerStateRunning)(nil), Terminated:(*api.ContainerStateTerminated)(nil)}, Ready:false, RestartCount:0, Image:"openshift/origin-deployer:0fa9cfd", ImageID:"", ContainerID:""}}}}
Aug  2 15:42:10.957: INFO:   Deployer: deployment-test-2 &api.Pod{TypeMeta:unversioned.TypeMeta{Kind:"", APIVersion:""}, ObjectMeta:api.ObjectMeta{Name:"deployment-test-2-hook-pre", GenerateName:"", Namespace:"extended-test-cli-deployment-nigh5-v3phy", SelfLink:"/api/v1/namespaces/extended-test-cli-deployment-nigh5-v3phy/pods/deployment-test-2-hook-pre", UID:"31c2c918-58e9-11e6-8703-0ea09f128a69", ResourceVersion:"6420", Generation:0, CreationTimestamp:unversioned.Time{Time:time.Time{sec:63605763726, nsec:0, loc:(*time.Location)(0x46c0300)}}, DeletionTimestamp:(*unversioned.Time)(nil), DeletionGracePeriodSeconds:(*int64)(nil), Labels:map[string]string{"openshift.io/deployer-pod-for.name":"deployment-test-2", "openshift.io/deployer-pod.type":"hook-pre"}, Annotations:map[string]string{"openshift.io/deployment.name":"deployment-test-2", "openshift.io/scc":"restricted"}, OwnerReferences:[]api.OwnerReference(nil), Finalizers:[]string(nil)}, Spec:api.PodSpec{Volumes:[]api.Volume{api.Volume{Name:"default-token-1uggo", VolumeSource:api.VolumeSource{HostPath:(*api.HostPathVolumeSource)(nil), EmptyDir:(*api.EmptyDirVolumeSource)(nil), GCEPersistentDisk:(*api.GCEPersistentDiskVolumeSource)(nil), AWSElasticBlockStore:(*api.AWSElasticBlockStoreVolumeSource)(nil), GitRepo:(*api.GitRepoVolumeSource)(nil), Secret:(*api.SecretVolumeSource)(0xc820c77b00), NFS:(*api.NFSVolumeSource)(nil), ISCSI:(*api.ISCSIVolumeSource)(nil), Glusterfs:(*api.GlusterfsVolumeSource)(nil), PersistentVolumeClaim:(*api.PersistentVolumeClaimVolumeSource)(nil), RBD:(*api.RBDVolumeSource)(nil), FlexVolume:(*api.FlexVolumeSource)(nil), Cinder:(*api.CinderVolumeSource)(nil), CephFS:(*api.CephFSVolumeSource)(nil), Flocker:(*api.FlockerVolumeSource)(nil), DownwardAPI:(*api.DownwardAPIVolumeSource)(nil), FC:(*api.FCVolumeSource)(nil), AzureFile:(*api.AzureFileVolumeSource)(nil), ConfigMap:(*api.ConfigMapVolumeSource)(nil), VsphereVolume:(*api.VsphereVirtualDiskVolumeSource)(nil)}}}, InitContainers:[]api.Container(nil), Containers:[]api.Container{api.Container{Name:"lifecycle", Image:"docker.io/centos:centos7", Command:[]string{"/bin/echo", "test pre hook executed"}, Args:[]string(nil), WorkingDir:"", Ports:[]api.ContainerPort(nil), Env:[]api.EnvVar{api.EnvVar{Name:"OPENSHIFT_DEPLOYMENT_NAME", Value:"deployment-test-2", ValueFrom:(*api.EnvVarSource)(nil)}, api.EnvVar{Name:"OPENSHIFT_DEPLOYMENT_NAMESPACE", Value:"extended-test-cli-deployment-nigh5-v3phy", ValueFrom:(*api.EnvVarSource)(nil)}}, Resources:api.ResourceRequirements{Limits:api.ResourceList(nil), Requests:api.ResourceList(nil)}, VolumeMounts:[]api.VolumeMount{api.VolumeMount{Name:"default-token-1uggo", ReadOnly:true, MountPath:"/var/run/secrets/kubernetes.io/serviceaccount", SubPath:""}}, LivenessProbe:(*api.Probe)(nil), ReadinessProbe:(*api.Probe)(nil), Lifecycle:(*api.Lifecycle)(nil), TerminationMessagePath:"/dev/termination-log", ImagePullPolicy:"IfNotPresent", SecurityContext:(*api.SecurityContext)(0xc820c77b30), Stdin:false, StdinOnce:false, TTY:false}}, RestartPolicy:"Never", TerminationGracePeriodSeconds:(*int64)(0xc821225900), ActiveDeadlineSeconds:(*int64)(0xc821225908), DNSPolicy:"ClusterFirst", NodeSelector:map[string]string(nil), ServiceAccountName:"default", NodeName:"172.18.10.227", SecurityContext:(*api.PodSecurityContext)(0xc8216f3380), ImagePullSecrets:[]api.LocalObjectReference{api.LocalObjectReference{Name:"default-dockercfg-wwz06"}}, Hostname:"", Subdomain:""}, Status:api.PodStatus{Phase:"Pending", Conditions:[]api.PodCondition{api.PodCondition{Type:"PodScheduled", Status:"True", LastProbeTime:unversioned.Time{Time:time.Time{sec:0, nsec:0, loc:(*time.Location)(nil)}}, LastTransitionTime:unversioned.Time{Time:time.Time{sec:63605763726, nsec:0, loc:(*time.Location)(0x46c0300)}}, Reason:"", Message:""}}, Message:"", Reason:"", HostIP:"", PodIP:"", StartTime:(*unversioned.Time)(nil), InitContainerStatuses:[]api.ContainerStatus(nil), ContainerStatuses:[]api.ContainerStatus(nil)}}
STEP: Collecting resource usage data
Aug  2 15:42:10.957: INFO: Closed stop channel. Waiting for 1 workers
Aug  2 15:42:10.957: INFO: Closing worker for 172.18.10.227
Aug  2 15:42:10.957: INFO: Waitgroup finished.
Aug  2 15:42:10.957: INFO: Unknown output type: . Skipping.
Aug  2 15:42:10.957: INFO: Waiting up to 1m0s for all nodes to be ready
STEP: Destroying namespace "extended-test-cli-deployment-nigh5-v3phy" for this suite.


• Failure [73.088 seconds]
deploymentconfigs
/data/src/github.com/openshift/origin/test/extended/deployments/deployments.go:629
  with test deployments
  /data/src/github.com/openshift/origin/test/extended/deployments/deployments.go:243
    should run a deployment to completion and then scale to zero [Conformance] [It]
    /data/src/github.com/openshift/origin/test/extended/deployments/deployments.go:242

    Expected error:
        <*exec.ExitError | 0xc8206ebca0>: {
            ProcessState: {
                pid: 13271,
                status: 256,
                rusage: {
                    Utime: {Sec: 0, Usec: 120783},
                    Stime: {Sec: 0, Usec: 18269},
                    Maxrss: 33936,
                    Ixrss: 0,
                    Idrss: 0,
                    Isrss: 0,
                    Minflt: 6804,
                    Majflt: 0,
                    Nswap: 0,
                    Inblock: 0,
                    Oublock: 0,
                    Msgsnd: 0,
                    Msgrcv: 0,
                    Nsignals: 0,
                    Nvcsw: 1947,
                    Nivcsw: 8,
                },
            },
            Stderr: nil,
        }
        exit status 1
    not to have occurred

    /data/src/github.com/openshift/origin/test/extended/deployments/deployments.go:231
------------------------------

@jupierce
Copy link
Contributor Author

jupierce commented Aug 3, 2016

Update to resolve auto-merge conflict.

@openshift-bot openshift-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 3, 2016
@stevekuznetsov
Copy link
Contributor

re[test]

@jupierce
Copy link
Contributor Author

jupierce commented Aug 4, 2016

@bparees All checks passing.

@@ -60,6 +61,7 @@ func TestStartBuildWebHook(t *testing.T) {
Out: buf,
ClientConfig: cfg,
FromWebhook: server.URL + "/webhook",
Mapper: registered.RESTMapper(),
Copy link
Contributor

Choose a reason for hiding this comment

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

why wasn't this needed before/why is it needed now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Before this PR, mapper was not required. It is now with the introduction of:
kcmdutil.PrintSuccess(o.Mapper, o.ShortOutput, o.Out, "build", newBuild.Name, "started")

If, by "before", you mean interim PR commits, it is because startbuild_test.go was not working but that failure was being masked by the other flakes.

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah i just meant before this PR. cool, thanks.

@bparees
Copy link
Contributor

bparees commented Aug 4, 2016

[testexended][extended:core(builds)]

@jupierce
Copy link
Contributor Author

jupierce commented Aug 4, 2016

[testextended][extended:core(builds)]

@stevekuznetsov
Copy link
Contributor

@bparees @jupierce if you're re-triggering the test only, you only need the [testextended] bit, not the other bit

@bparees
Copy link
Contributor

bparees commented Aug 4, 2016

@stevekuznetsov no i was trying to run the extended tests with a different ginkgo filter than what was originally specified. unfortunately I typo'd but it looks like @jupierce caught it.

@bparees
Copy link
Contributor

bparees commented Aug 4, 2016

@jupierce those all look like new extended test failures to me, can you investigate to ensure this PR is not introducing them? (or fix it if it is, obviously)

@openshift-bot openshift-bot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Aug 5, 2016
@jupierce
Copy link
Contributor Author

jupierce commented Aug 8, 2016

@bparees All clear.

exutil.DumpBuildLogs("docker-build", oc)
}
g.By("starting a build")
br, err := exutil.RunBuildConfigAndWait(oc, "docker-build")
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm a little worried about the proliferation of start build patterns we now have:

  1. doing oc.Run("start-build") by hand
  2. exutil.StartBuild
  3. exutil.RunStartBuild (introduced in this PR)
  4. exutil.RunBuildConfigAndWait (introduced in this PR)

i like the introduction of the separation of stderr/stdout, but i'd like to see us collapse the existing patterns and get rid of methods where we can.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If you are ok with the methods introduced in this PR, I will hunt down the last few stragglers.

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't love "RunStartBuild" as a name, if we're going to clean this up, i'd suggest keeping the "StartBuild" function name and repurposing it.

And also change RunStartBuildConfigAndWait to "StartBuildConfigAndWait" i think.

(and should StartBuild become StartBuildAndWait ? are there cases where we don't want to wait? How do both of these methods handle cases where I need to expect failure on the start-build operation?)

Also RunStartBuildConfigAndWait can actually take a build argument, no? so it's not well named.

As I think about this more generally, I'm worried about the encapsulation of all this logic. Test cases are still going to need to:

  1. start a build and not wait (possibly, needed for the serialized build tests I believe)
  2. start a build and expect failure (so asserting success is not always valid).

So keeping this as a separate set of methods (start a build/buildconfig, wait for a build, check success of a build) seems more logical to me.

Copy link
Contributor Author

@jupierce jupierce Aug 9, 2016

Choose a reason for hiding this comment

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

@bparees

i'd suggest keeping the "StartBuild" function name and repurposing it.

Name simplification sounds good.

and should StartBuild become StartBuildAndWait ? are there cases where we don't want to wait?

Yep. There are few extended tests that specifically test parallel builds.

Also RunStartBuildConfigAndWait can actually take a build argument, no? so it's not well named.

Agreed.

  1. start a build and not wait (possibly, needed for the serialized build tests I believe)

My RunStartBuild was meant for this -- advanced tests that can't follow the typical pattern / don't want to pass -o=name / can't wait for the result.

  1. start a build and expect failure (so asserting success is not always valid).

There is a AssertFailure() as well.
https://github.com/jupierce/origin/blob/b9a0173257e99f1767981934793fbc27ba8a1d70/test/extended/builds/docker_quota.go#L42

Copy link
Contributor

Choose a reason for hiding this comment

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

There is a AssertFailure() as well.

right, but i can't use that with RunStartBuildConfigAndWait because today that function demands success, it doesn't let me evaluate the outcome, it does it for me.

Copy link
Contributor

Choose a reason for hiding this comment

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

discussed on irc, i didn't follow the runstartbuildconfigandwait logic correctly

@jupierce jupierce closed this Aug 9, 2016
@jupierce jupierce reopened this Aug 9, 2016
@jupierce
Copy link
Contributor Author

@bparees I believe everything is using StartBuild and StartBuildAndWait now.

fmt.Fprintf(g.GinkgoWriter, "\nstart-build output:\n%s\n", out)
o.Expect(err).To(o.HaveOccurred())
g.By("starting the source build with --wait flag and short timeout")
br, err := exutil.StartBuildAndWait(oc, "source-build", "--wait")
Copy link
Contributor

Choose a reason for hiding this comment

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

doesn't actually need the --wait flag anymore right, since you're handling waiting within the method.

Copy link
Contributor

@bparees bparees Aug 11, 2016

Choose a reason for hiding this comment

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

same comment elsewhere. we should only use the --wait flag if we're explicitly testing --wait behavior somewhere.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I believe that is true of the example you highlight. It tests whether the error affects the return code of "oc start-buid" when --wait is in use. Searching back through, I found a --wait that was redundant to --follow and a .By(...) string that mentioned --wait, but no longer used it.
Both are now removed, but let me know if you disagree on the presence of others.

Copy link
Contributor

Choose a reason for hiding this comment

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

i think it was just using --wait to avoid having to manually check if the build was complete and then check the status. the TC is for testing whether builds get terminated by deadlines, not whether the failure code is properly returned by start-build or not. but we can leave it as is for extra coverage.

@openshift-bot
Copy link
Contributor

Evaluated for origin testextended up to cb5824a

@openshift-bot
Copy link
Contributor

Evaluated for origin test up to cb5824a

@bparees
Copy link
Contributor

bparees commented Aug 11, 2016

lgtm, will wait for a final extended test pass

@openshift-bot
Copy link
Contributor

continuous-integration/openshift-jenkins/testextended SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin_extended/425/) (Extended Tests: core(builds), core(secrets))

@bparees
Copy link
Contributor

bparees commented Aug 12, 2016

[merge]

@openshift-bot
Copy link
Contributor

Evaluated for origin merge up to cb5824a

@openshift-bot
Copy link
Contributor

continuous-integration/openshift-jenkins/test FAILURE (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/7824/)

@openshift-bot openshift-bot merged commit 569fe30 into openshift:master Aug 12, 2016
@@ -53,22 +52,11 @@ var _ = g.Describe("[builds][Slow] s2i extended build", func() {
})

g.By("running the build")
out, err := oc.Run("start-build").Args("--build-loglevel=5", buildConfigName).Output()
br, _ := exutil.StartBuildAndWait(oc, buildConfigName, "--build-loglevel=5")
Copy link
Contributor

@php-coder php-coder Aug 17, 2016

Choose a reason for hiding this comment

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

@jupierce Why we're ignoring error from StartBuildAndWait() here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@php-coder I considered it redundant to the AssertSuccess() which follows the line. i.e. if there were a severe error resulting in an err being returned, AssertSuccess would also fail. As part of AssertSuccess, a significant amount of information about the attempted build is output to the Ginkgolog, so we should have everything we need to diagnose.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants