-
Notifications
You must be signed in to change notification settings - Fork 16
Getting Started
In order to get DeepLynx set up in a local environment for development and testing purposes, please follow these steps and requirements:
Requirements
- node.js 8.x, 10.x, 12.x, 14.x, 15.x, and 16.x
- Typescript ^4.x.x
- npm ^7.x
- Docker ^18.x - optional - for ease of use in development
- Private RSA key. This is used for encryption of sensitive data. If you need help on generating a private key, we recommend using
openssl
to do so. Here is a tutorial.
Data Source Requirements
- Required - PostgreSQL ^11.x
- Redis ^6.x - required only if not using the in-memory cache system. We highly recommend that you use Redis over in-memory in a production environment, especially if you're planning on running DeepLynx in a clustered environment.
Steps
-
NodeJS must be installed. You can find the download for your platform here: https://nodejs.org/en/download/ note - Newer versions of Node may be incompatible with some of the following commands. The most recent version tested that works fully is 16.13.0 - the latest LTS version.
-
Clone the DeepLynx repository.
-
Run
npm upgrade && npm install
in your local DeepLynx directory.
-
Copy and rename
.env-sample
to.env
. -
Update
.env
file. See thereadme
or comments in the file itself for details. If you are not using Docker, ensure that you update the ENCRYPTION_KEY_PATH environment variable in.env
to reflect the absolute path of a RSA private key. -
Run
npm run build:dev-with-web
to build the internal modules and bundled administration GUI. -
optional - If you would like to use Docker rather than a dedicated PostgreSQL database, please follow these steps:
- Ensure Docker is installed. You can find the download here: https://www.docker.com/products/docker-desktop.
- Run
npm run docker:postgres:build
to create a docker image containing a Postgres data source. - Mac users may need to create the directory to mount to the docker container at
/private/var/lib/docker/basedata
. If this directory does not exist, please create it (you may need to usesudo
as insudo mkdir /private/var/lib/docker/basedata
). - Verify that image is properly created. See below.
- Run
npm run docker:postgres:run
to run the created docker image (For Mac users, there is an alternative commandnpm run mac:docker:postgres:run
).
-
Run
npm run migrate
to create the database and schema within a PostgreSQL database configured in the.env
file.
-
A private key file is required to start DeepLynx. This file is used for various processes related to user management, data export, etc. A key file can be created by simply using the OpenSSL library. A command such as
openssl genrsa -out private-key.key 2048
will create a private key that will be safely ignored by the.gitignore
. After the private key file is created, please provide the path to it with theENCRYPTION_KEY_PATH
environment variable. -
Run
npm run watch
ornpm run start
to start the application. See thereadme
for additional details and available commands.
Note: DeepLynx ships with a Vue single page application which serves as the primary UI for the DeepLynx system. While you can run this separately (and it's recommended to do so if you're developing it) we suggest you use the npm run start-with-web
command or npm run build:dev-with-web
and npm run start
to build and deploy the included Vue app alongside DeepLynx. This process may take a few minutes each time.
The bundled admin web GUI can be accessed at {{your base URL}}/gui
Installation Gotchas
-
When running
npm run migrate
you should see some kind of output regardless of success or failure. If you see no output, but the program exits without errors do not assume the migrate ran correctly. Check your node version as silent errors of this type are generally present when running an unsupported node version. -
If you have installed a version of PostgreSQL and are attempting to use the Docker version of PostgreSQL included in this repository, you will need to insure that your local copy of Postgres is not currently running. It will prioritize itself over the Docker PostgreSQL.
-
If you're planning on uploading actual files you must have the
FILE_STORAGE_METHOD
set. If you're using thefilesystem
storage method, insure that you have also setFILESYSTEM_STORAGE_DIRECTORY
and that it points to a directory that the DL instance has read/write permissions to. -
You must provide a valid RSA private key to DeepLynx so that it can store encrypted information. DeepLynx will only error on those operations if you're missing the key, so you might not catch that until later.
-
If you are having difficulties authenticating in the Admin Web GUI (when using it in a non-bundled moded) - insure that you've setup the OAuth Application correctly and that the Admin Web GUI is configured correctly. Find more information here.
-
When attempting to access the bundled admin web GUI at
{{your base URL}}/gui
fails, insure that you have either runnpm run build:dev-with-web
prior to runningnpm run start
, or simply usenpm run start-with-web
to combine theses steps. -
When using the Dockerfile you must insure you update the environment variables inside the Dockerfile itself with the proper values.
Here are a few simple ways you can verify that your installation of DeepLynx is working correctly.
-
Tools like Postman can be used for verifying HTTP response/requests and TablePlus or PgAdmin can be used when verifying database structure or values.
-
Send a simple GET request to your DeepLynx instance's health check endpoint. This is located at
{host}/health
and should return a 200 OK HTTP status response if DeepLynx is up and running correctly. (You can find where DeepLynx is exposing it's HTTP server by checking theROOT_ADDRESS
andSERVER_PORT
environment variables - by default it should belocalhost:8090
). -
Navigate to your DeepLynx's login page (default is http://localhost:8090/). If you had your environment variables instruct DeepLynx to create a default User, attempt to login with said User.
-
If you're using the bundled admin web gui navigate to
{{your base url}}/gui
- you should see the following screen
Now that DeepLynx is up and running, it is time to create a demo environment.
The following steps are needed to create a demo environment:
- Create an Application Needed only if not using the bundled web app
- Setup Admin GUI Needed only if not using the bundled web app
- Load the DIAMOND Ontology
- Creating Test Data
Sections marked with ! are in progress.
- HTTP Authentication Methods
- Generating and Exchanging API Keys for Tokens
- Creating a DeepLynx Enabled OAuth2 App
- Authentication with DeepLynx Enabled OAuth2 App
- Creating an Ontology
- Creating Relationships and Relationship Pairs
- Ontology Versioning
- Ontology Inheritance
- Querying Tabular (Timeseries) Data
- Timeseries Quick Start
- Timeseries Data Source
- Timeseries Data Source via API
- Exporting Data
- Querying Data
- Querying Timeseries Data
- Querying Jazz Data
- Querying Data - Legacy
- Querying Tabular Data