[Bioc-devel] bioconductor AMI & shiny app

Dan Tenenbaum dtenenba at fhcrc.org
Thu May 22 16:58:57 CEST 2014



----- Original Message -----
> From: "Robert Castelo" <robert.castelo at upf.edu>
> To: "Dan Tenenbaum" <dtenenba at fhcrc.org>
> Cc: bioc-devel at r-project.org
> Sent: Thursday, May 22, 2014 7:47:53 AM
> Subject: Re: [Bioc-devel] bioconductor AMI & shiny app
> 
> hi Dan,
> 
> On 05/21/2014 10:29 PM, Dan Tenenbaum wrote:
> > Hi Robert,
> >
> > I started an instance of the BioC 2.14 AMI (is that the one you are
> > working with?) and updated to the latest shiny server (apologies
> > for
> > the old one being on there).
> 
> yes, that was it.
> 
> > Looks like by default it listens on port 3838 (see
> > /etc/shiny-server/shiny-server.conf) so I added that to my security
> > group and went to http://ec2XXXXX.compute-1.amazonaws.com:3838 and
> > it
> > worked.
> 
> yes, it also worked for me at port 3838.
> 
> > So I will update that AMI to use that version of shiny server by
> > default.
> >
> > I got this to work if I specified host as the "private IP" as
> > displayed in the aws console (an IP address that for me anyway
> > starts
> > with 10.182).
> >
> > I got a message saying the popup was blocked, but I think that's
> > ok,
> > because it was trying to go to the wrong URL anyway (that internal
> > IP
> > which is not accessible from outside ec2). But in another window I
> > went to
> >
> > http://ec2-XXXXX.compute-1.amazonaws.com:6219
> >
> > and the shiny app worked.
> 
> thanks for trying it out, the description of what you did gave me a
> hint, i was not trying to combine an address to launch the shiny app
> with a different address in the browser to connect. now, i could make
> it
> work by doing exactly how you say, using the private IP in the 'host'
> argument of 'runApp()' and replacing that IP in the browser by the
> public DNS name.
> 
> this procedure, however, looks a bit cumbersome to me, specially if a
> non-expert user is supposed to use the shiny app. do you know whether
> it
> is possible that the browser window opens automatically with the
> public
> DNS name?

Note that the launch.browser argument to runApp() "can also be a function to call with the
application's URL". So maybe this function could translate the private IP to the public DNS (actually, based on the Details section of runApp(), it seems like you could use 0.0.0.0 instead of the private IP).

The function could use instance metadata (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AESDG-chapter-instancedata.html) to find out the public DNS name and construct a URL, then start a browser window pointing to that URL. If you provide this function, users won't have to know what it does. 

I would also post on the shiny google group (https://groups.google.com/group/shiny-discuss) and ask them if they might have a more elegant solution, or would be interested in adding some EC2 support. It shouldn't be too difficult.

Dan


> 
> thanks!
> robert.
>



More information about the Bioc-devel mailing list