Skip to content

Latest commit

 

History

History
530 lines (451 loc) · 30.3 KB

README.dev.org

File metadata and controls

530 lines (451 loc) · 30.3 KB

Services

Services

docker compose ps
NAME                           IMAGE                                              COMMAND                  SERVICE             CREATED             STATUS              PORTS
wai-sdg-portal-backend-1       python:3.8.5                                       "./dev.sh"               backend             4 hours ago         Up 4 hours
wai-sdg-portal-db-1            postgres:12-alpine                                 "docker-entrypoint.s…"   db                  4 hours ago         Up 4 hours          0.0.0.0:5432->5432/tcp, :::5432->5432/tcp
wai-sdg-portal-frontend-1      akvo/akvo-node-18-alpine:20220923.084347.0558ee6   "run-as-user.sh ./st…"   frontend            4 hours ago         Up 4 hours
wai-sdg-portal-mainnetwork-1   alpine:3.14.0                                      "tail -f /dev/null"      mainnetwork         4 hours ago         Up 4 hours          0.0.0.0:3000->3000/tcp, :::3000->3000/tcp, 0.0.0.0:5050->5050/tcp, :::5050->5050/tcp, 0.0.0.0:8000->8000/tcp, :::8000->8000/tcp
wai-sdg-portal-pgadmin-1       dpage/pgadmin4:5.7                                 "/entrypoint.sh"         pgadmin             4 hours ago         Up 4 hours
wai-sdg-portal-worker-1        python:3.8.5                                       "./worker.sh"            worker              4 hours ago         Up 4 hours

Container Detail

Backend

docker compose top backend | tail -n +2 | head -n -1
UIDPIDPPIDCSTIMETTYTIMECMD
root9462894577012:12?00:00:00bash./dev.sh
root9559494628312:12?00:08:17/usr/local/bin/python/usr/local/bin/uvicornmain:app–reload–port5000
root9559595594012:12?00:00:00/usr/local/bin/python-cfrommultiprocessing.resource_trackerimportmain;main(4)
root9559695594012:12?00:00:49/usr/local/bin/python-cfrommultiprocessing.spawnimportspawn_main;spawn_main(tracker_fd=5,pipe_handle=7)–multiprocessing-fork

Commands

docker compose exec backend ./seed.sh
This script require more than 0 argument/s
Example: ./test.sh [email protected] "My Name" "My Organisation"
docker compose exec backend cat ./seed.sh | grep seeder. | sed 's/#\ //g'
    python -m seeder.administration
    python -m seeder.admin "$@"
    python -m seeder.fake_user 30 "$3"
    python -m seeder.form
    python -m seeder.datapoint "$1"

Frontend

Processes

docker compose -f docker-compose.yml top frontend | tail -n +2 | head -n -1
UIDPIDPPIDCSTIMETTYTIMECMD
root9462094559012:12?00:00:00bash./start.sh
root9482094620012:12?00:00:03node/opt/yarn-v1.22.19/bin/yarn.jsstart
root9484194820012:12?00:00:00usr/local/bin/node/app/node_modules.bin/react-scriptsstart
root9484994841012:12?00:00:21/usr/local/bin/node/app/node_modules/react-scripts/scripts/start.js

Commands

docker compose exec frontend yarn run
yarn run v1.22.19
info Commands available from binary scripts: acorn, ansi-html, autoprefixer, browserslist, browserslist-lint, cross-env, cross-env-shell, css-blank-pseudo, css-has-pseudo, css-prefers-color-scheme, cssesc, detect, detect-port, detective, ejs, escodegen, esgenerate, eslint, eslint-config-prettier, esparse, esvalidate, he, html-minifier-terser, import-local-fixture, is-docker, jake, jest, js-yaml, jsesc, json5, loose-envify, lz-string, mime, mkdirp, multicast-dns, nanoid, nmtree, node-which, parser, prettier, react-scripts, regjsparser, remarkable, resolve, rimraf, rollup, sass, semver, sha.js, svgo, synp, tailwind, tailwindcss, terser, topo2geo, topomerge, topoquantize, uuid, webpack, webpack-dev-server, yarn-audit-fix
info Project commands
   - build
      react-scripts build
   - eject
      react-scripts eject
   - lint
      eslint --config .eslintrc.json src --ext .js,.jsx
   - prettier
      prettier --check src
   - start
      react-scripts start
   - test
      react-scripts test --updateSnapshot --transformIgnorePatterns "node_modules/(?!d3|d3-geo|d3-array|internmap|delaunator|robust-predicates|react-leaflet)/"
   - test:ci
      CI=true react-scripts test --watchAll=false --coverage --transformIgnorePatterns "node_modules/(?!d3|d3-geo|d3-array|internmap|delaunator|robust-predicates)/"
