[Bioc-devel] bioconductor AMI & shiny app

Dan Tenenbaum dtenenba at fhcrc.org
Wed May 21 22:29:59 CEST 2014


Hi Robert,

----- Original Message -----
> From: "Robert Castelo" <robert.castelo at upf.edu>
> To: bioc-devel at r-project.org
> Sent: Wednesday, May 21, 2014 7:37:31 AM
> Subject: [Bioc-devel] bioconductor AMI & shiny app
> 
> hi,
> 
> i'm trying to use a shiny app through AWS and the bioconductor AMI,
> but
> i cannot make it work.
> 

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).

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. 

So I will update that AMI to use that version of shiny server by default.



> i have created a security group in AWS that has open the 8787 and
> 6219
> ports, the former for RStudio and the latter to access the shiny app.
> this is the command-line output from my desktop interrogating how the
> security group is configured:
> 
> $ aws ec2 describe-security-groups --group-names test | ./JSON.sh -b
> ["SecurityGroups",0,"Description"]      "test"
> ["SecurityGroups",0,"IpPermissions",0,"ToPort"] 22
> ["SecurityGroups",0,"IpPermissions",0,"IpProtocol"]     "tcp"
> ["SecurityGroups",0,"IpPermissions",0,"IpRanges",0,"CidrIp"]
>    "0.0.0.0/0"
> ["SecurityGroups",0,"IpPermissions",0,"FromPort"]       22
> ["SecurityGroups",0,"IpPermissions",1,"ToPort"] 3838
> ["SecurityGroups",0,"IpPermissions",1,"IpProtocol"]     "tcp"
> ["SecurityGroups",0,"IpPermissions",1,"IpRanges",0,"CidrIp"]
>    "0.0.0.0/0"
> ["SecurityGroups",0,"IpPermissions",1,"FromPort"]       3838
> ["SecurityGroups",0,"IpPermissions",2,"ToPort"] 6219
> ["SecurityGroups",0,"IpPermissions",2,"IpProtocol"]     "tcp"
> ["SecurityGroups",0,"IpPermissions",2,"IpRanges",0,"CidrIp"]
>    "0.0.0.0/0"
> ["SecurityGroups",0,"IpPermissions",2,"FromPort"]       6219
> ["SecurityGroups",0,"IpPermissions",3,"ToPort"] 8787
> ["SecurityGroups",0,"IpPermissions",3,"IpProtocol"]     "tcp"
> ["SecurityGroups",0,"IpPermissions",3,"IpRanges",0,"CidrIp"]
>    "0.0.0.0/0"
> ["SecurityGroups",0,"IpPermissions",3,"FromPort"]       8787
> 
> i have updated the shiny-server in the bioc AMI to the lastest
> version.
> this is the command-line output from the AWS instance running the
> bioc AMI:
> 
> $ tail -n 5 /var/log/shiny-server.log
> 0[2014-05-21 13:37:59.867] [INFO] shiny-server - Shiny Server
> v1.1.0.10000 (Node.js v0.10.21)
> [2014-05-21 13:37:59.888] [INFO] shiny-server - Using pidfile
> /var/run/shiny-server.pid
> [2014-05-21 13:37:59.891] [INFO] shiny-server - Using config file
> "/etc/shiny-server/shiny-server.conf"
> [2014-05-21 13:37:59.950] [WARN] shiny-server - Running as root
> unnecessarily is a security risk! You could be running more securely
> as
> non-root.
> [2014-05-21 13:37:59.954] [INFO] shiny-server - Starting listener on
> 0.0.0.0:3838
> 
> i connect to R studio through the 8787 port and then i do the
> following
> using the code from the example of the 'runApp()' man page:
> 
> library(shiny)
> 
> runApp(list(
>         ui = bootstrapPage(
>           numericInput('n', 'Number of obs', 100),
>           plotOutput('plot')
>         ),
>         server = function(input, output) {
>           output$plot <- renderPlot({ hist(runif(input$n)) })
>         }
>       ), host="ec2-xx-xx-xx-xx.compute-1.amazonaws.com", port=6219)
> 
> where "ec2-xx-xx-xx-xx.compute-1.amazonaws.com is the public DNS of
> my
> instance.

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.

Dan



> 
> the server starts fine with the message "Listening on http://ec2-xx
> ..etc", however, the window opens directly with the error message
> "The
> system returned: (111) Connection refused"
> 
> if instead of using the public DNS as host i use the IP address in
> the
> "inet addr" field from the eht0 entry of the 'ifconfig' unix command
> it
> gives a "timeout" after a few minutes and if i use the IP address
> resulting from concatenating xx.xx.xx.xx in the public DNS name then
> it
> says "Failed to create server".
> 
> to make it more puzzling if i connect with the browser to the port
> 3838
> of the public DNS server, i.e.,
> ec2-xx-xx-xx-xx.compute-1.amazonaws.com:3838 then it says "Welcome to
> Shiny Server!" and the example app works perfectly.
> 
> so it seems that i'm doing something wrong when starting the server
> from
> RStudio via runApp().
> 
> i've been googling a lot and i think i have everything in place so i
> wonder whether something might be wrong in how the bioc AMI is
> configured. before i updated the shiny-server even the last option
> wasn't working, but i don't know what else could i do system-wide to
> try
> to fix this problem.
> 
> any hint will be very much appreciated,
> 
> thanks!!
> robert.
> 
> _______________________________________________
> Bioc-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/bioc-devel
>



More information about the Bioc-devel mailing list