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

Backported redistributable logic to Origin specfile #12969

Merged

Conversation

stevekuznetsov
Copy link
Contributor

This back-ports downstream commit 25fa795.

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

Copy link
Member

@tdawson tdawson left a comment

Choose a reason for hiding this comment

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

Thank You Thank You
I was so busy when I found this I didn't have time to backport it.
It seems that when you wrap condition statements in that initial stuff (that this removes) nullifies all the condition statements. The only reason this was working before was because the statement we wanted was always last.

@stevekuznetsov
Copy link
Contributor Author

stevekuznetsov commented Feb 15, 2017

No problem! Lets merge this so the Friday merge is simpler

@openshift-bot
Copy link
Contributor

[Test]ing while waiting on the merge queue

@smarterclayton
Copy link
Contributor

Broke rpm build in gce

@stevekuznetsov
Copy link
Contributor Author

@tdawson do you have cycles to re-evaluate the logic?

00:33:54.787 Building package [v1.5.0-0.alpha.2+414c465.585]
00:33:54.787 Wrote: /tmp/openshift/tito/origin-1.5.0.tar.gz
00:33:54.787 WARNING: Leaving rpmbuild files in: /tmp/openshift/tito/rpmbuild-origin1q1Okf
00:33:54.787 ERROR: Error running command: rpmbuild --define "_source_filedigest_algorithm md5" --define "_binary_filedigest_algorithm md5" --define 'make_redistributable 0'  --eval '%undefine scl' --define "_topdir /tmp/openshift/tito/rpmbuild-origin1q1Okf" --define "_sourcedir /tmp/openshift/tito/rpmbuild-origin1q1Okf/SOURCES" --define "_builddir /tmp/openshift/tito/rpmbuild-origin1q1Okf/BUILD" --define "_srcrpmdir /tmp/openshift/tito" --define "_rpmdir /tmp/openshift/tito" --define "ldflags -X github.com/openshift/origin/pkg/bootstrap/docker.defaultImageStreams=centos7 -X github.com/openshift/origin/pkg/cmd/util/variable.DefaultImagePrefix=openshift/origin -X github.com/openshift/origin/pkg/version.majorFromGit=1 -X github.com/openshift/origin/pkg/version.minorFromGit=5+ -X github.com/openshift/origin/pkg/version.versionFromGit=v1.5.0-0.alpha.2+414c465.585+677fe19 -X github.com/openshift/origin/pkg/version.commitFromGit=677fe19 -X github.com/openshift/origin/pkg/version.buildDate=2017-02-15T16:28:30Z -X github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/version.gitCommit=43a9be4 -X github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/version.gitVersion=v1.5.2+43a9be4 -X github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/version.buildDate=2017-02-15T16:28:30Z -X github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/version.gitTreeState=clean" --define "commit 677fe1970162fea04deaaffc5ac571535636dc53"   --noclean  -ba /tmp/openshift/tito/rpmbuild-origin1q1Okf/SOURCES/origin-1.5.0/origin.spec
00:33:54.787 Status code: 256
00:33:54.787 Command output: 
00:33:54.787 Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.6ln2IV
00:33:54.787 + umask 022
00:33:54.787 + cd /tmp/openshift/tito/rpmbuild-origin1q1Okf/BUILD
00:33:54.787 + cd /tmp/openshift/tito/rpmbuild-origin1q1Okf/BUILD
00:33:54.787 + rm -rf origin-1.5.0
00:33:54.787 + /usr/bin/gzip -dc /tmp/openshift/tito/rpmbuild-origin1q1Okf/SOURCES/origin-1.5.0.tar.gz
00:33:54.787 + /usr/bin/tar -xf -
00:33:54.787 + STATUS=0
00:33:54.787 + '[' 0 -ne 0 ']'
00:33:54.787 + cd origin-1.5.0
00:33:54.787 + /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w .
00:33:54.787 + exit 0
00:33:54.787 Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.U8z2Ug
00:33:54.787 + umask 022
00:33:54.787 + cd /tmp/openshift/tito/rpmbuild-origin1q1Okf/BUILD
00:33:54.787 + cd origin-1.5.0
00:33:54.787 + OS_GIT_VERSION=v1.5.0-alpha.2+414c465-585
00:33:54.787 + OS_GIT_MINOR=5+
00:33:54.787 + OS_GIT_COMMIT=414c465
00:33:54.787 + OS_GIT_MAJOR=1
00:33:54.787 + OS_GIT_TREE_STATE=clean
00:33:54.787 + hack/build-cross.sh
00:33:54.787 ++ Building go targets for linux/amd64: images/pod cmd/dockerregistry cmd/gitserver pkg/sdn/plugin/sdn-cni-plugin vendor/github.com/containernetworking/cni/plugins/ipam/host-local vendor/github.com/containernetworking/cni/plugins/main/loopback examples/hello-openshift examples/deployment
00:33:54.787 ++ Building go targets for linux/amd64: cmd/openshift cmd/oc
00:33:54.787 ++ Building go targets for linux/amd64: test/extended/extended.test
00:33:54.787 ++ Creating openshift-origin-client-tools-v1.5.0-alpha.2-414c465-585-linux-64bit.tar.gz
00:33:54.787 f6d5b461deb8038ce0e083c9cb7f59859caa04c9b4f72149367393e9b252cf14  ./LICENSE
00:33:54.787 436152323bd0bf6bb9c203e3d66d2c013aa6bc4f4bc5d099f92ced58eebe55c9  ./README.md
00:33:54.787 a02e339a3787eb64b5d939f6b90434af87ffc546621687e6ef704247f5d23ddd  ./kubectl
00:33:54.787 f14cb8d3c435ff71206f561a7acd6d32c7dd4509e5ac9aa66481d7c2b7a8ad88  ./kube-scheduler
00:33:54.787 f14cb8d3c435ff71206f561a7acd6d32c7dd4509e5ac9aa66481d7c2b7a8ad88  ./kube-controller-manager
00:33:54.787 f14cb8d3c435ff71206f561a7acd6d32c7dd4509e5ac9aa66481d7c2b7a8ad88  ./kube-apiserver
00:33:54.787 f14cb8d3c435ff71206f561a7acd6d32c7dd4509e5ac9aa66481d7c2b7a8ad88  ./kube-proxy
00:33:54.787 f14cb8d3c435ff71206f561a7acd6d32c7dd4509e5ac9aa66481d7c2b7a8ad88  ./kubelet
00:33:54.787 f14cb8d3c435ff71206f561a7acd6d32c7dd4509e5ac9aa66481d7c2b7a8ad88  ./oadm
00:33:54.787 a02e339a3787eb64b5d939f6b90434af87ffc546621687e6ef704247f5d23ddd  ./oc
00:33:54.787 f14cb8d3c435ff71206f561a7acd6d32c7dd4509e5ac9aa66481d7c2b7a8ad88  ./openshift
00:33:54.787 ++ Creating openshift-origin-server-v1.5.0-alpha.2-414c465-585-linux-64bit.tar.gz
00:33:54.798 f6d5b461deb8038ce0e083c9cb7f59859caa04c9b4f72149367393e9b252cf14  ./LICENSE
00:33:54.798 436152323bd0bf6bb9c203e3d66d2c013aa6bc4f4bc5d099f92ced58eebe55c9  ./README.md
00:33:54.798 a02e339a3787eb64b5d939f6b90434af87ffc546621687e6ef704247f5d23ddd  ./kubectl
00:33:54.798 f14cb8d3c435ff71206f561a7acd6d32c7dd4509e5ac9aa66481d7c2b7a8ad88  ./kube-scheduler
00:33:54.798 f14cb8d3c435ff71206f561a7acd6d32c7dd4509e5ac9aa66481d7c2b7a8ad88  ./kube-controller-manager
00:33:54.798 f14cb8d3c435ff71206f561a7acd6d32c7dd4509e5ac9aa66481d7c2b7a8ad88  ./kube-apiserver
00:33:54.798 f14cb8d3c435ff71206f561a7acd6d32c7dd4509e5ac9aa66481d7c2b7a8ad88  ./kube-proxy
00:33:54.798 f14cb8d3c435ff71206f561a7acd6d32c7dd4509e5ac9aa66481d7c2b7a8ad88  ./kubelet
00:33:54.798 f14cb8d3c435ff71206f561a7acd6d32c7dd4509e5ac9aa66481d7c2b7a8ad88  ./oadm
00:33:54.798 a02e339a3787eb64b5d939f6b90434af87ffc546621687e6ef704247f5d23ddd  ./oc
00:33:54.798 f14cb8d3c435ff71206f561a7acd6d32c7dd4509e5ac9aa66481d7c2b7a8ad88  ./openshift
00:33:54.798 ++ Creating openshift-origin-image-v1.5.0-alpha.2-414c465-585-linux-64bit.tar.gz
00:33:54.798 ec28851d5988ad8fb35d3582c8578b7854590ee8b625d90b9de114d03696b570  ./loopback
00:33:54.798 111ce890248385ec27f4b6697780ca48129bc8ab3d3051f1720c942aba244e4e  ./host-local
00:33:54.798 3981497b2c3d978a04a4b7e205c43a8286fd1eb9ff02794016aaaf707779a79c  ./sdn-cni-plugin
00:33:54.798 9dfd981358c13730ced16ca7c58a269000d63a6e303b271f7caf8e78f8587d7a  ./gitserver
00:33:54.798 3249dbc4acf3f66c25a306cb792a63199a5ba12df8d8d7301329a52ff5c531f8  ./dockerregistry
00:33:54.798 2ea1f60066a98ce52f659963e2a4b6b824761981e694e6ebde2010aa07c33b18  ./pod
00:33:54.798 0c64df19eaa576f5eff1cb1dd2a2c3e27124743d58a3d56b653c1fbb29999933  ./deployment
00:33:54.798 364cc9fb0bc4ce3c72c5182b984edee5f3619a5ac331b7ab7e21bb0f3389f4d3  ./hello-openshift
00:33:54.798 hack/build-cross.sh took 678 seconds
00:33:54.798 + exit 0
00:33:54.798 Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.WLTI94
00:33:54.798 + umask 022
00:33:54.798 + cd /tmp/openshift/tito/rpmbuild-origin1q1Okf/BUILD
00:33:54.798 + '[' /tmp/openshift/tito/rpmbuild-origin1q1Okf/BUILDROOT/origin-1.5.0-0.alpha.2+414c465.585.x86_64 '!=' / ']'
00:33:54.798 + rm -rf /tmp/openshift/tito/rpmbuild-origin1q1Okf/BUILDROOT/origin-1.5.0-0.alpha.2+414c465.585.x86_64
00:33:54.798 ++ dirname /tmp/openshift/tito/rpmbuild-origin1q1Okf/BUILDROOT/origin-1.5.0-0.alpha.2+414c465.585.x86_64
00:33:54.798 + mkdir -p /tmp/openshift/tito/rpmbuild-origin1q1Okf/BUILDROOT
00:33:54.798 + mkdir /tmp/openshift/tito/rpmbuild-origin1q1Okf/BUILDROOT/origin-1.5.0-0.alpha.2+414c465.585.x86_64
00:33:54.798 + cd origin-1.5.0
00:33:54.798 ++ go env GOHOSTOS
00:33:54.798 ++ go env GOHOSTARCH
00:33:54.798 + PLATFORM=linux/amd64
00:33:54.798 + install -d /tmp/openshift/tito/rpmbuild-origin1q1Okf/BUILDROOT/origin-1.5.0-0.alpha.2+414c465.585.x86_64/usr/bin
00:33:54.798 + for bin in oc openshift dockerregistry
00:33:54.798 + echo '+++ INSTALLING oc'
00:33:54.798 +++ INSTALLING oc
00:33:54.808 + install -p -m 755 _output/local/bin/linux/amd64/oc /tmp/openshift/tito/rpmbuild-origin1q1Okf/BUILDROOT/origin-1.5.0-0.alpha.2+414c465.585.x86_64/usr/bin/oc
00:33:54.808 + for bin in oc openshift dockerregistry
00:33:54.808 + echo '+++ INSTALLING openshift'
00:33:54.808 +++ INSTALLING openshift
00:33:54.808 + install -p -m 755 _output/local/bin/linux/amd64/openshift /tmp/openshift/tito/rpmbuild-origin1q1Okf/BUILDROOT/origin-1.5.0-0.alpha.2+414c465.585.x86_64/usr/bin/openshift
00:33:54.808 + for bin in oc openshift dockerregistry
00:33:54.808 + echo '+++ INSTALLING dockerregistry'
00:33:54.808 +++ INSTALLING dockerregistry
00:33:54.808 + install -p -m 755 _output/local/bin/linux/amd64/dockerregistry /tmp/openshift/tito/rpmbuild-origin1q1Okf/BUILDROOT/origin-1.5.0-0.alpha.2+414c465.585.x86_64/usr/bin/dockerregistry
00:33:54.808 + install -d /tmp/openshift/tito/rpmbuild-origin1q1Okf/BUILDROOT/origin-1.5.0-0.alpha.2+414c465.585.x86_64/usr/libexec/origin
00:33:54.808 + install -p -m 755 _output/local/bin/linux/amd64/extended.test /tmp/openshift/tito/rpmbuild-origin1q1Okf/BUILDROOT/origin-1.5.0-0.alpha.2+414c465.585.x86_64/usr/libexec/origin/
00:33:54.808 + install -d /tmp/openshift/tito/rpmbuild-origin1q1Okf/BUILDROOT/origin-1.5.0-0.alpha.2+414c465.585.x86_64/usr/share/origin/linux /tmp/openshift/tito/rpmbuild-origin1q1Okf/BUILDROOT/origin-1.5.0-0.alpha.2+414c465.585.x86_64/usr/share/origin/macosx /tmp/openshift/tito/rpmbuild-origin1q1Okf/BUILDROOT/origin-1.5.0-0.alpha.2+414c465.585.x86_64/usr/share/origin/windows
00:33:54.808 + install -p -m 755 _output/local/bin/linux/amd64/oc /tmp/openshift/tito/rpmbuild-origin1q1Okf/BUILDROOT/origin-1.5.0-0.alpha.2+414c465.585.x86_64/usr/share/origin/linux/oc
00:33:54.808 + install -p -m 755 _output/local/bin/darwin/amd64/oc /tmp/openshift/tito/rpmbuild-origin1q1Okf/BUILDROOT/origin-1.5.0-0.alpha.2+414c465.585.x86_64//usr/share/origin/macosx/oc
00:33:54.808 install: cannot stat '_output/local/bin/darwin/amd64/oc': No such file or directory
00:33:54.808 error: Bad exit status from /var/tmp/rpm-tmp.WLTI94 (%install)
00:33:54.808 RPM build errors:
00:33:54.808     Bad exit status from /var/tmp/rpm-tmp.WLTI94 (%install)

