Skip to content

Commit

Permalink
[WX-1184] PostgreSQL Docker Image for Local Cromwell (#7172)
Browse files Browse the repository at this point in the history
Co-authored-by: Janet Gainer-Dewar <[email protected]>
  • Loading branch information
THWiseman and jgainerdewar authored Jan 23, 2024
1 parent 20b5945 commit cb53732
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Repo template: Cromwell server TES Postgres" type="Application" factoryName="Application">
<option name="ALTERNATIVE_JRE_PATH" value="$USER_HOME$/.sdkman/candidates/java/current" />
<envs>
<env name="CROMWELL_BUILD_CENTAUR_256_BITS_KEY" value="AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=" />
<env name="CROMWELL_BUILD_CENTAUR_JDBC_DRIVER" value="org.postgresql.Driver" />
<env name="CROMWELL_BUILD_CENTAUR_JDBC_URL" value="jdbc:postgresql://localhost:5432/cromwell_test?reWriteBatchedInserts=true" />
<env name="CROMWELL_BUILD_CENTAUR_READ_LINES_LIMIT" value="128000" />
<env name="CROMWELL_BUILD_CENTAUR_SLICK_PROFILE" value="slick.jdbc.PostgresProfile$" />
<env name="CROMWELL_BUILD_PAPI_JSON_FILE" value="target/ci/resources/cromwell-centaur-service-account.json" />
<env name="CROMWELL_BUILD_RESOURCES_DIRECTORY" value="target/ci/resources" />
</envs>
<option name="MAIN_CLASS_NAME" value="cromwell.CromwellApp" />
<module name="cromwell" />
<option name="PROGRAM_PARAMETERS" value="server" />
<option name="VM_PARAMETERS" value="-Dconfig.file=src/ci/resources/tes_application.conf" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
</component>
5 changes: 5 additions & 0 deletions scripts/docker-postgres/postgresql-initdb.d/init.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash

cat << EOF >> /var/lib/postgresql/data/postgresql.conf
max_connections = 300
EOF
1 change: 1 addition & 0 deletions scripts/docker-postgres/postgresql-initdb.d/init.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
create extension lo;
19 changes: 19 additions & 0 deletions scripts/docker-postgres/start_postgres_docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# This script will launch a Postgres 11.3 container with parameters matching the expectations of Cromwell's CI configuration
# You can run cromwell locally using this container as its DB.
# Your intelliJ repo template or cromwell config should provide the following environment variables:
# CROMWELL_BUILD_CENTAUR_JDBC_DRIVER="org.postgresql.Driver"
# CROMWELL_BUILD_CENTAUR_SLICK_PROFILE="slick.jdbc.PostgresProfile$"
# CROMWELL_BUILD_CENTAUR_JDBC_URL="jdbc:postgresql://localhost:5432/cromwell_test?reWriteBatchedInserts=true"

set -euo pipefail

CURRENT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )

docker run \
--name=cromwell_postgres_test_db \
--env POSTGRES_USER=cromwell \
--env POSTGRES_PASSWORD=test \
--env POSTGRES_DB=cromwell_test \
--volume ${CURRENT_DIR}/postgresql-initdb.d:/docker-entrypoint-initdb.d \
--publish 5432:5432 \
--rm postgres:14

0 comments on commit cb53732

Please sign in to comment.