Done in 0.02s.

Worker

docker compose top worker | tail -n +2 | head -n -1
UIDPIDPPIDCSTIMETTYTIMECMD
root9470494679012:12?00:00:00bash./worker.sh
root9558894704312:12?00:08:19/usr/local/bin/python/usr/local/bin/uvicornworker:worker–reload–port5001
root9559095588012:12?00:00:00/usr/local/bin/python-cfrommultiprocessing.resource_trackerimportmain;main(4)
root9559195588012:12?00:00:55/usr/local/bin/python-cfrommultiprocessing.spawnimportspawn_main;spawn_main(tracker_fd=5,pipe_handle=7)–multiprocessing-fork

Database

docker compose top db | tail -n +2 | head -n -1
UIDPIDPPIDCSTIMETTYTIMECMD
709434294316012:12?00:00:00postgres
709463594342012:12?00:00:00postgres:checkpointer
709463694342012:12?00:00:00postgres:backgroundwriter
709463794342012:12?00:00:00postgres:walwriter
709463894342012:12?00:00:00postgres:autovacuumlauncher
709463994342012:12?00:00:00postgres:statscollector
709464094342012:12?00:00:00postgres:logicalreplicationlauncher
709562894342012:12?00:00:00postgres:waiwai_demo172.20.0.3(38228)idle
709562994342012:12?00:00:02postgres:waiwai_demo172.20.0.3(38234)idle
709564294342012:12?00:00:00postgres:waiwai_demo172.20.0.3(38242)idle
7010324294342012:17?00:00:00postgres:waiwai_demo172.20.0.3(36900)idle
7010324394342012:17?00:00:00postgres:waiwai_demo172.20.0.3(36916)idle
7010324494342012:17?00:00:00postgres:waiwai_demo172.20.0.3(36926)idle

Dev

PG Admin

docker compose top pgadmin | tail -n +2 | head -n -1
UIDPIDPPIDCSTIMETTYTIMECMD
50509460894537012:12?00:00:03/venv/bin/python3/venv/bin/gunicorn–timeout86400–bind[::]:5050-w1–threads25–access-logfile--cgunicorn_config.pyrun_pgadmin:app
root9481294608012:12?00:00:00/usr/libexec/postfix/master-w
systemd+9481494812012:12?00:00:00qmgr-l-tunix-u
50509490594608012:12?00:00:09/venv/bin/python3/venv/bin/gunicorn–timeout86400–bind[::]:5050-w1–threads25–access-logfile--cgunicorn_config.pyrun_pgadmin:app
systemd+42584594812015:32?00:00:00pickup-l-tunix-u

Main Network

docker compose top mainnetwork | tail -n +2 | head -n -1
UIDPIDPPIDCSTIMETTYTIMECMD
root9439394363012:12?00:00:00tail-f/dev/null

Database Schema

Table

SELECT relname, relkind
FROM   pg_class
WHERE relreplident = 'd'
AND relhasindex = true;
relnamerelkind
alembic_versionr
administrationr
accessr
question_groupr
formr
questionr
datar
answerr
organisationr
jobsr
logr
optionr
historyr
userr

Relationship

\d
List of relations
SchemaNameTypeOwner
publicaccesstablewai
publicaccess_id_seqsequencewai
publicadministrationtablewai
publicadministration_id_seqsequencewai
publicalembic_versiontablewai
publicanswertablewai
publicanswer_id_seqsequencewai
publicanswer_searchviewwai
publicdatatablewai
publicdata_id_seqsequencewai
publicformtablewai
publicform_id_seqsequencewai
publichistorytablewai
publichistory_id_seqsequencewai
publicjobstablewai
publicjobs_id_seqsequencewai
publiclogtablewai
publiclog_id_seqsequencewai
publicoptiontablewai
publicoption_id_seqsequencewai
publicorganisationtablewai
publicorganisation_id_seqsequencewai
publicquestiontablewai
publicquestion_grouptablewai
publicquestion_group_id_seqsequencewai
publicquestion_id_seqsequencewai
publicscore_viewviewwai
publicusertablewai
publicuser_id_seqsequencewai

