OHDSI Home | Forums | Wiki | Github

Achilles and Docker Setup

While I was trying to implement Achilles, I ran into some issues. I was trying to use the Docker version as described by the information found at this link: Creates Descriptive Statistics Summary for an Entire OMOP CDM Instance • Achilles (accessed from the Achilles GitHub repository). The relevant portion is shown below,


The issue I have is that the files env_vars.sample and docker-compose.yml.sample don’t seem to exist. I’m wondering if the files exist and I’m not seeing them or if the documentation needs to be adjusted? Thanks in advance.

Same here… anybody knows where is that file? From a previous version this file has:

ACHILLES_SOURCE=<source_name>
ACHILLES_DB_URI=<db_uri>
ACHILLES_CDM_SCHEMA=<cdm_schema>
ACHILLES_VOCAB_SCHEMA=<vocab_schema>
ACHILLES_RES_SCHEMA=<results_schema>
ACHILLES_CDM_VERSION=<cdm_version>
ACHILLES_OUTPUT_BASE=<mounted_output_dir>

Also, within the old version I got there is a Dockerfile. Now, there is not.

Hi guys,

Check this image

https://hub.docker.com/r/odysseusinc/rstudio-ohdsi

You could use RSudio on that image to run Achilles.

At the R-studio terminal (using jposada’s suggested docker image) I was able to run

install.packages(“devtools”)
devtools::install_github(“OHDSI/Achilles”)

now, the question is how to configure Achilles and run Achilles from this environment. Any suggestions, please?

I think these instructions should work

Let me see if I understand some instructions. Since I am using postgres I need to use:

library(Achilles)
connectionDetails <- createConnectionDetails(
  dbms="postgres", 
  server="mydata.server.edu", 
  user="secret", 
  password='secret', 
  port="5432")

In my case, the Atlas server is: https://hsc-ctsc-atlas.health.unm.edu/
where:

Source Daimons

Results atlas_results
Temp atlas_temp
Vocabulary mdcr2003_2016
CDM mdcr2003_2016
CEM
CEMResults

In my Atlas the source name is Truven.

SingleThreading:

achilles(connectionDetails, 
  cdmDatabaseSchema = "mdcr2003_2016", 
  resultsDatabaseSchema="atlas_results",
  vocabDatabaseSchema = "mdcr2003_2016",
  numThreads = 1,
  sourceName = "Truven", 
  cdmVersion = "5.3.0",
  runHeel = TRUE,
  runCostAnalysis = TRUE)

Fur Multithreading:

achilles(connectionDetails, 
  cdmDatabaseSchema = " mdcr2003_2016", 
  resultsDatabaseSchema = "atlas_results",
  scratchDatabaseSchema = "scratch",
  vocabDatabaseSchema = "mdcr2003_2016",
  numThreads = 10,
  sourceName = "Truven", 
  cdmVersion = "5.3.0",
  runHeel = TRUE,
  runCostAnalysis = TRUE)

Is this syntax correct? as far as I know we do not have the scratch schema.

Thanks again

That seems ok to me. And I believe you do need to have/create a scratch schema for the temp tables that are created. Let me tag @Ajit_Londhe for final confirmation.

Is there a way to change the ohdsi user’s password at the R dev studio site?
Found this:

https://statistics.byu.edu/how-to-change-rstudio-password

Did you face the next error:

library(Achilles)
Loading required package: DatabaseConnector
Error: package or namespace load failed for ‘Achilles’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]):
namespace ‘rlang’ 0.4.7 is already loaded, but >= 0.4.10 is required
On the installation I always choose 1 to update all libraries.

For the username and password I will as @Konstantin_Yaroshove help.

For the error regarding the library version please check libPaths() has the right order in the library locations. This is the order in which the library appears after executing that command determines the order of preference for any library you load, and this includes lazy loading. You can modify the order by passing the right order by doing something light this

.libPaths(c(path1, path2))

Hopefully this should help you.

I believe there is a problem with the version of R in the docker container. I am trying a newer version to confirm. Just in case, here it is the content of my Dockerfile:

