Skip to content

Commit

Permalink
Version 1.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
victor73 committed Sep 27, 2022
1 parent 68ae195 commit 4428a0c
Show file tree
Hide file tree
Showing 8 changed files with 90 additions and 11 deletions.
45 changes: 45 additions & 0 deletions conf/config-docker.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
[global]
drs_domain=localhost

drs_api_version=1.0.0

# The number of cluster processes to start by forking. Can also think of
# this as how many CPUs to use. Use positive integers as values, or just
# set to "auto" to use the number of CPUs detected.
workers=1

# Enable encryption with SSL
https_enabled=false

# The IP address that OSDF should listen on. Use '0.0.0.0' to listen on
# all interfaces that the host has configured.
bind_address=0.0.0.0

# When https_enabled is 'true', these settings must be set to the
# paths to the key, cert and CA files.
key_file=conf/server.key
cert_file=conf/server.crt
ca_file=conf/ca_listing.txt

# The TCP port number to listen on.
port=9999

# The username to run the service as. This setting is only relevant when
# we are invoked as root, for instance, to bind to a low numbered port.
user=nobody

# The MySQL database details, including the database name that we use
# to store the DRS data
mysql_server=drs-db
# The TCP port for the MySQL Server (the port that the server is listening on).
mysql_port=3306
# The username to connect to MySQL with.
mysql_user=hmp_drs
# The password for mysql_user to connect to MySQL with.
mysql_pass=password
# The name of the MySQL database to use.
mysql_dbname=hmp_drs

# The maximum depth level that the server will recurse to when retrieving bundle
# data.
max_recursion=32
11 changes: 11 additions & 0 deletions docker/mysql/1-set-configuration.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
UPDATE mysql.user SET host = '%' WHERE user='root';

CREATE USER 'hmp_drs'@'%' IDENTIFIED BY 'password';

CREATE DATABASE IF NOT EXISTS `hmp_drs`;

GRANT ALL PRIVILEGES ON hmp_drs.* TO hmp_drs@'%';

GRANT ALL PRIVILEGES ON `hmp_drs`.`*` TO `hmp_drs`@`%`;

FLUSH PRIVILEGES;
File renamed without changes.
6 changes: 4 additions & 2 deletions docker/mysql/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ ENV MYSQL_DATABASE hmp_drs

ENV MYSQL_ROOT_PASSWORD=1234

COPY ./set-configuration.sql /docker-entrypoint-initdb.d/
RUN rm -rf /var/lib/mysql

COPY ./hmp-drs.sql /docker-entrypoint-initdb.d/
COPY ./1-set-configuration.sql /docker-entrypoint-initdb.d/

COPY ./2-hmp-drs.sql /docker-entrypoint-initdb.d/
7 changes: 0 additions & 7 deletions docker/mysql/set-configuration.sql

This file was deleted.

6 changes: 4 additions & 2 deletions docker/server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ ARG DEBIAN_FRONTEND=noninteractive
# Update Ubuntu Software repository
RUN apt-get update -y

# install curl
# install curl
RUN apt-get install -y curl

# Run the installation script
Expand All @@ -25,10 +25,12 @@ RUN apt-get install -y nodejs && \

RUN mkdir /src

COPY startup.sh /

WORKDIR /src

EXPOSE 9999

ENV NODE_PATH=.:./lib

CMD [ "node", "drs.js", "--conf", "./conf/config-docker.ini" ]
CMD [ "/bin/bash", "/startup.sh" ]
14 changes: 14 additions & 0 deletions docker/server/startup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

pushd /src >/dev/null

# Check if the node_modules directory, that contains the libraries
# and dependencies is present. If not, run `npm install`.
if [ ! -d node_modules ]; then
echo "----------------------------------------"
echo "No node_modules directory installed. Installing dependencies now."
echo "----------------------------------------"
npm install
fi

node drs.js --config ./conf/config-docker.ini
12 changes: 12 additions & 0 deletions docs/CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
1.1.1
* Reworked startup of the server using a shell script that first checks
if the node_modules directory is present. If the directory is NOT present,
the `npm install` command is run to install the dependencies the server
needs.
* Tweaked names of the SQL files used to build the mysql database container
to ensure they are loaded in the correct order and forced their use.
* Correction to the command line arguments used to start the server in the
server container.

-- Victor <victor73@github.com> Mon, 26 Sep 2022 18:00:00 -0400

1.1.0
* General improvements and refactoring of code.
* Made changes to make the response compatible with the Cavatica system, even though the previous
Expand Down

0 comments on commit 4428a0c

Please sign in to comment.