.Stat Suite documentation

Mono-tenant installation of .Stat DE services from gitlab pipeline artifacts

slightly different than the source code approach; git is not mandatory anymore and side-effects related to dependencies are avoided.

pre-requisites:

  • (reminder) an accessible (CORS-enabled, anonymous access enabled) SDMX v6.x endpoint
  • nodejs 12.x and npm 6.x installed
  • git installed ; only to use git bash instead of cmd.exe for process variables
  • solr 7.x installed and running on port 8983 (default) with a core created with solr create -c sdmx-facet-search from solr console
  • redis downloaded and running on port 6379 (default)

notes:

  • solr core name can be freely picked, default configuration targets sdmx-facet-search
  • ports can be freely picked, if different than defaults they should be specified when launching services

summary

from gitlab artifacts summary

1. setup

  1. (temporary) npm i -g cross-env
  2. create folders as follow:
.
├── dotstatsuite
│   ├── config
│   ├── search
│   ├── data-explorer
│   ├── data-viewer
│   ├── share

2. config service

  1. download artifact archives and package.json file from gitlab:
  1. extract archives and organize folders/files as follow:
.
├── dotstatsuite
│   ├── config
│   │   ├── node_modules                       # from setup artifact
│   │   ├── dist                               # from build artifact
│   │   ├── configs                            # see note a
│   │   │   ├── datasources.json               # datasources definition
│   │   │   ├── tenants.json                   # tenants definition
│   │   │   │   ├── default
│   │   │   │   │   ├── data-explorer
│   │   │   │   │   │   ├── i18n
│   │   │   │   │   │   ├── settings.json
│   │   │   │   │   ├── data-viewer
│   │   │   │   │   │   ├── i18n
│   │   │   │   │   │   ├── settings.json
│   │   ├── assets                             # see note b
│   │   │   ├── default
│   │   │   │   ├── data-explorer
│   │   │   │   │   │   ├── images
│   │   │   │   │   │   ├── styles*
│   │   │   │   ├── data-viewer
│   │   │   │   │   │   ├── images
│   │   │   │   │   │   ├── styles*
│   │   ├── package.json

notes:

3 . start the service:

  • (in git bash) run PORT=5007 npm run dist:run
  • check if everything is fine: http://localhost:5007/healthcheck

3. search service

  1. download artifact archives and package.json files from gitlab:
  1. extract archives and organize folders/files as follow:
.
├── dotstatsuite
│   ├── search
│   │   ├── node_modules                       # from setup artifact
│   │   ├── dist                               # from build artifact
│   │   ├── package.json
  1. start the service:
  • (temporary) edit the 1st line of dist/params/production.js as follow: const server = { host: '0.0.0.0', port: 3007 };
  • (in git bash) run PORT=3007 CONFIG_URL=http://localhost:5007 REDIS_HOST=localhost SOLR_HOST=localhost npm run dist:run
  • check if everything is fine: http://localhost:3007/healthcheck
  • check if the config (mostly to check datasources) is fine: http://localhost:3007/api/config
  1. handle index (that are indexable):
  • get config: curl -X GET http://localhost:3007/admin/config?api-key=secret
  • index dataflows: curl -X POST http://localhost:3007/admin/dataflows?api-key=secret -d {}
  • get report: curl -X GET http://localhost:3007/admin/report?api-key=secret
  • delete dataflows and config: curl -X DELETE http://localhost:3007/admin/config?api-key=secret

notes:

  • process variables are SOLR_HOST, SOLR_PORT, REDIS_HOST, REDIS_PORT, CONFIG_URL and PORT
  • PORT is not available yet, which explain why dist/params/production.js should be updated
  • if the config is not fine, update the datasources.json and/or settings.json file(s) in the config service, restart the config service then restart the search service
  • the search service is not coupled with its clients, the search endpoint is configurable from settings.json of the data-explorer app in the config service

4. share service

  1. download artifact archives and package.json files from gitlab:
  1. extract archives and organize folders/files as follow:
.
├── dotstatsuite
│   ├── share
│   │   ├── node_modules                       # from setup artifact
│   │   ├── dist                               # from build artifact
│   │   ├── package.json
  1. start the service:
  • (in git bash) run PORT=3006 CONFIG_URL=http://localhost:5007 REDIS_HOST=localhost SITE_URL=http://localhost:3006 npm run dist:run
  • check if everything is fine: http://localhost:3006/healthcheck

notes:

5. data-explorer app

  1. download artifact archives and package.json files from gitlab:
  1. extract archives and organize folders/files as follow:
.
├── dotstatsuite
│   ├── data-explorer
│   │   ├── node_modules                       # from setup artifact
│   │   ├── dist                               # from build artifact (server files)
│   │   ├── build                              # from build artifact (client bundle)
│   │   ├── package.json
  1. start the service:
  • (in git bash) run SERVER_PORT=3009 CONFIG_URL=http://localhost:5007 npm run start:run
  • check if everything is fine: http://localhost:3008 (proxy with a route mapped to data-explorer)

6. data-viewer app

  1. download artifact archives and package.json files from gitlab:
  1. extract archives and organize folders/files as follow:
.
├── dotstatsuite
│   ├── data-viewer
│   │   ├── node_modules                       # from setup artifact
│   │   ├── dist                               # from build artifact (server files)
│   │   ├── build                              # from build artifact (client bundle)
│   │   ├── package.json
  1. start the service:
  • (in git bash) run SERVER_PORT=3005 CONFIG_URL=http://localhost:5007 npm run start:run