FPS Shell And MTG Configuration
Shell Configuration
MTG_ROOT
Set MTG_ROOT to point to the directory that contains the FPS code.
MTG_JOB
MTG_TOOLSET
These values are used if no command line options were supplied.
PYTHONPATH
Add the FPS Python modules to the Python path. The directory will be $MTG_ROOT/python/modules
Add $MTG_ROOT/python/bin to the PATH environment variable.
For developers, add $MTG_ROOT/postgres/bin to the PATH environment variable.
MTG Configuration
Pick a job name. The job name should be all lowercase and only a few characters in length.
Database Admin
Create admin users for the database server. The admin users need the ability to create and delete databases.
Create the Databases
For a new job, create the following databases using the job name. The "dev", "test", and "prod" represent the tool set type.
dev_<job_name>
Development database, used by developers to write tools.
test_<job_name>
Test database, used to test new tools, migrations to new schemas, etc.
prod_<job_name>
Production database.
There is one setup tool called pdm_tool. It is located in mtg_pub/trunk/sbin.
The tool uses the -job and the -dev, -test, -prod flags on the command line.
The bonus is that if you setup the config file correctly and then you don't have to remember any of that stuff. You just need to know the job name and the release.
To setup everything new:
pdm_tool -job <job_name> -dev setup_db
pdm_tool -job <job_name> -test setup_db
pdm_tool -job <job_name> -prod setup db
Be sure to read the prompts when you are doing the setup. You will be prompted for the password a couple of times. Use the password you have in your config file.
To delete your current schema and load test data:
pdm_tool -job <job_name> -dev dismantle_schema
pdm_tool -job <job_name> -dev load_test_data
To create the schema fresh, ready to be loaded with pdm_test:
pdm_tool -job <job_name> -dev dismantle_schema
pdm_tool -job <job_name> -dev setup_schema
run pdm_test
To dump the schema as test data:
pdm_tool -job <job_name> -dev dump_test_data
The dump_test_data function can be followed with either 'sm', 'md', or 'lg' to dump the small, medium, or large test data set. The default (nothing specified) is small. For example:
pdm_tool -job <job_name> -dev dump_test_data lg
would dump the schema into the large data set file.
Database Users
All users of a database will need username/password access to the database.
Create the MTG Config Files
Config files go in
$MTG_ROOT/config
There should be the following config files for a job:
job_dev_<job_name>.cfg
job_test_<job_name>.cfg
job_prod_<job_name>.cfg
Use job_template.cfg as a starting point. Change the values in the file as necessary.
Create the MTG Env Files
Env files go in
$MTG_ROOT/lib/tcsh/
There should be the following config files for a job:
fps_dev_<job_name>.env
fps_test_<job_name>.env
fps_prod_<job_name>.env
Use navajo_dev_example.env as a starting point. Change the values in the file as necessary. Source the file in users .tcshrc file.