EXODUS Knowledge

From NEOSYS Technical Support Wiki
Revision as of 13:51, 6 July 2021 by Gregory (talk | contribs)
Jump to navigationJump to search

EXODUS Intro

EXODUS is the new version of NEOSYS, which has been converted to Linux, C++ and postgres. It is comprised of two main sections: Overview:

  • EXODUS is a complete conversion of the AREV's CRUD and web service framework. (https://github.com/exodusdb/exodusdb)
  • NEOSYS is the complete conversion of the NEOSYS Agency AREV programs. (not public git)

Programs such as post vouchers, invoice schedules, print booking orders, list media invoices, ledgerprint e.t

TMUX Screens

To create the EXODUS maintenance/programming environment

exodus#: ./tmux.exodus
SCREEN NAME      STANDARD PATH                            PURPOSE
#ex1_root        - /root                                  - general usage 
#exodus          - /root/exodus                           - 
#exodus src      - /root/exodus/exodus/libexodus/exodus   - 
#exo cli         - /root/exodus/cli/src                   - 
#service         - /root/exodus/service                   - 
#ser src         - /root/exodus/service/src               -
#neosys          - /root/neosys                           - ./doall
#neo src         - /root/neosys/src                       -
#hosts           - /root/hosts                            -   
#test src        - /root/exodus/test/src                  - 
#t10             - ~/                                     - 
#t11             - ~/                                     - 
#t12             - ~/                                     - 


Object Code/Libraries

LIVE and TEST processes use different sets of object code. TEST processes use libraries in ~/lib/, whereas LIVE processes use object code in ~/neo/lib

This means development & testing can be done stress free on TEST database, as apposed to testing on production databases.

When compiling using edic, the TEST object code is updated if the compilation is successful. (~/lib) In order to apply a tested patch to LIVE see Update LIVE programs.

Dictionaries

Dictionaries, the files used to describe the fields of a file's record. Unlike in AREV, there is a copy of all dictionaries in each pgsql database. (In AREV updating a dictionary would affect all the databases)

Processes

The TEST process for all database use the same object code stored in /root/lib, whereas all LIVE process use the object code in /root/neo/.

Postgres

Connect into postgres shell:

sudo -u postgres psql

List databases once in postgres shell:

\l

Delete a database:

sudo -u postgres dropdb <dbcode>

./doall

General

Screen 6: ./doall script contains all the necessary information(codes) to setup a installation. It includes scripts to backup, restore, create a Apache site, create/start/stop/status a service, import a AREV database into postgres and more.

backup_db

  • Does a backup & restore of a LIVE database into the corresponding TEST database.
  • Backup <dbcode>.sql file is written to /root/backups/sql; which is rsynced to nl19:/backups/current/exodus/
  • Unlike AREV, postgres can perform a "backup" of a database whilst the system is in use.


Debugging NEOSYS EXODUS C++ gdb

Two scripts can be used to start a process in debug mode. (WARNING: other running TEST or LIVE processes for client will stop during debugging) Screen 6: ./test will use the TEST program object code. and ./run will use the LIVE object code.

  1. Do ./test or ./live <dbcode>
  2. Enter debugger: Ctrl +C
  3. Set Breakpoint(s), enter:
  • b <programname>:<lineNo> or
  • b functionname>
  1. Press y to add break point to a library that will be called in future.
  2. Enter "r" to restart process, or "c" to continue.
  3. Replicate issue in wGUI.


Useful EXODUS bash environment Variables

Set these bash environment vars for the desired effect:

  • EXO_DBTRACE=1 - activate printing of pgsql errors on next started process. (by default not set)
  • EXO_DEBUG=1 - activate debug mode
  • EXO_DBNAME=<dbname>" - switch to required database for next commands e.g listfiles or list companies (default db code is test)


Edit programs/data records

Edit programs:

edic <program name>

e.g edic LISTJOBINVS or e LISTJOBINVS (works on anywhere)