---------------------------------------------------------------------------------------------------------------------

To build this image:

docker build -t jcabrerazuniga/rstats:v1 .

FROM ubuntu:18.04
MAINTAINER Jose Cabrera Zuniga

Environment variables

ENV JAVA_HOME /opt/javaSDK
ENV JRE_HOME ${JAVA_HOME}/jre
ENV R_HOME /opt/R

I have Java 8 in a folder called javaSDK

ADD javaSDK ${JAVA_HOME}

RUN apt-get update
&& apt-get install wget unzip zip -y

RUN wget https://cran.r-project.org/src/base/R-4/R-4.1.0.tar.gz
RUN tar -xf R-4.1.0.tar.gz -C /opt/
RUN mv /opt/R-4.1.0 /opt/R
RUN apt-get install -y mc
RUN apt-get install -y build-essential g++ gcc automake autoconf gnu-standards autoconf-doc libtool gettext autoconf-archive gfortran
RUN apt-get install -y libreadline-dev
RUN apt-get install -y zlib1g
RUN apt-get install -y xorg-dev openssl
RUN apt-get update
RUN apt-get install -y bzip2 libbz2-dev liblzma-dev libpcre2-dev python libcurl4-gnutls-dev
RUN cd /opt/R && ./configure && make && make install

-------------------------------------------------------------------------------------------------------------------

For the username and password I will as @Konstantin_Yaroshove help.
As it’s a linux user, you can open Terminal tab in RStudio and type passwd command to change the password.

Can you please tell me what should be the value for sourceName in:

achilles(connectionDetails, 
  cdmDatabaseSchema = " mdcr2003_2016", 
  resultsDatabaseSchema = "atlas_results",
  scratchDatabaseSchema = "scratch",
  vocabDatabaseSchema = "mdcr2003_2016",
  numThreads = 10,
  sourceName = "Truven",   <------- 
  cdmVersion = "5.3.0",
  runHeel = TRUE,
  runCostAnalysis = TRUE)

Is it the same as the one used at the Source field located at the Atlas config page for a source?

Yes, you can use the same name as in ATLAS or any other. It will be visible in Dashboard report:

While running Achilles I saw:

|======================================================================| 100%
2021-09-13 15:43:04 Temporary Achilles tables removed from schema achilles_scratch
|======================================================================| 100% |======== | 12%

And:

select t.table_name
from information_schema.tables t
where t.table_schema = ‘achilles_scratch’
order by t.table_name;
table_name

tmpach_dist_1510
tmpach_dist_1511
tmpach_drug_cost_raw
tmpach_overallstats_1502
tmpach_overallstats_1503
tmpach_overallstats_1504
tmpach_overallstats_1505
tmpach_overallstats_1506
tmpach_overallstats_1507
tmpach_overallstats_1508
tmpach_overallstats_1509
tmpach_overallstats_1602
tmpach_overallstats_1603
tmpach_overallstats_1604
tmpach_overallstats_1605
tmpach_overallstats_1606
tmpach_overallstats_1607
tmpach_overallstats_1608
tmpach_procedure_cost_raw
tmpach_statsview_1502
tmpach_statsview_1503
tmpach_statsview_1504
tmpach_statsview_1505
tmpach_statsview_1506
tmpach_statsview_1507
tmpach_statsview_1508
tmpach_statsview_1509
tmpach_statsview_1602
tmpach_statsview_1603
tmpach_statsview_1604
tmpach_statsview_1605
tmpach_statsview_1606
tmpach_statsview_1607
tmpach_statsview_1608
(34 rows)

Is there a way to be sure Achilles did not get stuck?

Thanks

the logs should indicate if any errors in the scratch tables occurred

you mean the logs on the terminal?
is there a folder/file where I can find the logs?
do you know their location?

Thanks

I just got the next error at the R terminal:

Error in unserialize(socklist[[n]]) : ‘connection’ must be a connection

Can you please tell me what this means?

Thanks

The achilles logs are within the R session’s file system, wherever you ran achilles. You may need to docker exec bash to get to them.

Hmm, not sure. Can you restart your R session?

t