I would like to run a Shiny app from within an AWS SageMaker notebook and was wondering if this is possible.
It is possible to run other types of web app, eg TensorBoard.
I tried running a simple embedded Shiny app using this example -- the only change I made was to specify the port at the end:
library(shiny)
shinyApp(
ui = fluidPage(
selectInput("region", "Region:",
choices = colnames(WorldPhones)),
plotOutput("phonePlot")
),
server = function(input, output) {
output$phonePlot = renderPlot({
barplot(WorldPhones[,input$region]*1000,
ylab = "Number of Telephones", xlab = "Year")
})
},
options = list(height = 500, port=3387)
)
I then tried to access the Shiny app in another browser tab via https://<my-notebook-instance-name>.notebook.eu-west-1.sagemaker.aws/proxy/3387/
, using the same method to construct the URL as with TensorBoard. The selectInput
did load, but the plot wasn't produced, and after 5 seconds the app greyed out.
(I verified that I was able to get the Shiny app running successfully on my local machine.)
For the avoidance of doubt, this is with a standard SageMaker notebook instance, running an R kernel. I don't have a RStudio Workbench licence.
Thanks for any insight you may have.