Info:

  • edic works in any screen.
  • If edic cannot find the program name, then it offers to create a basic program or header file instead.
  • If you save and exit edic, the program is automatically compiled and the new object code is put into /lib. (used only by TEST processes)

Edit sql data records:

edir <file> <key> [fieldNo]  

e.g edir companies D 1

Edit OS files:

edir DOS <file> [field] [value]

e.g edir DOS work/system.cfg

Compiling

compile <filename> 

If successful, updates program's .so file in /lib. (used only by TEST processes)

Apply patch for Test

  1. edic <programname>
  2. Save, exit and compile.
  3. Restart TEST processes - in order to load new object code in to memory.
  4. Check & test patch/change in WGUI (test database).

WARNING: This will UPDATE ALL CLIENT LIVE installations. (DO NOT USE)

~/neosys/src/copytest
   

Maintenance F5 equivalent

AREV Maintenance mode F5 equivalent do ./run or ./test, press key "x" and enter command. (e.g CHK.FILES, CHKLIC, CRETEALERTS)


Converting AREV to Exodus

Convert Programs

In AREV:

  1. Update program source code and check it can be compiled.
  2. Ensure the program you want to recompile into exodus has below e.g "*c job" in source code on line 2, col 1
  3. Command: "attach adecomc" #attaches exodus recompiler/decompiler
  4. Command: "adecom <programname>"

In Cygwin:

  1. Run "cygdrive/d/exodus/pickos/syncup.sh" #syncs all decompiled programs to nl19:/backups/current/hosts/win3/pickos/

In Exodus:
Command explanations:

  1. rsync arev decompiled code from sshfs /backups/current/win3/pickos/
getpickos
  1. There are three "getpickos" & "compall".

TODO down

  • cd exodus/service/src getpickos && compall
  • cd ~/neosys/src && getpickos && compall
  • cd ~/neosys/src && getpickos && compile <progname> or
  • WARNING following command is DANGEROUS! all LIVE object code updated and all LIVE/TEXT process restarted!
    • INCLUDES: "exodus compall" and "neosys compall" and "copyall" and "restart all"!
      • Use with caution: "cd ~/neosys && compall"

cd exodus/service copyall TODO up

Convert dictionary items

Two methods: a) Quick exodus patch (next sync-up from overwrite with win10a version) b) Update exodus from AREV

Quick Method

  1. Update dict item in win10a
  2. In exodus run command "e dicta2e"
  3. Paste below and edit for your case:
#include <exodus/program.h>
programinit()

function main() {
    var originalvalue;

    //edit the string
    var replacevalue="Line Description";

    //check the value of the field TO replace
    //SYNTAX: readv(<record/field> from <filename>, <key> [,field])
    readv(originalvalue from "DICT_JOB_INVOICES", "LINE_TEXT", 3);
    outputl("REPLACE:"^quote(originalvalue)^" with "^quote(replacevalue));

    //uncomment below 2 lines AFTER using check above
    //writev(replacevalue from "DICT_JOB_INVOICES", "LINE_TEXT", 3);
    outputl("REPLACED:"^quote(originalvalue)^" with "^quote(replacevalue));
    return 0;
}

programexit()
  1. Save, exit and make sure complied.
  2. ./doall TEST all bash dicta2e
  3. Check changes on a TEST database.
  4. ./doall LIVE all bash dicta2e


Safe Method

In AREV:

  1. Update dict item in win10a
  2. attach adecomc
  3. adecom <dictfile> (e.g adecom dict.production.invoices)
  4. base2sql

In Cygwin:

  1. ./d/exodus/pickos/syncup.sh

In Exodus:

  1. neosys/src/getpickos
  2. ./doall all import_db R

Renew dict items for xxx_test database:

  • doall all create_testdb - will use mornings backup
  • doall all backup_db - will use latest version of database
  1. Check dictionary item in the <dictfile>.cpp file & effect on website.


Hosted EXODUS

ex1 (exodus win3) nightly backup all databases. (see crontab)

Client Hosted EXODUS