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

Context path #16

Merged
merged 2 commits into from
Nov 30, 2016
Merged

Context path #16

merged 2 commits into from
Nov 30, 2016

Conversation

mdymczyk
Copy link
Contributor

@mdymczyk mdymczyk commented Nov 17, 2016

#Support for custom jetty context paths. Comments welcome. Don't think we need to make that initial AJAX call to get it from the server, we can parse the URL but just to be safe...

Not sure why we have the build folder in the repo but the 2 files in the build file DON'T need a review, only the ~20 lines in the remaining 5 files do.

@mdymczyk mdymczyk changed the base branch from master to MD_svm_ROC November 17, 2016 22:37
@mdymczyk mdymczyk changed the base branch from MD_svm_ROC to master November 17, 2016 22:37
@mdymczyk mdymczyk changed the title Md context path Context path Nov 17, 2016
@micahstubbs
Copy link
Contributor

this PR depends on #13

@micahstubbs
Copy link
Contributor

per @mdymczyk these are the files with the meaningful changes - the other two are built artifacts that happen be under version control

screen shot 2016-11-17 at 6 44 59 pm

@mdymczyk
Copy link
Contributor Author

@micahstubbs I removed the dependency on PR #13 and removed the changes in build files so its easier to review.

@micahstubbs
Copy link
Contributor

when I check out branch MD_context_path and run make, I see this in Flow:
screen shot 2016-11-22 at 12 53 10 pm

I also see these errors in the browser console:
screen shot 2016-11-22 at 12 55 02 pm
screen shot 2016-11-22 at 12 55 08 pm
screen shot 2016-11-22 at 12 55 21 pm
screen shot 2016-11-22 at 12 55 34 pm
screen shot 2016-11-22 at 12 55 43 pm
screen shot 2016-11-22 at 12 55 53 pm

@micahstubbs
Copy link
Contributor

@mdymczyk will hand this back to you to see if you can reproduce and resolve these errors

@mdymczyk
Copy link
Contributor Author

@micahstubbs ah yes I forgot to mention this should be tested against this H2O branch: https://github.com/h2oai/h2o-3/tree/MD_jetty_context_path

I pushed some changes to Flow that will make it work with h2-3#master also but please try the above branch.

  1. checkout the above branch, run ./gradlew clean
  2. run make from h2o-flow
  3. start H2OApp with context_path parameter (in intellij you can do it by Run -> Edit Configurations... -> Program Arguments "-context_path /H2O" (without quotes))

You can then point your browser to http://localhost:54321/H2O/flow/index.html (you can also test http://localhost:54321/H2O and http://localhost:54321/H2O/ for redirects)

@micahstubbs
Copy link
Contributor

micahstubbs commented Nov 28, 2016

testing this again now

here is what I did for 3)
screen shot 2016-11-28 at 11 27 08 am

@micahstubbs
Copy link
Contributor

ok good news, so http://localhost:54321/H2O/flow/index.html renders Flow

screen shot 2016-11-28 at 11 32 06 am

@micahstubbs
Copy link
Contributor

that said, the current default http://172.16.2.26:54321/flow/index.html returns a 404

screen shot 2016-11-28 at 11 33 01 am

@micahstubbs
Copy link
Contributor

micahstubbs commented Nov 28, 2016

the default http://172.16.2.26:54321/flow/index.html or localhost:54321/flow/index.html addresses might be hard-coded in other places.

@mdymczyk what do you think about add support for redirecting localhost:54321/flow/index.html to:

  1. the only currently running Flow instance, if there is only one
  2. a list of all of the currently running Flow instances, if there are many

?

@micahstubbs
Copy link
Contributor

@lo5 would like to hear your thoughts - where we should route the old port, without a context path? if we do change every instruction to open Flow from the h2o-3 logs, is it ok to deprecate the old localhost:port address?

@micahstubbs
Copy link
Contributor

micahstubbs commented Nov 29, 2016

@mdymczyk chatted with @mmalohlava and @lo5 this morning. our consensus is that the h2o-3 jetty server should redirect from i.e. localhost:54321 to localhost:54321/H2O/flow/index.html when the context_path is set to H2O

sharing this comment here as well in the related h2o-3 PR h2oai/h2o-3#512

@micahstubbs
Copy link
Contributor

after a conversation with @tomkraljevic, the edge case where a user would visit localhost:54321 after specifying a context path seems less likely. will test this branch without the context-path argument, then merge if all goes well. once the corresponding h2o-3 PR is merged this feature will be available.

@micahstubbs
Copy link
Contributor

verified that Flow works normally with the code from this branch when the context_path flag is not set

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.

2 participants