@tdawson
Copy link
Member

tdawson commented Feb 16, 2017

Looking into it. It should have built them all.

@tdawson
Copy link
Member

tdawson commented Feb 16, 2017

OK, I found the problem.
The tests are running "tito build --output="${tito_tmp_dir}" --rpm --no-cleanup --quiet --offline --rpmbuild-options="--define 'make_redistributable ${make_redistributable}"
And this get's rid of the command line optioning. So it passed all my manual tests, but failed these tests.

I'll work on a solution that works for both.

@stevekuznetsov
Copy link
Contributor Author

As long as there is a way to indicate that we only want Linux binaries, we don't necessarily need the --define to work -- if we pass in the target arch instead, that's fine too.

origin.spec Outdated
@@ -40,7 +39,6 @@
%global make_redistributable 0
%endif
%endif
}

Copy link
Member

Choose a reason for hiding this comment

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

The following works in all cases.
Replace line 32-43 with the following

%if 0%{?fedora} || 0%{?epel}
%global need_redistributable_set 0
%else
# Due to library availability, redistributable builds only work on x86_64
%ifarch x86_64
%global need_redistributable_set 1
%else
%global need_redistributable_set 0
%endif
%endif
%{!?make_redistributable: %global	make_redistributable	%{need_redistributable_set}}

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 think that seems reasonable -- if you patch it into OSE I'll pick up the new commit in this PR

