generated from ohdsi-studies/EmptyStudyRepository
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b2b3c4f
commit 8e40ba3
Showing
5 changed files
with
180 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,3 +51,6 @@ inst_real | |
|
||
# Error reports | ||
errorReportSql.txt | ||
|
||
# Docker environment files | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
FROM rocker/r-ver:4.1.0 | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y --no-install-recommends \ | ||
git \ | ||
libbz2-dev \ | ||
liblzma-dev \ | ||
libcairo2-dev \ | ||
libcurl4-openssl-dev \ | ||
libfontconfig1-dev \ | ||
libpcre3-dev \ | ||
libssl-dev \ | ||
libxml2 \ | ||
libxml2-dev \ | ||
openjdk-11-jdk-headless \ | ||
pandoc \ | ||
zlib1g-dev \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
ENV JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64 \ | ||
LD_LIBRARY_PATH=/usr/lib/jvm/java-11-openjdk-amd64/lib/server | ||
|
||
RUN R CMD javareconf \ | ||
&& ln -s /usr/local/lib/R/site-library/littler/examples/install.r /usr/local/bin/install.r \ | ||
&& install.r \ | ||
devtools \ | ||
Andromeda \ | ||
base64enc \ | ||
benchmarkme \ | ||
benchmarkmeData \ | ||
bit64 \ | ||
bitops \ | ||
broom \ | ||
car \ | ||
checkmate \ | ||
codemetar \ | ||
colorspace \ | ||
curl \ | ||
clock \ | ||
conquer \ | ||
data.table \ | ||
devtools \ | ||
doParallel \ | ||
DT \ | ||
dplyr \ | ||
digest \ | ||
farver \ | ||
fastmap \ | ||
ff \ | ||
flextable \ | ||
foreach \ | ||
gdtools \ | ||
generics \ | ||
ggplot2 \ | ||
ggiraph \ | ||
gtable \ | ||
gridtext \ | ||
haven \ | ||
hms \ | ||
httpuv \ | ||
isoband \ | ||
iterators \ | ||
jpeg \ | ||
KMsurv \ | ||
labeling \ | ||
lme4 \ | ||
lubridate \ | ||
maptools \ | ||
munsell \ | ||
officer \ | ||
openxlsx \ | ||
pool \ | ||
plyr \ | ||
plotly \ | ||
png \ | ||
RColorBrewer \ | ||
RCurl \ | ||
readr \ | ||
readxl \ | ||
renv \ | ||
rJava \ | ||
rjson \ | ||
RJSONIO \ | ||
RSQLite \ | ||
rlang \ | ||
rmarkdown \ | ||
scales \ | ||
shiny \ | ||
shinydashboard \ | ||
shinyWidgets \ | ||
snow \ | ||
sourcetools \ | ||
survminer \ | ||
systemfonts \ | ||
tidyr \ | ||
tinytex \ | ||
tsibble \ | ||
utf8 \ | ||
uuid \ | ||
viridisLite \ | ||
vroom \ | ||
withr \ | ||
XML \ | ||
xml2 \ | ||
xtable \ | ||
zip \ | ||
&& installGithub.r \ | ||
OHDSI/CohortDiagnostics \ | ||
OHDSI/CirceR \ | ||
OHDSI/Eunomia \ | ||
OHDSI/FeatureExtraction \ | ||
OHDSI/ParallelLogger \ | ||
OHDSI/ROhdsiWebApi \ | ||
OHDSI/SqlRender \ | ||
OHDSI/DatabaseConnector \ | ||
OHDSI/DatabaseConnectorJars \ | ||
ohdsi-studies/[email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
Docker container instructions | ||
============================= | ||
|
||
This folder contains a number of files that can help you to run the study package within a Docker container. | ||
Ready-to-go containers are also published on [Docker Hub](https://hub.docker.com/repository/docker/keesvanbochove/pioneer-package). | ||
|
||
# Instructions | ||
These instructions assume you would like to use the published container, but of course | ||
you can also choose to build it from source yourself using the provided `Dockerfile`. | ||
|
||
## 1. Supply configuration variables and create the cointainer | ||
You can use the file `pioneer-package.env` in this folder to update environment variables | ||
needed to run the study. Please copy it to a file named `.env` and fill in your details. | ||
You can then create and start the container using the following command: | ||
``` | ||
docker run -itd --env-file .env --name pioneer keesvanbochove:pioneer-package | ||
``` | ||
Note that depending on your Docker configuration you may need to add other arguments, such as the target network. | ||
|
||
## 2. Copy your private SFTP upload key to the container | ||
``` | ||
docker cp study-data-site-pioneer pioneer:/ | ||
``` | ||
|
||
## 3. Run the study | ||
You can use the following command to attach to the R session started within the container: | ||
``` | ||
docker attach pioneer | ||
``` | ||
You can now follow the instructions in `extras/CodeToRun.R` from section 2 on as if you were running locally. | ||
|
||
A few comments: | ||
* If you want to temporarily return to your command line but keep the container running, the default detach sequence is `CTRL-p CTRL-q` | ||
* Please don't forget to run the `uploadDiagnosticsResults` and `uploadStudyResults` commands to upload to the OHDSI SFTP server! This requires your container to have internet connection. | ||
* If you exit the R session (using `q()`), the container will be stopped, so don't do that until you are finished. | ||
|
||
## 4. Copy the results out of the container onto your filesystem | ||
By default, the results are in a folder named identical to your database ID. | ||
So if your database ID is `SP` and you would like to copy the result folder to your current path, you would run: | ||
``` | ||
docker cp pioneer:/SP . | ||
``` | ||
|
||
5. Destroy the container | ||
After you copied and inspected the results, you can safely destroy the container. | ||
However, this will not delete the results in the result tables in your database (see `COHORT_SCHEMA`). | ||
``` | ||
docker rm pioneer | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
GITHUB_PAT= | ||
DBMS=postgresql | ||
DB_USER=postgres | ||
DB_PASSWORD=postgres | ||
DB_SERVER=host.docker.internal | ||
DB_PORT=5432 | ||
CONNECTION_STRING=jdbc:postgresql://host.docker.internal:5432/ohdsi | ||
PATH_TO_DRIVER=/usr/local/lib/R/site-library/DatabaseConnectorJars/java | ||
CDM_SCHEMA=cdm_synpuf | ||
COHORT_SCHEMA=pioneer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters