Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Following are the steps to deploy the terminology server with a specified data set (example shows the testing dataset).

Code Block
# Start by setting information about artifacts and your postgres config, e.g.:
dockerImage=wcinformatics/wci-terminology-service:1.2.01-2023011020240108
dumpUrl=https://wci-us-west-2.s3-us-west-2.amazonaws.com/term-server-v2/data/wci-terminology-db-TEST-20232024.dump
indexUrl=https://wci-us-west-2.s3-us-west-2.amazonaws.com/term-server-v2/data/wci-terminology-indexes-TEST-20232024.zip
PGDATABASE=terminologydb
PGHOST=localhost
PGPORT=5432
PGUSER=postgres
PGPASSWORD=pgP@ssw0rd

# Choose a directory where indexes will live
indexDir=/data/index

# Restore database (see lower in this document for restoring from a plain text dump)
wget -O data.dump $dumpUrl
pg_restore -O -n public -Fc --dbname=$PGDATABASE --username=$PGUSER data.dump

# Unpack indexes
#   NOTE: ensure the docker user will be able to access the index files.
#   NOTE: if deploying with Kubernetes, you will want to use a persistent volume
#         (the other option is to put the data at an accessible URL and
#          the pod can be configured to download that data and unpack it locally)
#
mkdir -p $indexDir
wget -O $indexDir/index.zip $indexUrl
unzip $indexDir/index.zip -d $indexDir
chmod -R 777 $indexDir

# Pull and run docker image (use -d to put it in the background)
#  NOTE: these commands assume "sudo" is required to run docker
#        and expose the process on port 8080 of the machine
sudo docker run -d --rm -e PGHOST=$PGHOST -e PGPORT=$PGPORT -e PGUSER=$PGUSER -e PGPASSWORD=$PGPASSWORD \
     -e PGDATABASE=$PGDATABASE -p 8080:8080 -v "$indexDir":/index $dockerImage

...