diff --git a/.Rhistory b/.Rhistory index 4222c3c..17aa3ae 100644 --- a/.Rhistory +++ b/.Rhistory @@ -1,5 +1,3 @@ -file.path("data-raw", "data.csv"), -sep = ";", dec = ",", stringsAsFactors = T ) %>% @@ -510,3 +508,5 @@ rm(list=ls(all.names = TRUE)) golem::document_and_reload() # Run the application eDASH::run_app() +golem::add_dockerfile_with_renv() +golem::add_dockerfile() diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..f52ee68 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,7 @@ +.RData +.Rhistory +.git +.gitignore +manifest.json +rsconnect/ +.Rproj.user diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/aws.xml b/.idea/aws.xml new file mode 100644 index 0000000..2c4ea32 --- /dev/null +++ b/.idea/aws.xml @@ -0,0 +1,17 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/dashboard-student.iml b/.idea/dashboard-student.iml new file mode 100644 index 0000000..d6ebd48 --- /dev/null +++ b/.idea/dashboard-student.iml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..3d82f74 --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,13 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..639900d --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..7866583 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..939454a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,53 @@ +FROM rocker/verse:4.2.3 +# Set the used port, once deployed in CrownLabs this variable will be overrided with the value used by CrownLabs +ENV CROWNLABS_LISTEN_PORT=80 +# Set the web-service basepath, once deployed in CrownLabs this variable will be overrided with the value used by CrownLabs +ENV CROWNLABS_BASE_PATH=/ +RUN apt-get update && apt-get install -y cmake libcurl4-openssl-dev libfribidi-dev libharfbuzz-dev libicu-dev libpng-dev libssl-dev libtiff-dev libxml2-dev make pandoc zlib1g-dev && rm -rf /var/lib/apt/lists/* +RUN mkdir -p /usr/local/lib/R/etc/ /usr/lib/R/etc/ +RUN echo "options(repos = c(CRAN = 'https://cran.rstudio.com/'), download.file.method = 'libcurl', Ncpus = 4)" | tee /usr/local/lib/R/etc/Rprofile.site | tee /usr/lib/R/etc/Rprofile.site +RUN R -e 'install.packages("remotes")' +RUN Rscript -e 'remotes::install_version("RColorBrewer",upgrade="never", version = "1.1-3")' +RUN Rscript -e 'remotes::install_version("scales",upgrade="never", version = "1.2.1")' +RUN Rscript -e 'remotes::install_version("rlang",upgrade="never", version = "1.1.0")' +RUN Rscript -e 'remotes::install_version("magrittr",upgrade="never", version = "2.0.3")' +RUN Rscript -e 'remotes::install_version("ggplot2",upgrade="never", version = "3.4.3")' +RUN Rscript -e 'remotes::install_version("pkgload",upgrade="never", version = "1.3.2.1")' +RUN Rscript -e 'remotes::install_version("tidyr",upgrade="never", version = "1.3.0")' +RUN Rscript -e 'remotes::install_version("purrr",upgrade="never", version = "1.0.1")' +RUN Rscript -e 'remotes::install_version("dplyr",upgrade="never", version = "1.1.1")' +RUN Rscript -e 'remotes::install_version("knitr",upgrade="never", version = "1.42")' +RUN Rscript -e 'remotes::install_version("htmltools",upgrade="never", version = "0.5.5")' +RUN Rscript -e 'remotes::install_version("shiny",upgrade="never", version = "1.7.4")' +RUN Rscript -e 'remotes::install_version("config",upgrade="never", version = "0.3.2")' +RUN Rscript -e 'remotes::install_version("shinycssloaders",upgrade="never", version = "1.0.0")' +RUN Rscript -e 'remotes::install_version("imputeTS",upgrade="never", version = "3.3")' +RUN Rscript -e 'remotes::install_version("simputation",upgrade="never", version = "0.2.8")' +RUN Rscript -e 'remotes::install_version("lubridate",upgrade="never", version = "1.9.2")' +RUN Rscript -e 'remotes::install_version("pkgdown",upgrade="never", version = "2.0.7")' +RUN Rscript -e 'remotes::install_version("amap",upgrade="never", version = "0.8-19")' +RUN Rscript -e 'remotes::install_version("shinyjs",upgrade="never", version = "2.1.0")' +RUN Rscript -e 'remotes::install_version("shinyalert",upgrade="never", version = "3.0.0")' +RUN Rscript -e 'remotes::install_version("NbClust",upgrade="never", version = "3.0.1")' +RUN Rscript -e 'remotes::install_version("shinyBS",upgrade="never", version = "0.61.1")' +RUN Rscript -e 'remotes::install_version("shinyFeedback",upgrade="never", version = "0.4.0")' +RUN Rscript -e 'remotes::install_version("MLmetrics",upgrade="never", version = "1.1.1")' +RUN Rscript -e 'remotes::install_version("partykit",upgrade="never", version = "1.2-19")' +RUN Rscript -e 'remotes::install_version("plyr",upgrade="never", version = "1.8.8")' +RUN Rscript -e 'remotes::install_version("shinyWidgets",upgrade="never", version = "0.8.0")' +RUN Rscript -e 'remotes::install_version("shinydashboard",upgrade="never", version = "0.7.2")' +RUN Rscript -e 'remotes::install_version("DT",upgrade="never", version = "0.30")' +RUN Rscript -e 'remotes::install_version("golem",upgrade="never", version = "0.4.1")' +RUN mkdir /build_zone +ADD . /build_zone +WORKDIR /build_zone +RUN R -e 'remotes::install_local(upgrade="never")' +# Create a user with UID 1010 +RUN useradd -m myuser -u 1010 +# add permission to myuser to all files +USER root +RUN chown -R myuser:myuser /build_zone +# Use the previously created user to run the container +USER myuser +EXPOSE ${CROWNLABS_LISTEN_PORT} +CMD R -e "options('shiny.port'=${CROWNLABS_LISTEN_PORT},shiny.host='0.0.0.0');library(eDASH);eDASH::run_app()" diff --git a/NAMESPACE b/NAMESPACE index aeac65c..6ae9268 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,93 +1,2 @@ # Generated by roxygen2: do not edit by hand -export(max_scaling) -export(minmax_scaling) -export(run_app) -export(zscore) -import(dplyr) -import(ggplot2) -import(htmltools) -import(imputeTS) -import(magrittr) -import(shiny) -import(shinydashboard) -importFrom(MLmetrics,Accuracy) -importFrom(MLmetrics,ConfusionMatrix) -importFrom(MLmetrics,Recall) -importFrom(NbClust,NbClust) -importFrom(RColorBrewer,brewer.pal) -importFrom(amap,Kmeans) -importFrom(dplyr,distinct) -importFrom(dplyr,filter) -importFrom(dplyr,mutate) -importFrom(dplyr,mutate_at) -importFrom(dplyr,mutate_if) -importFrom(dplyr,select) -importFrom(dplyr,select_if) -importFrom(golem,activate_js) -importFrom(golem,add_resource_path) -importFrom(golem,bundle_resources) -importFrom(golem,favicon) -importFrom(golem,with_golem_options) -importFrom(grDevices,png) -importFrom(grid,gpar) -importFrom(lubridate,date) -importFrom(lubridate,is.POSIXct) -importFrom(lubridate,month) -importFrom(lubridate,round_date) -importFrom(lubridate,wday) -importFrom(magrittr,`%>%`) -importFrom(partykit,as.party) -importFrom(partykit,predict.party) -importFrom(plyr,ddply) -importFrom(plyr,summarise) -importFrom(purrr,is_empty) -importFrom(rlang,is_empty) -importFrom(rpart,plotcp) -importFrom(rpart,rpart) -importFrom(rpart,rpart.control) -importFrom(scales,date_breaks) -importFrom(shiny,HTML) -importFrom(shiny,NS) -importFrom(shiny,absolutePanel) -importFrom(shiny,shinyApp) -importFrom(shiny,tagList) -importFrom(shinyBS,addPopover) -importFrom(shinyBS,bsModal) -importFrom(shinyBS,bsPopover) -importFrom(shinyBS,bsTooltip) -importFrom(shinyBS,toggleModal) -importFrom(shinyFeedback,feedbackDanger) -importFrom(shinyFeedback,feedbackSuccess) -importFrom(shinyFeedback,feedbackWarning) -importFrom(shinyFeedback,hideFeedback) -importFrom(shinyFeedback,showFeedbackDanger) -importFrom(shinyFeedback,showFeedbackWarning) -importFrom(shinyFeedback,useShinyFeedback) -importFrom(shinyWidgets,dropdownButton) -importFrom(shinyWidgets,pickerInput) -importFrom(shinyWidgets,radioGroupButtons) -importFrom(shinyWidgets,searchInput) -importFrom(shinyWidgets,sliderTextInput) -importFrom(shinyWidgets,tooltipOptions) -importFrom(shinyWidgets,updatePickerInput) -importFrom(shinyalert,shinyalert) -importFrom(shinycssloaders,withSpinner) -importFrom(shinyjs,disable) -importFrom(shinyjs,disabled) -importFrom(shinyjs,enable) -importFrom(shinyjs,runjs) -importFrom(simputation,impute_cart) -importFrom(stats,IQR) -importFrom(stats,cutree) -importFrom(stats,dist) -importFrom(stats,hclust) -importFrom(stats,median) -importFrom(stats,na.omit) -importFrom(stats,predict) -importFrom(stats,quantile) -importFrom(stats,reformulate) -importFrom(stats,sd) -importFrom(tidyr,pivot_wider) -importFrom(utils,read.csv) -importFrom(utils,write.csv) diff --git a/deploy.sh b/deploy.sh new file mode 100644 index 0000000..5dc91e3 --- /dev/null +++ b/deploy.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +ROOT_FOLDER='dashboard-students' # Get root folder name +DATE=$(date '+%Y-%m-%d') # Get current date +LOCAL=false # Set to true if you want to build locally + +echo "Building docker image ${ROOT_FOLDER}:${DATE}.v1" + +# if local is true, then build locally; else, build online +if [ "$LOCAL" == "true" ]; then + docker build -t harbor.crownlabs.polito.it/crownlabs-standalone/shinyapp/${ROOT_FOLDER}:${DATE}.v1 . + docker run -it --rm -p 80:80 harbor.crownlabs.polito.it/crownlabs-standalone/shinyapp/${ROOT_FOLDER}:${DATE}.v1 + exit 0 +else + echo "Login to harbor.crownlabs.polito.it" + docker login harbor.crownlabs.polito.it + docker buildx build --push -t harbor.crownlabs.polito.it/crownlabs-standalone/shinyapp/${ROOT_FOLDER}:${DATE}.v1 . + exit 0 +fi diff --git a/dev/config_attachment.yaml b/dev/config_attachment.yaml new file mode 100644 index 0000000..adf023b --- /dev/null +++ b/dev/config_attachment.yaml @@ -0,0 +1,12 @@ +path.n: NAMESPACE +path.d: DESCRIPTION +dir.r: R +dir.v: vignettes +dir.t: tests +extra.suggests: ~ +pkg_ignore: ~ +document: yes +normalize: yes +inside_rmd: no +must.exist: yes +check_if_suggests_is_installed: no