-
Notifications
You must be signed in to change notification settings - Fork 1
getting_started
This document assume you have cloned the git respository, and are at the top level. While the top level Makefile is mostly for convienience, the real work is done by lower level Makefiles.
This projects uses many generated files, which does add dependancy issues around processing steps in the right order. The rough steps in order are:
- Clone the source
- Generate all the language binding files
- Create the postgres database
- Import the generated SQL files into postgres
- install the python modules
The simple way to get started is to type make, which will generate all the files, followed by pip install ., which will install the python modules.
Documentation on the python modules is available via pydoc tm_admin, and is also available in more detail from the TM Admin docs website.
After this is done, you can optionally import the existing Tasking Manager database using the tmdb.py program. This can take a long time, as the schemas aren't the same, so should be done as a background task, preferably on a different computer as it may take many hours or several days depending on the hardware.
There is a Makefile in the tm_admin directory that does much of the work of generating all the output files with the proper options, and in the right order. It is recommended that developers use this instead of generating files for an indivigual YAML config file. Most users wil lnever need this commands, they're primarily for development and deployments.
By default, just typing make will run the all target, which will execute all the dependant targets first.
This target removes all the generated files generated by this project. This is primarily of use only to developers. But if you are trying to work on this project, when you have weird problems, start with clean files.
This also runs the clean target, but additionally removes all the text editing backups, and the pycache. Sometimes whern debugging there are issues with the python cache, so removing it makes for a clean start.
This target generates the types_tm. files, which defined all the data types for SQL, Python, and Protobuf. This is run automatically when using the generate target.
This generates all the language binding files for Postgrers, Python, and Protobuf. If the files exist, they will not get regenerated unless changes to the YAML files are made. It's bettter to regenerate everything though, so run make clean first. To use make to regenerate indivigual files, this will generate the initial files for Postgres and the protobuf config files.
make tasks/task_history.sql
It is also possible to run the protobuf compiler (protoc) manually for indivigual files. This will generate the python wrappers to use protobuf using the XXX.proto source file, which has already been created by the generator.py program.
PROTOC=protoc
GRPC = --grpc_python_out=. --plugin=protoc-gen-grpc_python=/usr/bin/grpc_python_plugin
$(PROTOC) -I. --python_out=. $(GRPC) types_tm.proto XXX.proto
This uses the tmadmin-manage.py program to create the schema in the database.
In addition to the Doxygen API documentation, it is also possible to generate an API document of the generated Protobuf files.