Skip to content

have origin.spec use hack scripts to build#10398

Merged
openshift-bot merged 1 commit intoopenshift:masterfrom
tdawson:2016-08-spec-use-hack
Aug 18, 2016
Merged

have origin.spec use hack scripts to build#10398
openshift-bot merged 1 commit intoopenshift:masterfrom
tdawson:2016-08-spec-use-hack

Conversation

@tdawson
Copy link
Copy Markdown
Member

@tdawson tdawson commented Aug 12, 2016

Use the hack scripts to build the binaries for the origin rpm

@liggitt
Copy link
Copy Markdown
Contributor

liggitt commented Aug 12, 2016

Can you verify the Linux oc built by this shows GSSAPI in oc version?

# builder
cmd = '. ./hack/common.sh ; echo $(os::build::ldflags)'

## Fixup os_git_vars
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We have os::build::os_version_vars in hack/common.sh -- is it possible to reuse that logic?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The big difference is that os::build::ldflags echo's everything out in one line. os::build::os_version_vars just set's variables. But I'll give it a try.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You could also write a wrapper:

function os::build::emit_os_version_vars() {
    os::build::os_version_vars
    echo "OS_GIT_COMMIT=${OS_GIT_COMMIT}...."
}

Either way, I think it's worthwhile to keep the logic in one place so it can't drift. I found a bug in the logic this week, if there ends up a bug fix I'd rather it propagate correctly.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I totally agree with you, in keeping the logic in one place.
I wish the tito scripts were in bash so I could write a wrapper function. What I have below isn't pretty, but it get's the job done.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sorry, I meant if you write a Bash wrapper in hack/common.sh and call it the same way you're calling os::build::ldflags.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Well, actually not the same way. You don't need to do echo $(funcname), you can simply do funcname. But that's a nitpick

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I now understand what you are saying, but I'd like to keep the logic where it is for this pull request.

I have some ideas for building srpm's, #7268 and I'd like to defer this cleanup until then.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sure thing. Your logic is distinct from the logic used in os::build::os_version_vars but I assume it's compatible for now.

@tdawson
Copy link
Copy Markdown
Member Author

tdawson commented Aug 13, 2016

@liggitt Yep, looks like it does

$ _output/local/bin/linux/amd64/oc version
oc v1.3.0-alpha.3+ea4d441-dirty
kubernetes v1.3.0+507d3a7
features: Basic-Auth GSSAPI Kerberos SPNEGO

@tdawson
Copy link
Copy Markdown
Member Author

tdawson commented Aug 13, 2016

[test]

Have tito update os_git_vars in origin.spec

Set pkgdir the same as go_pkg_dir

Use hack/build-cross.sh to build rpm binaries

Install binaries from new build locations

Add OS_GIT_VERSION to os_git_vars

Fix ldflag generation by exporting OS_ROOT manually

Do not export OS_ROOT

Create extended test with scripts

Remove ldflags since they are no longer needed

Set OS_ROOT each time we use os::build::ldflags

Use hack/common.h to set os_git_vars
@tdawson tdawson force-pushed the 2016-08-spec-use-hack branch from 0edc325 to 7a3a9d6 Compare August 15, 2016 21:01
@openshift-bot
Copy link
Copy Markdown
Contributor

Evaluated for origin test up to 7a3a9d6

@openshift-bot
Copy link
Copy Markdown
Contributor

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

@tdawson
Copy link
Copy Markdown
Member Author

tdawson commented Aug 17, 2016

[test]

@openshift-bot
Copy link
Copy Markdown
Contributor

The Origin test job could not be run again for this pull request.

  • If the proposed changes in this pull request caused the job to fail, update this pull request with new code to fix the issue(s).
  • If flaky tests caused the job to fail, leave a comment with links to the GitHub issue(s) in the openshift/origin repository with the kind/test-flake label that are tracking the flakes. If no issue already exists for the flake you encountered, create one.
  • If something else like CI system downtime or maintenance caused the job to fail, contact a member of the Team Project Committers group to trigger the job again.

@tdawson
Copy link
Copy Markdown
Member Author

tdawson commented Aug 18, 2016