Administration

SELECT ordinal_position as pos, column_name, data_type, column_default, is_nullable
FROM   information_schema.columns
WHERE  table_name = 'administration'
ORDER  BY ordinal_position;
poscolumn_namedata_typeudt_namecolumn_defaultis_nullable
1idintegerint4nextval(‘administration_id_seq’::regclass)NO
2parentintegerint4YES
3namecharacter varyingvarcharYES

User

SELECT ordinal_position as pos, column_name, data_type, column_default, is_nullable
FROM   information_schema.columns
WHERE  table_name = 'user'
ORDER  BY ordinal_position;

#+RESULTS[4b85690f95d5625880d544e9c31fa14f9e298a2d]: User Table

poscolumn_namedata_typecolumn_defaultis_nullable
1idintegernextval(‘user_id_seq’::regclass)NO
2emailcharacter varyingYES
3activebooleanYES
4roleUSER-DEFINEDYES
5createdtimestamp without time zoneYES
6organisationintegerYES
7namecharacter varyingYES
8__ts_vector__tsvectorYES
9manage_form_passcodebooleanfalseNO

User Access

SELECT ordinal_position as pos, column_name, data_type, column_default, is_nullable
FROM   information_schema.columns
WHERE  table_name = 'access'
ORDER  BY ordinal_position;

#+RESULTS[adbead29284e379ca968ed55ad3421690c6b1db7]: Access Table

poscolumn_namedata_typecolumn_defaultis_nullable
1idintegernextval(‘access_id_seq’::regclass)NO
2userintegerYES
3administrationintegerYES

Organisation

SELECT ordinal_position as pos, column_name, data_type, column_default, is_nullable
FROM   information_schema.columns
WHERE  table_name = 'organisation'
ORDER  BY ordinal_position;

#+RESULTS[7bf076cc41617ce9589ff081d087599a2e633d13]: Organisation Table

poscolumn_namedata_typecolumn_defaultis_nullable
1idintegernextval(‘organisation_id_seq’::regclass)NO
2namecharacter varyingYES
3typeUSER-DEFINEDYES
4createdtimestamp without time zoneYES

Form

SELECT ordinal_position as pos, column_name, data_type, column_default, is_nullable
FROM   information_schema.columns
WHERE  table_name = 'form'
ORDER  BY ordinal_position;

#+RESULTS[c54a7a04e0e7c6e7bf1a49fdb94c7172fa7246fc]: Forms

poscolumn_namedata_typecolumn_defaultis_nullable
1idintegernextval(‘form_id_seq’::regclass)NO
2namecharacter varyingYES
3descriptiontextYES
4default_languagecharacter varyingYES
5languagesARRAYYES
6translationsARRAYYES
7versiondouble precisionYES

Question Group

SELECT ordinal_position as pos, column_name, data_type, column_default, is_nullable
FROM   information_schema.columns
WHERE  table_name = 'question_group'
ORDER  BY ordinal_position;

#+RESULTS[1fe1ac7968bd4854ec03a82fe25d55d141850691]: Question Group

poscolumn_namedata_typecolumn_defaultis_nullable
1idintegernextval(‘question_group_id_seq’::regclass)NO
2orderintegerYES
3namecharacter varyingYES
4formintegerYES
5descriptiontextYES
6repeatablebooleanfalseYES
7repeat_textcharacter varyingYES
8translationsARRAYYES

Question

SELECT ordinal_position as pos, column_name, data_type, column_default, is_nullable
FROM   information_schema.columns
WHERE  table_name = 'question'
ORDER  BY ordinal_position;

#+RESULTS[2399099ab9d57c0d84c791448f4eccf3835013bf]: Question

