How to enable call caching using database.

In the document, for call caching, In order for call caching to be used on any previously run jobs, it is best to configure Cromwell to point to a MySQL database instead of the default in-memory database.

How to configure to use database? As long as database information provided and call caching flag is enabled in configuration file, will call caching automatically point to the defined database?

Thanks
Jing

Answers

  • ChrisLChrisL Cambridge, MAMember, Broadie, Moderator, Dev ✭✭

    That's correct - if your config file specifies a database (like in https://cromwell.readthedocs.io/en/stable/Configuring/#database) then it will automatically be used by Cromwell.

    To enable call caching you need to opt-in via a few extra config options: https://cromwell.readthedocs.io/en/stable/Configuring/#call-caching

  • EADGEADG KielMember ✭✭✭

    Hi @lij41,

    A while ago I wrote are a short manual for my colleagues, maybe it is helpful for you too:
    A short guide to run MySQL-DB in a docker-container and use it for cromwell-server.
    Prerequisite:
    => cromewell >= 29 (https://github.com/broadinstitute/cromwell/releases)
    => docker already installed (https://docs.docker.com/engine/installation/)

    1) Pull the MySQL docker image from dockerhub:
    docker pull mysql:5.5 (You can choose another version if you want)

    2) Start the MySQL docker container with the following line:
    docker run -p 3306:3306 --name NameOfTheContainer -e MYSQL_ROOT_PASSWORD=YourPassword-e MYSQL_DATABASE=DatabaseName -e MYSQL_USER=ChooseAName -e MYSQL_PASSWORD=YourOtherPassword -d mysql/mysql-server:latest
    The -p option maps the standard port 3306 from the container to the 3306 on your machine running the container, this is necessary for cromwell to communicate with the database inside the docker container. You can choose names and passwords freely but keep them in mind for the cromwell configuration file.

    3) Update your application.conf file.
    database { profile = "slick.jdbc.MySQLProfile$" db{ driver = "com.mysql.jdbc.Driver" url = "jdbc:mysql://localhost/DatabaseName?useSSL=false" user = "ChooseAName" password = "YourOtherPassword" connectionTimeout = 5000 } }

    Add the line above, below the all other lines in your application.conf. Replace "DatabaseName","ChooseAName" and "YourOtherPassword" with the values you choose in step 2, preserving the double qoutes.

    Test it, by running your server with the updated application.conf.
    java -Dconfig.file=/path/to/application.conf/ -jar ...

    The guide was tested on Debian 8.
    ```

    Greetings EADG

  • danbdanb Member, Broadie

    I attempted a minimal DB config w/ call caching here

Sign In or Register to comment.