我想使用此构建包来部署在heroku上构建的闪亮应用程序:
http://github.com/virtualstaticvoid/heroku-buildpack-r.git#heroku-16
我已包含以上提到的存储库中指定的run.R和init.R文件。我已经部署了应用程序
但是,我的日志中出现错误,并且该应用无法正常运行
2020-02-04T14:24:13.671364+00:00 app[web.1]: transpose
2020-02-04T14:24:13.671366+00:00 app[web.1]:
2020-02-04T14:25:09.936204+00:00 heroku[web.1]: State changed from starting to crashed
2020-02-04T14:25:09.845379+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2020-02-04T14:25:09.845483+00:00 heroku[web.1]: Stopping process with SIGKILL
2020-02-04T14:25:09.921158+00:00 heroku[web.1]: Process exited with status 137
2020-02-04T14:25:12.649598+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=boxing-prediction-app.herokuapp.com request_id=4d078fa4-daee-4208-b4bf-143d68471114 fwd="41.60.121.18" dyno= connect= service= status=503 bytes= protocol=https
2020-02-04T14:25:14.151464+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=boxing-prediction-app.herokuapp.com request_id=47571ddb-94c1-4624-b301-7a5edfa50d9a fwd="41.60.121.18" dyno= connect= service= status=503 bytes= protocol=https
2020-02-04T14:25:35.418191+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=boxing-prediction-app.herokuapp.com request_id=72df6f1e-409f-4778-aaca-9d9ecb3f7916 fwd="41.60.121.18" dyno= connect= service= status=503 bytes= protocol=https
2020-02-04T14:25:35.960407+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=boxing-prediction-app.herokuapp.com request_id=d420e0b8-f078-459d-aec7-313f246e561d fwd="41.60.121.18" dyno= connect= service= status=503 bytes= protocol=https
这是我的app.R文件:
...
if (!Sys.info()[['sysname']] == 'Darwin')
{
reticulate::virtualenv_create(envname = "python_environment",python="python3")
reticularevirtualenv_install("python_environment", packages =c('pandas','catboost'))
}
reticulate::use_virtualenv("python_environment",required = TRUE)
# boxing = read.csv(file="https://raw.githubusercontent.com/EmmS21/SpringboardCapstoneBoxingPredictionWebApp/master/boxingdata/visuals.csv",header=TRUE)
boxing <- readRDS('fullboxingdataset.RDS')
#reading model
p <- import("pandas")
cat_model <- p$read_pickle("catmodelsummary.pkl")
ui <- function(){
addResourcePath("www","www")
tagList(
shinyUI(
fluidPage(setBackgroundImage(src = "www/mayweather2.png"),
headerPanel(fluidRow(
column(offset = 5, width=5,
h2("Boxing Prediction App")),
column(offset = 3, width = 7,
h5("Welcome to Emmanuel's boxing prediction app. Using this app you can get the probability of a fight ending in a given way. The model used to derive these predictions uses data extracted before the 23rd of November 2019. Feel free to send through any feedback/suggestions to emmanuelsibanda21@gmail.com. Any updates to the data will be shown here. Without further ado, let's get ready to rumble!"))
)),
fluidRow(column(offset = 5, width = 2,align="center",
titlePanel(h5(selectInput("dropdown","Select Boxer Weights",choices=unique(boxing$division)))))),
fluidRow(column(offset = 3, width=3,
wellPanel(
fluidRow(
uiOutput("Names"),
uiOutput("boxerA")))),
column(width = 3, align="right",
wellPanel(style = "height:300px",
fluidRow(
uiOutput("Opponent"),
uiOutput("opppic")
)))),
hr(),
column(offset=5,width = 8,
actionBttn("goButton","Start Predictions")),
hr(),
column(offset=3,width=6,
DTOutput("predictions"))
)
)
)}
...
这是我的run.R文件:
library(shiny)
port <- Sys.getenv('PORT')
shiny::runApp(
appDir = getwd(),
host = '0.0.0.0',
port = as.numeric(port)
)