{"action":"created","issue":{"url":"https://api.github.com/repos/flux-framework/flux-core/issues/369","labels_url":"https://api.github.com/repos/flux-framework/flux-core/issues/369/labels{/name}","comments_url":"https://api.github.com/repos/flux-framework/flux-core/issues/369/comments","events_url":"https://api.github.com/repos/flux-framework/flux-core/issues/369/events","html_url":"https://github.com/flux-framework/flux-core/pull/369","id":103623718,"number":369,"title":"allow flux to launch flux","user":{"login":"garlick","id":169947,"avatar_url":"https://avatars.githubusercontent.com/u/169947?v=3","gravatar_id":"","url":"https://api.github.com/users/garlick","html_url":"https://github.com/garlick","followers_url":"https://api.github.com/users/garlick/followers","following_url":"https://api.github.com/users/garlick/following{/other_user}","gists_url":"https://api.github.com/users/garlick/gists{/gist_id}","starred_url":"https://api.github.com/users/garlick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/garlick/subscriptions","organizations_url":"https://api.github.com/users/garlick/orgs","repos_url":"https://api.github.com/users/garlick/repos","events_url":"https://api.github.com/users/garlick/events{/privacy}","received_events_url":"https://api.github.com/users/garlick/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/flux-framework/flux-core/labels/review","name":"review","color":"ededed"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":42,"created_at":"2015-08-28T00:52:00Z","updated_at":"2015-09-03T16:14:03Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/flux-framework/flux-core/pulls/369","html_url":"https://github.com/flux-framework/flux-core/pull/369","diff_url":"https://github.com/flux-framework/flux-core/pull/369.diff","patch_url":"https://github.com/flux-framework/flux-core/pull/369.patch"},"body":"This PR is for feedback (and maybe for your amusement?) only.  It is a very simple first step towards flux launching flux as discussed in #364.\r\n\r\nThe `flux-start` command now launches Flux with `wreckrun` if $FLUX_TMPDIR is set.  It provides the `--pmi-boot` option to the broker indicating that it should dlopen a PMI library to exchange endpoint information, as it does when starting under SLURM.\r\n\r\nThe broker now sets LD_LIBRARY_PATH for the initial program to prepend the installed flux libdir, and before that, any configured `program_library_path`, which the build system sets to include the pmi library directory when running in tree.  This way the broker finds the Flux PMI library instead of SLURM's.  Perhaps this approach will also remove one obstacle to running MPI programs under Flux.\r\n\r\nWith these changes you can do stuff like this:\r\n```\r\n./flux start flux start flux start flux start hostname\r\n```\r\nor\r\n```\r\n$ cat doit\r\n#/bin/bash\r\nflux start -s1 sleep 15 &\r\nflux start -s2 sleep 10 &\r\nflux start -s4 sleep 5 &\r\nflux start -s1 printenv FLUX_TMPDIR &\r\nwait; wait; wait; wait\r\n\r\n$ ./flux start -s8 ./doit\r\n```\r\n\r\nThis was a quick hack to get this stuff working, but it does a few things wrong:\r\n* It was suggested flux-start needed a better way to add bootstrap methods, such as a simple plugin system.  This was not implemented.\r\n* `flux-start` needed to find `flux-wreckrun`.  It simply uses the `/proc/self/exe` trick that flux.c employs to find it in the same directory as itself, special casing the libtool .libs directory.  This should be done properly although I'm not sure what is proper?\r\n* The broker needed to do all the same PATH dedup stuff that was added to `libflux/conf.c` so nicely, but using the subprocess environment accessors.  Rather than think through whether and how to use that code, I added a little function to do what I needed.\r\n* Needs a sharness test\r\n\r\nObviously most of these will need to be addressed in a serious PR but first I wanted to get this out there in case others wanted to play around and weigh in on the approach or suggest ideas.\r\n\r\nI've noted some odd things that need further investigation:\r\n* `flux start -s2 flux start -s4 hostname` hangs, not sure why\r\n* `flux start flux start` works as you'd expect: wreck doesn't offer a pty like srun's, the shell is line buffered, but it works; `flux start flux start flux start` seems to buffer stdin until you type ctrl-D\r\n* haven't tried this under a slurm allocation on multiple nodes (that would be a good test!)\r\n"},"comment":{"url":"https://api.github.com/repos/flux-framework/flux-core/issues/comments/137499244","html_url":"https://github.com/flux-framework/flux-core/pull/369#issuecomment-137499244","issue_url":"https://api.github.com/repos/flux-framework/flux-core/issues/369","id":137499244,"user":{"login":"trws","id":660149,"avatar_url":"https://avatars.githubusercontent.com/u/660149?v=3","gravatar_id":"","url":"https://api.github.com/users/trws","html_url":"https://github.com/trws","followers_url":"https://api.github.com/users/trws/followers","following_url":"https://api.github.com/users/trws/following{/other_user}","gists_url":"https://api.github.com/users/trws/gists{/gist_id}","starred_url":"https://api.github.com/users/trws/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trws/subscriptions","organizations_url":"https://api.github.com/users/trws/orgs","repos_url":"https://api.github.com/users/trws/repos","events_url":"https://api.github.com/users/trws/events{/privacy}","received_events_url":"https://api.github.com/users/trws/received_events","type":"User","site_admin":false},"created_at":"2015-09-03T16:14:03Z","updated_at":"2015-09-03T16:14:03Z","body":"Apparently I wasn't getting my email, so I missed this coming together yesterday evening, but this looks awesome!\r\n\r\nOne question, on a sidenote from earlier, why is it a problem to have a flux pick up another as a parent when it is not launched by it? This is actually a behavior I might want to exploit, and seems useful rather than problematic unless it violates a contract somewhere.\r\n"}}