Skip to content
This repository has been archived by the owner on Jan 30, 2024. It is now read-only.

equinor/dm-app-analysis-platform

Repository files navigation

Analysis platform

This application has been created with create-dm-app

Getting started

By following these steps, you will have the application up and running locally on your machine.

Requirements:

1) Start required services

To run the Analysis Platform application locally, you will need an instance of DMSS running locally.

Go to the dm-app-analysis-platform folder in a terminal and run the commands:

docker-compose pull
docker-compose up --build

This will start all required services.

To reset the database, open a new terminal window and navigate to the dm-app-analysis-platform folder and run the commands:

docker-compose run --rm dmss reset-app

2) Install dm-cli

Note: it is recommended to use a python virtual environment before you install the dm-cli package

pip install dm-cli

4) Upload documents/models to DMSS

Run the following command to upload the documents in the folder my-app/app to DMSS

dm reset app/

You must also upload documents from dm-job

docker-compose run --rm job-api dm -u http://dmss:5000 reset ../app

5) Create a lookup table in DMSS

In your terminal window, go to the dm-app-analysis-platform folder in the terminal and run

dm create-lookup analysis-platform AnalysisPlatformDS/instances/recipe_links

6) Start the web application

When inside the dm-app-analysis-platform folder in the terminal, run

yarn install
yarn start

or alternatively

npm install
npm start

The web app can now be reached at http://localhost:3000 in the web browser. (Remember, you must have the docker-compose services running to use the web application)

Development tips

Database setup

Oneliner to get database up and running:

docker-compose run --rm dmss reset-app && dm reset app && docker-compose run --rm job-api dm -u http://dmss:5000 reset ../app && dm create-lookup analysis-platform AnalysisPlatformDS/instances/recipe_links

Pre commit

In this repo, pre-commit has been used to ensure consistent code formatting. The pre-commit hook will run prettier formatting and analyze the JavaScript code using eslint .

To run pre-commit, it needs to be installed on your local machine with

pip install pre-commit

Once installed, pre-commit can be run with:

pre-commit run --all-files