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

MESOS: Support a pre-installed km binary at a well known, agent-local path #28447

Merged
merged 1 commit into from
Jul 7, 2016

Conversation

k82cn
Copy link
Member

@k82cn k82cn commented Jul 4, 2016

fixes #26930

@k8s-bot
Copy link

k8s-bot commented Jul 4, 2016

Can one of the admins verify that this patch is reasonable to test? If so, please reply "ok to test".
(Note: "add to whitelist" is no longer supported. Please update configurations in kubernetes/test-infra/jenkins/job-configs/kubernetes-jenkins-pull instead.)

This message may repeat a few times in short succession due to jenkinsci/ghprb-plugin#292. Sorry.

Otherwise, if this message is too spammy, please complain to ixdy.

4 similar comments
@k8s-bot
Copy link

k8s-bot commented Jul 4, 2016

Can one of the admins verify that this patch is reasonable to test? If so, please reply "ok to test".
(Note: "add to whitelist" is no longer supported. Please update configurations in kubernetes/test-infra/jenkins/job-configs/kubernetes-jenkins-pull instead.)

This message may repeat a few times in short succession due to jenkinsci/ghprb-plugin#292. Sorry.

Otherwise, if this message is too spammy, please complain to ixdy.

@k8s-bot
Copy link

k8s-bot commented Jul 4, 2016

Can one of the admins verify that this patch is reasonable to test? If so, please reply "ok to test".
(Note: "add to whitelist" is no longer supported. Please update configurations in kubernetes/test-infra/jenkins/job-configs/kubernetes-jenkins-pull instead.)

This message may repeat a few times in short succession due to jenkinsci/ghprb-plugin#292. Sorry.

Otherwise, if this message is too spammy, please complain to ixdy.

@k8s-bot
Copy link

k8s-bot commented Jul 4, 2016

Can one of the admins verify that this patch is reasonable to test? If so, please reply "ok to test".
(Note: "add to whitelist" is no longer supported. Please update configurations in kubernetes/test-infra/jenkins/job-configs/kubernetes-jenkins-pull instead.)

This message may repeat a few times in short succession due to jenkinsci/ghprb-plugin#292. Sorry.

Otherwise, if this message is too spammy, please complain to ixdy.

@k8s-bot
Copy link

k8s-bot commented Jul 4, 2016

Can one of the admins verify that this patch is reasonable to test? If so, please reply "ok to test".
(Note: "add to whitelist" is no longer supported. Please update configurations in kubernetes/test-infra/jenkins/job-configs/kubernetes-jenkins-pull instead.)

This message may repeat a few times in short succession due to jenkinsci/ghprb-plugin#292. Sorry.

Otherwise, if this message is too spammy, please complain to ixdy.

@k8s-github-robot k8s-github-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. release-note-label-needed labels Jul 4, 2016
@k82cn k82cn closed this Jul 4, 2016
@k82cn k82cn force-pushed the k8s-26930-km-local-path branch from 392b427 to 40b8fb4 Compare July 4, 2016 13:06
@k82cn k82cn reopened this Jul 4, 2016
@k8s-bot
Copy link

k8s-bot commented Jul 4, 2016

Can one of the admins verify that this patch is reasonable to test? If so, please reply "ok to test".
(Note: "add to whitelist" is no longer supported. Please update configurations in kubernetes/test-infra/jenkins/job-configs/kubernetes-jenkins-pull instead.)

This message may repeat a few times in short succession due to jenkinsci/ghprb-plugin#292. Sorry.

Otherwise, if this message is too spammy, please complain to ixdy.

4 similar comments
@k8s-bot
Copy link

k8s-bot commented Jul 4, 2016

Can one of the admins verify that this patch is reasonable to test? If so, please reply "ok to test".
(Note: "add to whitelist" is no longer supported. Please update configurations in kubernetes/test-infra/jenkins/job-configs/kubernetes-jenkins-pull instead.)

This message may repeat a few times in short succession due to jenkinsci/ghprb-plugin#292. Sorry.

Otherwise, if this message is too spammy, please complain to ixdy.

@k8s-bot
Copy link

k8s-bot commented Jul 4, 2016

Can one of the admins verify that this patch is reasonable to test? If so, please reply "ok to test".
(Note: "add to whitelist" is no longer supported. Please update configurations in kubernetes/test-infra/jenkins/job-configs/kubernetes-jenkins-pull instead.)

This message may repeat a few times in short succession due to jenkinsci/ghprb-plugin#292. Sorry.

Otherwise, if this message is too spammy, please complain to ixdy.

@k8s-bot
Copy link

k8s-bot commented Jul 4, 2016

Can one of the admins verify that this patch is reasonable to test? If so, please reply "ok to test".
(Note: "add to whitelist" is no longer supported. Please update configurations in kubernetes/test-infra/jenkins/job-configs/kubernetes-jenkins-pull instead.)