It looks like the tests failing were a false falure. Can we get a merge on this.

@stevekuznetsov
Copy link
Copy Markdown
Contributor

@tdawson if we want green tests, just link to the conformance flake that you had and you can re-test. That being said, are there any tests in our CI right now that would prove correctness for what you've done? I don't think so. If not, there's no point in testing again and I'll merge it

@sdodson
Copy link
Copy Markdown
Member

sdodson commented Aug 18, 2016

There's hack/test-rpm.sh but I don't believe it's wired in anywhere and likely is out of date.

@stevekuznetsov
Copy link
Copy Markdown
Contributor

There's even a Vagrant command wired up for it but I don't think we ever call it. @tdawson can you open an issue to track the migration of the logic from in here to Bash? [merge]

@openshift-bot
Copy link
Copy Markdown
Contributor

openshift-bot commented Aug 18, 2016

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

@openshift-bot
Copy link
Copy Markdown
Contributor

Evaluated for origin merge up to 7a3a9d6

@tdawson
Copy link
Copy Markdown
Member Author

tdawson commented Aug 18, 2016

I ran the the hack/test-rpm.sh on this pull request.
rpm built fine.
rpmlint failed with 37 errors, 66 warnings.
All of the errors were false positives. Most of the errors are because we have non-standard permissions on things, and the usual errors that go binaries show in rpmlint.
Majority of the warning were because we didn't have man pages for all our binaries. Next highest were more go binary related. And then a smattering of others.

None of the errors or warning had anything that this pull request would have affected.

I think the reason this wasn't incorporated into the tests was due to the amount of cleanup the rpmlint is going to take.

@openshift-bot openshift-bot merged commit 153ad7c into openshift:master Aug 18, 2016
@stevekuznetsov
Copy link
Copy Markdown
Contributor

we didn't have man pages for all our binaries.

Which are missing? We are trying to generate all of the man pages for the CLI from our normal helptext.

@tdawson
Copy link
Copy Markdown
Member Author

tdawson commented Aug 18, 2016

We are currently only creating man pages for the main binaries, oadm, oc, and openshift

We don't create any for
atomic-enterprise
dockerregistry
kube-apiserver
kube-controller-manager
kubectl
kubelet
kube-proxy
kubernetes
kube-scheduler
openshift-deploy
openshift-docker-build
openshift-f5-router
openshift-recycle
openshift-router
openshift-sdn-docker-setup.sh
openshift-sdn-ovs
openshift-sti-build
origin
pod

Most of those are just links to openshift, but rpmlint doesn't know that, and some of them act differently depending on how they are called.

@stevekuznetsov
Copy link
Copy Markdown
Contributor

Should be fairly simple to add pages for the links, just change the base name of them. Similarly we could import the kube ones if it's more important than getting fewer nags from rpmlint

@smarterclayton
Copy link
Copy Markdown
Contributor

The -pkgdir statement is wrong - on some platforms it generates content into the user's git repo. I'll open a follow up, but I'll need you @tdawson to review the changes for spec.

eval "platform_goflags=(${!platform_goflags_envvar:-})"

GOOS=${platform%/*} GOARCH=${platform##*/} go install \
-pkgdir ${GOPATH}/src/${OS_GO_PACKAGE} \
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@tdawson @smarterclayton @stevekuznetsov FYI this line makes it so the go stdlib as well as all the origin & vendored code have their .a files placed in the root of the origin dir, so you get bufio.a, bytes.a, ...

@damemi in case you were wondering why this was happening

Copy link
Copy Markdown
Member Author

@tdawson tdawson Aug 19, 2016

Choose a reason for hiding this comment

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

@ncdc Correct. And if we don't have that there, then everything built tries to be put in the go global area (/usr/lib/golang/pkg/linux_386/). This works if you are a privileged user, but doesn't if you are not.
#10027 (comment)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yeah, that's a problem for non-release builds (putting all the junk into pwd). I think it would be better to only set -pkgdir for release builds.

@smarterclayton
Copy link
Copy Markdown
Contributor

Opened #10533 to track -pkgdir not being the root

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.

7 participants