1. Using the Developer Edition¶
The simplest form of running the Trovares xGT application is to run the Docker image while publishing a port number to connect xgt clients.
1.1. Running an Isolated Server¶
Using this launch sequence allows users to connect a client to the running server inside the Docker container. For this type of server launch, all data ingest operations must go through the client.
$ docker run --rm --name xgt -d --publish 4367:4367 trovares/nonroot-xgt
After issuing this command, the following python script should run:
import xgt
server = xgt.Connection()
config = server.get_config()
print("\n".join([f"{k} = {v}" for k,v in sorted(config.items())]))
For this and all subsequent examples, the running Docker container can be terminated using this command:
$ docker stop xgt
1.2. Running with a Data Sandbox¶
Using this launch sequence allows users to connect a client to the running server inside the Docker container and provide access to the host filesystem for direct data file access from the server to a host filesystem directory. For this type of server launch, data ingest operations can go through the client or directly from the bind mapped host filesystem directory.
$ docker run --rm --name xgt -d --publish 4367:4367 \
--volume $PWD/data:/data trovares/nonroot-xgt
This command will use the $PWD/data
directory on the host filesystem as the location from which to ingest data directly into the server and the location where the server will save data to files.
To see an example of the server saving some data into a file (on the host filesystem), run this python script:
import xgt
server = xgt.Connection(auth = xgt.BasicAuth('admin'))
server.run_job("MATCH (j:xgt__Running_Jobs) RETURN j INTO jobs_history")
jobs_history = server.get_frame('jobs_history')
jobs_history.save('xgtd://jobs_history.csv', headers=True)
This program should result in the Trovares xGT server saving some data into $PWD/data/jobs_history.csv
.
1.3. Running with a Custom Configuration¶
The first step is to get the Trovares xGT application to populate a host filesystem with the configuration files it uses.
Run this command to initially populate an empty directory with the default configuration files.
$ docker run --rm --name xgt -d --volume $PWD/conf:/conf trovares/nonroot-xgt
This can be terminated immediately by running:
$ docker stop xgt
The $PWD/conf
directory should now contain default configuration files that look something like this:
$ ls -l conf
total 20
-rw-rw-r-- 1 userid userid 1285 Dec 29 08:00 audit.properties
-rw-rw-r-- 1 userid userid 26 Dec 29 08:00 grouplabel.csv
-rw-rw-r-- 1 userid userid 15 Dec 29 08:00 label.csv
drwxrwxr-- 2 userid userid 4096 Jan 16 17:59 licenses/
-rw-rw-r-- 1 userid userid 263 Jan 16 17:59 xgtd.conf
You can now update any of these configuration files to suit your local requirements. Once updated, launch the Trovares xGT application again, and it will use your updated configuration.
$ docker run --rm --name xgt -d --publish 4367:4367 \
--volume $PWD/data:/data \
--volume $PWD/conf:/conf \
trovares/nonroot-xgt