This message may repeat a few times in short succession due to jenkinsci/ghprb-plugin#292. Sorry.

Otherwise, if this message is too spammy, please complain to ixdy.

@k8s-bot
Copy link

k8s-bot commented Jul 4, 2016

Can one of the admins verify that this patch is reasonable to test? If so, please reply "ok to test".
(Note: "add to whitelist" is no longer supported. Please update configurations in kubernetes/test-infra/jenkins/job-configs/kubernetes-jenkins-pull instead.)

This message may repeat a few times in short succession due to jenkinsci/ghprb-plugin#292. Sorry.

Otherwise, if this message is too spammy, please complain to ixdy.

@jdef
Copy link
Contributor

jdef commented Jul 5, 2016

@k8s-bot ok to test

@@ -389,7 +391,10 @@ func (s *SchedulerServer) prepareExecutorInfo(hks hyperkube.Interface) (*mesos.E
} else if !hks.FindServer(hyperkube.CommandMinion) {
return nil, fmt.Errorf("either run this scheduler via km or else --executor-path is required")
} else {
if strings.Index(s.kmPath, "://") > 0 {
if s.kmLocalPath != "" { // The default value of kmLocalPath is "".
// TODO(k82): Check whether `kmLocalPath` start with `file://` or `/`.
Copy link
Contributor

Choose a reason for hiding this comment

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

What do you think about making this a subset of the :// case?

} else if strings.Index(s.kmPath, "://") > 0 {
  if strings.startsWith(s.kmPath, "file://") {
    // ... don't add this as a URI because it's local to the agent; parse the basename of kmPath and use that for ci.Valkue
    // (new bits)
  } else {
    // ... assume this is something to be downloaded; append a URI and assume that `km` will land in the sandbox.
    // (exiting bits)
  }
} else if ...

Copy link
Contributor

Choose a reason for hiding this comment

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

The idea being that people wanting to use a preinstalled km on the agent would always have to specify a URI using the file:// form

@k8s-bot
Copy link

k8s-bot commented Jul 5, 2016

GCE e2e build/test passed for commit 58f3048ba4fe9953acda4cac1423ca7453fba0c3.

@k82cn
Copy link
Member Author

k82cn commented Jul 6, 2016

Address jdef's comments.

@k82cn k82cn reopened this Jul 6, 2016
@k8s-bot
Copy link

k8s-bot commented Jul 6, 2016

Can one of the admins verify that this patch is reasonable to test? If so, please reply "ok to test".
(Note: "add to whitelist" is no longer supported. Please update configurations in kubernetes/test-infra/jenkins/job-configs/kubernetes-jenkins-pull instead.)

This message may repeat a few times in short succession due to jenkinsci/ghprb-plugin#292. Sorry.

Otherwise, if this message is too spammy, please complain to ixdy.

3 similar comments
@k8s-bot
Copy link

k8s-bot commented Jul 6, 2016

Can one of the admins verify that this patch is reasonable to test? If so, please reply "ok to test".
(Note: "add to whitelist" is no longer supported. Please update configurations in kubernetes/test-infra/jenkins/job-configs/kubernetes-jenkins-pull instead.)

This message may repeat a few times in short succession due to jenkinsci/ghprb-plugin#292. Sorry.

Otherwise, if this message is too spammy, please complain to ixdy.

@k8s-bot
Copy link

k8s-bot commented Jul 6, 2016

Can one of the admins verify that this patch is reasonable to test? If so, please reply "ok to test".
(Note: "add to whitelist" is no longer supported. Please update configurations in kubernetes/test-infra/jenkins/job-configs/kubernetes-jenkins-pull instead.)

This message may repeat a few times in short succession due to jenkinsci/ghprb-plugin#292. Sorry.

Otherwise, if this message is too spammy, please complain to ixdy.

@k8s-bot
Copy link

k8s-bot commented Jul 6, 2016

Can one of the admins verify that this patch is reasonable to test? If so, please reply "ok to test".
(Note: "add to whitelist" is no longer supported. Please update configurations in kubernetes/test-infra/jenkins/job-configs/kubernetes-jenkins-pull instead.)

This message may repeat a few times in short succession due to jenkinsci/ghprb-plugin#292. Sorry.

Otherwise, if this message is too spammy, please complain to ixdy.

@k8s-bot
Copy link

k8s-bot commented Jul 6, 2016

Can one of the admins verify that this patch is reasonable to test? If so, please reply "ok to test".
(Note: "add to whitelist" is no longer supported. Please update configurations in kubernetes/test-infra/jenkins/job-configs/kubernetes-jenkins-pull instead.)

This message may repeat a few times in short succession due to jenkinsci/ghprb-plugin#292. Sorry.

Otherwise, if this message is too spammy, please complain to ixdy.

@k8s-github-robot k8s-github-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jul 6, 2016
@k8s-bot
Copy link

k8s-bot commented Jul 6, 2016

GCE e2e build/test passed for commit 540de16b19524cbda6085b43bcbaf523c162ef5b.

@k82cn k82cn force-pushed the k8s-26930-km-local-path branch from 540de16 to 0d62260 Compare July 6, 2016 13:43
@jdef
Copy link
Contributor

jdef commented Jul 6, 2016

@k8s-bot ok to test

ci.Value = proto.String("./km") // TODO(jdef) extract constant
if strings.HasPrefix(s.kmPath, "file://") {
// If `kmPath` started with "file://", `km` in agent local path was used.
ci.Value = proto.String(s.kmPath)
Copy link
Contributor

Choose a reason for hiding this comment

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

did you test this? you probably need to strip the file:// prefix in order to make this work properly

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

So it is -- perfect

On Wed, Jul 6, 2016 at 11:19 AM, Klaus Ma notifications@github.com wrote:

In contrib/mesos/pkg/scheduler/service/service.go
#28447 (comment)
:

@@ -390,11 +390,16 @@ func (s _SchedulerServer) prepareExecutorInfo(hks hyperkube.Interface) (_mesos.E
return nil, fmt.Errorf("either run this scheduler via km or else --executor-path is required")
} else {
if strings.Index(s.kmPath, "://") > 0 {

  •       // URI could point directly to executable, e.g. hdfs:///km
    
  •       // or else indirectly, e.g. http://acmestorage/tarball.tgz
    
  •       // so we assume that for this case the command will always "km"
    
  •       ci.Uris = append(ci.Uris, &mesos.CommandInfo_URI{Value: proto.String(s.kmPath), Executable: proto.Bool(true)})
    
  •       ci.Value = proto.String("./km") // TODO(jdef) extract constant
    
  •       if strings.HasPrefix(s.kmPath, "file://") {
    
  •           // If `kmPath` started with "file://", `km` in agent local path was used.
    
  •           ci.Value = proto.String(s.kmPath)
    

"file://" is handled by Mesos Fetcher at
https://github.com/apache/mesos/blob/master/src/slave/containerizer/fetcher.cpp#L199


You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
https://github.com/kubernetes/kubernetes/pull/28447/files/0d62260bb2fca8d34b92c647d67087951a1c21b3#r69751134,
or mute the thread
https://github.com/notifications/unsubscribe/ACPVLCqkomu4FCw0L6ZoKL_C1lFNaQZgks5qS8eZgaJpZM4JECIE
.

Copy link
Contributor

Choose a reason for hiding this comment

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

actually I think I spoke too soon. The mesos code you're pointing at appears to be for handling URIs. Which is fine if you were copying kmPath into a URI. but here you're using it as the arg0 of a command line. so you'll want to strip the file:// prefix upon assigning it to ci.Value.

again, have you tested this?

Copy link
Member Author

Choose a reason for hiding this comment

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

@jdef , I think you're right, it handles the URI, not the command line. Update the code accordingly.

Re test, yes, but seems tested with old binaries :(. Sorry for the confuse.

@jdef
Copy link
Contributor

jdef commented Jul 6, 2016

@k82 looking better, left some comments

@k8s-bot
Copy link

k8s-bot commented Jul 6, 2016

GCE e2e build/test passed for commit 0d62260bb2fca8d34b92c647d67087951a1c21b3.

@k8s-bot
Copy link

k8s-bot commented Jul 6, 2016

GCE e2e build/test passed for commit 0d62260bb2fca8d34b92c647d67087951a1c21b3.

@k82cn k82cn force-pushed the k8s-26930-km-local-path branch from 0d62260 to 13dc5a0 Compare July 6, 2016 15:23
@k8s-bot
Copy link

k8s-bot commented Jul 6, 2016

GCE e2e build/test passed for commit 13dc5a0df58e86444285f511d54d5461605832a4.

@k82cn k82cn force-pushed the k8s-26930-km-local-path branch from 13dc5a0 to b361f40 Compare July 7, 2016 15:39
@jdef jdef changed the title Enable k8sm agent load km locally. MESOS: Support a pre-installed km binary at a well known, agent-local path Jul 7, 2016
@jdef jdef added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-label-needed labels Jul 7, 2016
@jdef
Copy link
Contributor

jdef commented Jul 7, 2016

lgtm :shipit:

@jdef jdef added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 7, 2016
@k8s-bot
Copy link

k8s-bot commented Jul 7, 2016

GCE e2e build/test passed for commit b361f40.

@k8s-github-robot
Copy link

Automatic merge from submit-queue

@k8s-github-robot k8s-github-robot merged commit 32e5996 into kubernetes:master Jul 7, 2016
@k82cn k82cn deleted the k8s-26930-km-local-path branch July 8, 2016 02:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/platform/mesos lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[k8sm] Run local km in agent host
5 participants