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

DM-13768 Fix firefly_client uploads to work with server on https #10

Merged
merged 5 commits into from Mar 14, 2018

Conversation

stargaser
Copy link
Contributor

@stargaser stargaser commented Mar 12, 2018

To make the lsst.display.firefly backend work more naturally with https:// servers:

  • remove the port argument from the constructor
  • change documentation to remove the port argument
  • now that this backend and its dependencies are in lsst_distrib, substantially shorten the "installing" section

@stargaser
Copy link
Contributor Author

@SimonKrughoff Maybe now that this package is in lsst_distrib, do you think the entire "Installation" part of the docs should be deleted? @jonathansick should be covering installation in a generic sense for LSST packages.

* remove port argument
* implement the firefly_version function
* change default host to include http://
@stargaser
Copy link
Contributor Author

@SimonKrughoff this PR is now ready for your review.

I have made changes to the doc files. These were being manually deployed to display-firefly.lsst.io by @jonathansick. Now it would be more appropriate to slot the package docs into pipelines.lsst.io following the new procedure. I would prefer to do that in another ticket, and I ask that you build the current docs locally, or that I send you an html file that I have built for your review.

@stargaser
Copy link
Contributor Author

...on the other hand, it's supposed to take only 15 minutes to update the doc subdirectory?

Copy link

@SimonKrughoff SimonKrughoff left a comment

Choose a reason for hiding this comment

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

I've made a few comments. The two in the constructor are critical to address, I think.

@@ -88,18 +88,18 @@ def __init__(self, display, verbose=False, host="localhost", port=8080,
global _fireflyClient
if not _fireflyClient:
try:
_fireflyClient = firefly_client.FireflyClient("%s:%d" % (host, port),
_fireflyClient = firefly_client.FireflyClient("%s" % host,

Choose a reason for hiding this comment

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

"%s" % host --> host

raise RuntimeError("Unable to connect websocket %s:%d: %s" % (host, port, e))
if (host == "localhost"):
raise RuntimeError("Unable to connect websocket %s: %s" % (host, e))
if (host[:9] == "localhost"):

Choose a reason for hiding this comment

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

This isn't ever going to evaluate to true now because the protocol is included in the host. I think it would be better done using urllib:

from urllib.parse import urlparse
parsed_host = urlparse(host)
if(parsed_host.hostname == "localhost"):

This will be both more future proof and readable.

doc/index.rst Outdated
@@ -69,7 +69,7 @@ The next lines will set up the display, using a public Firefly server.
import lsst.afw.display as afw_display
afw_display.setDefaultBackend('lsst.display.firefly')
display1 = afw_display.getDisplay(frame=1,
host='lsst-demo.ncsa.illinois.edu', port=80,
host='lsst-demo.ncsa.illinois.edu',

Choose a reason for hiding this comment

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

Doesn't this require that the protocol be part of the host string, or does it default to http?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It defaults to http inside firefly_client.FireflyClient, so it should work...a quick test is not working for me though, so let me work that out.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right! It either has to be http://lsst-demo.ncsa.illinois.edu or lsst-demo.ncsa.illinois.edu:80.

It turns out that https://lsst-demo.ncsa.illinois.edu also works, i.e. the Firefly server there is deployed on port 443. SUIT is discussing making https:// the default in firefly_client.

Choose a reason for hiding this comment

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

Sounds good.

@SimonKrughoff
Copy link

Regarding the docs. I think it's fine to shorten them. Doing auto deploy I don't know enough to really have an opinion.

  do a proper check of localhost before launching browser

  include http:// in the default for host
@stargaser stargaser merged commit af781ad into master Mar 14, 2018
@ktlim ktlim deleted the tickets/DM-13768 branch August 25, 2018 05:10
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.

None yet

2 participants