poscolumn_namedata_typecolumn_defaultis_nullable
1idintegernextval(‘question_id_seq’::regclass)NO
2orderintegerYES
3namecharacter varyingYES
4formintegerYES
5metabooleanNO
6typeUSER-DEFINEDYES
7question_groupintegerYES
8requiredbooleantrueNO
9rulejsonbYES
10dependencyARRAYYES
11tooltipjsonbYES
12translationsARRAYYES
13apijsonbYES
14addonsjsonbYES

Option

SELECT ordinal_position as pos, column_name, data_type, column_default, is_nullable
FROM   information_schema.columns
WHERE  table_name = 'option'
ORDER  BY ordinal_position;

#+RESULTS[7c5d1e387658b945b174d36b0b2bc525e4df38b9]: Option

poscolumn_namedata_typecolumn_defaultis_nullable
1idintegernextval(‘option_id_seq’::regclass)NO
2orderintegerYES
3namecharacter varyingYES
4questionintegerYES
5colorcharacter varyingYES
6scoreintegerYES
7codecharacter varyingYES
8translationsARRAYYES

Data

SELECT ordinal_position as pos, column_name, data_type, column_default, is_nullable
FROM   information_schema.columns
WHERE  table_name = 'data'
ORDER  BY ordinal_position;

#+RESULTS[2a3966dbeff760e3b1765f1912656e4e9b493ec3]: Data

poscolumn_namedata_typecolumn_defaultis_nullable
1idintegernextval(‘data_id_seq’::regclass)NO
2namecharacter varyingYES
3formintegerYES
4administrationintegerYES
5geoARRAYYES
6created_byintegerYES
7updated_byintegerYES
8createdtimestamp without time zoneCURRENT_TIMESTAMPYES
9updatedtimestamp without time zoneYES

Answer

SELECT ordinal_position as pos, column_name, data_type, column_default, is_nullable
FROM   information_schema.columns
WHERE  table_name = 'answer'
ORDER  BY ordinal_position;

#+RESULTS[694ea6cbed80bd18b74ff098f928b802756b1613]: Answer

poscolumn_namedata_typecolumn_defaultis_nullable
1idintegernextval(‘answer_id_seq’::regclass)NO
2questionintegerYES
3dataintegerYES
4valuedouble precisionYES
5texttextYES
6optionsARRAYYES
7created_byintegerYES
8updated_byintegerYES
9createdtimestamp without time zoneCURRENT_TIMESTAMPYES
10updatedtimestamp without time zoneYES

History

SELECT ordinal_position as pos, column_name, data_type, column_default, is_nullable
FROM   information_schema.columns
WHERE  table_name = 'history'
ORDER  BY ordinal_position;

#+RESULTS[a95c8468e9da820f7161b11e8eb9d7ae064f08bd]: History

poscolumn_namedata_typecolumn_defaultis_nullable
1idintegernextval(‘history_id_seq’::regclass)NO
2questionintegerYES
3dataintegerYES
4valuedouble precisionYES
5texttextYES
6optionsARRAYYES
7created_byintegerYES
8updated_byintegerYES
9createdtimestamp without time zoneCURRENT_TIMESTAMPYES
10updatedtimestamp without time zoneYES

Jobs

SELECT ordinal_position as pos, column_name, data_type, column_default, is_nullable
FROM   information_schema.columns
WHERE  table_name = 'jobs'
ORDER  BY ordinal_position;

#+RESULTS[2a246912a94877079579e5884fcaafb255510972]: Jobs

poscolumn_namedata_typecolumn_defaultis_nullable
1idintegernextval(‘jobs_id_seq’::regclass)NO
2typeUSER-DEFINEDYES
3statusUSER-DEFINED‘pending’::jobstatusYES
4payloadtextNO
5infojsonbYES
6attemptinteger0YES
7created_byintegerNO
8createdtimestamp without time zoneCURRENT_TIMESTAMPYES
9availabletimestamp without time zoneYES

Log

SELECT ordinal_position as pos, column_name, data_type, column_default, is_nullable
FROM   information_schema.columns
WHERE  table_name = 'log'
ORDER  BY ordinal_position;

#+RESULTS[28675ec2c91ade8752e958cc705195948562d3d8]: Log

poscolumn_namedata_typecolumn_defaultis_nullable
1idintegernextval(‘log_id_seq’::regclass)NO
2userintegerYES
3messagetextYES
4attimestamp without time zoneCURRENT_TIMESTAMPYES
5jobsintegerYES