@tdawson
Copy link
Member

tdawson commented Feb 17, 2017

Will do

@tdawson
Copy link
Member

tdawson commented Feb 18, 2017

This back-ports downstream commit 25fa795.

Signed-off-by: Steve Kuznetsov <[email protected]>
@stevekuznetsov stevekuznetsov force-pushed the skuznets/specfile-updates branch from 414c465 to ab709c2 Compare February 20, 2017 16:27
@stevekuznetsov
Copy link
Contributor Author

@tdawson updated here

[test]

@openshift-bot
Copy link
Contributor

Evaluated for origin test up to ab709c2

@openshift-bot
Copy link
Contributor

continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pull_requests_origin_future/358/) (Base Commit: e376a9a)

@tdawson
Copy link
Member

tdawson commented Feb 20, 2017

LGTM ... and it passed the tests this time. :)

@stevekuznetsov
Copy link
Contributor Author

[merge]

1 similar comment
@tdawson
Copy link
Member

tdawson commented Feb 20, 2017

[merge]

@stevekuznetsov
Copy link
Contributor Author

@tdawson I think we're frozen on master -- @danmcp confirm?

@danmcp
Copy link

danmcp commented Feb 20, 2017

@stevekuznetsov We are not frozen. We are branching tomorrow morning.

@stevekuznetsov
Copy link
Contributor Author

Oh jeez there was a sneaky merge queue comment at the top ...

@tdawson
Copy link
Member

tdawson commented Feb 20, 2017

gotta love it when there are 24 comments, but the merge bot takes comment #4 to use to tell us it's merging. :)

@openshift-bot
Copy link
Contributor

Evaluated for origin merge up to ab709c2

@openshift-bot
Copy link
Contributor

openshift-bot commented Feb 21, 2017

continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pull_requests_origin_future/358/) (Base Commit: 3ef5377) (Image: devenv-rhel7_5945)

@openshift-bot openshift-bot merged commit 275db41 into openshift:master Feb 21, 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.

5 participants