Comprehensive Online Tutorial for Component Databases Management

Slide Note
Embed
Share

Explore a detailed online tutorial covering various aspects of managing component databases, including finding information, setting up in a Docker environment, data definition interface, editing components and modules, and generating server/client web applications. Access documentation, docker setup, and central database server information for effective management.


Uploaded on Sep 12, 2024 | 0 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. Download presentation by click this link. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

E N D

Presentation Transcript


  1. Component Component databases databases: online : online tutorial tutorial Slide Slide guide guide Evgeny Lavrik 2.11.2020 E. Lavrik - Component databases online tutorial 1

  2. Where to find info and help? Refer to the presentation at collaboration meeting https://indico.gsi.de/event/10062/contributions/48478/ http://compdb.cbm.gsi.de is our central component database server, accessible from everywhere, you can host your data there too! Documentation: https://git.cbm.gsi.de/TGenBase/ClassGen We have a mailing list CBM-COMPONENTDB@gsi.de Email me e.lavrik@gsi.de 2.11.2020 E. Lavrik - Component databases online tutorial 2

  3. Tutorial in docker environment The software itself of course does not need the docker and can be run with installed dependencies Docker, however, provides reproducible results for everyone. The images contain all the preinstalled dependencies Learn how to download and install it on your system (admin rights required): https://www.docker.com/get-started The fast way is to type in your terminal the following: curl -fsSL https://get.docker.com -o get-docker.sh sudo sh get-docker.sh sudo curl -L "https://github.com/docker/compose/releases/download/1.27.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose sudo chmod +x /usr/local/bin/docker-compose sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose then pull the docker images with our tutorial materials as follows. Type these commands in your terminal: sudo docker pull elavrik/tgb-php sudo docker pull elavrik/tgb-cxx sudo docker pull elavrik/tgb-py 2.11.2020 E. Lavrik - Component databases online tutorial 3

  4. Data definition interface Navigate to https://compdb.cbm.gsi.de 2.11.2020 E. Lavrik - Component databases online tutorial 4

  5. Open project -> Tutorial.json 2.11.2020 E. Lavrik - Component databases online tutorial 5

  6. Edit Component 2.11.2020 E. Lavrik - Component databases online tutorial 6

  7. Edit Module 2.11.2020 E. Lavrik - Component databases online tutorial 7

  8. Generate server, Generate Client -> Web 2.11.2020 E. Lavrik - Component databases online tutorial 8

  9. Generate server, Generate Client -> Web, unpack, put WebClient into PhpServer 2.11.2020 E. Lavrik - Component databases online tutorial 9

  10. Go to Terminal, change directory to the unpacked projects. Run following commands after $ 2.11.2020 E. Lavrik - Component databases online tutorial 10

  11. It is ready when you see the message PHP Development Server started 2.11.2020 E. Lavrik - Component databases online tutorial 11

  12. Server and Web GUI are ready. Use admin@example.com as login and test as password The same interface is available https://compdb.cbm.gsi.de:5050/ 2.11.2020 E. Lavrik - Component databases online tutorial 12

  13. Go to component workspace. It is autogenerated for you. 2.11.2020 E. Lavrik - Component databases online tutorial 13

  14. Go to Create New, enter some infos, click create new 2.11.2020 E. Lavrik - Component databases online tutorial 14

  15. Go to Create New 2.11.2020 E. Lavrik - Component databases online tutorial 15

  16. Go back to Component workspace, click Get All 2.11.2020 E. Lavrik - Component databases online tutorial 16

  17. Go back to Data definition Interface and Generate C++ client. Unpack it to the PhpServer and go to docker subdirectory 2.11.2020 E. Lavrik - Component databases online tutorial 17

  18. Execute following commands to run the container 2.11.2020 E. Lavrik - Component databases online tutorial 18

  19. Inside the container go to /opt/cxxclient and type . install. The project will compile 2.11.2020 E. Lavrik - Component databases online tutorial 19

  20. Edit TGenBaseConfig.json file to include the http://php:8008 as the server address php is the hostname of a docker container running the web server 2.11.2020 E. Lavrik - Component databases online tutorial 20

  21. Edit TGenBaseConfig.json file to include the http://php:8008 as the server address php is the hostname of a docker container running the web server 2.11.2020 E. Lavrik - Component databases online tutorial 21

  22. Now you can run root prompt. Query all components a get the properties of the first one root@462652bf4bcf:/opt/cxxclient# root -l root [0] res = Tutorial::Component::GetAll() (std::vector<Tutorial::Component, std::allocator<Tutorial::Component> > &) { @0x564741ad7ba0, @0x564741ad7c88 } root [1] res[0].Print() Instance: Id = 1 ModuleId = 1 Name = TestComponent ChannelMap = 0x564741ad7be0 CalibrationMatrix = 0x564741ad7bf8 TestDate = 1604393671 QaPassed = 1 File = Comment = Test CreatedAt = 1604393694 UpdatedAt = 1604393694 root [2] res[0].GetCalibrationMatrix() (std::vector<std::vector<double> >) { { 1.0000000, 2.0000000 }, { 3.0000000, 4.0000000 } } 2.11.2020 E. Lavrik - Component databases online tutorial 22

  23. Get the module to which the component from res[0] belongs and print ist properties root [3] m = res[0].GetModule() (std::unique_ptr<Tutorial::Module, std::default_delete<Tutorial::Module> > &) std::unique_ptr -> 0x5647461a2640 root [4] m->Print() Instance: Id = 1 Name = Test Module AssemblyDate = 1604393711 Location = JINR Comment = CreatedAt = 1604393721 UpdatedAt = 1604393721 2.11.2020 E. Lavrik - Component databases online tutorial 23

  24. Get the components belonging to this module root [5] m->GetComponents() (std::vector<Tutorial::Component>) { @0x564741894dd0, @0x564741894eb8 } 2.11.2020 E. Lavrik - Component databases online tutorial 24

  25. Get All versions of this module to see ist history. Example of logistics tracking root [6] m->GetAllVersions()[0].Print() Instance: Id = 1 Name = Test Module AssemblyDate = 1604393711 Location = GSI Comment = CreatedAt = 1604393715 UpdatedAt = 1604393715 root [7] m->GetAllVersions()[1].Print() Instance: Id = 1 Name = Test Module AssemblyDate = 1604393711 Location = JINR Comment = CreatedAt = 1604393721 UpdatedAt = 1604393721 2.11.2020 E. Lavrik - Component databases online tutorial 25

  26. Object Store. Allow storage of arbitrary objects via serialization. Root streamer, json and boost serializations supported root [14] TGenBase::ObjectStore obj (TGenBase::ObjectStore &) @0x7f2f50f4b0a8 root [15] TGenBase::ObjectStore::TestObject test (TGenBase::ObjectStore::TestObject &) @0x7f2f50f4b118 root [16] test.SetParam("test") root [17] obj.SetObjectJson(test) root [18] obj.Print() Instance: Id = -1 Name = Object = {"Id":0,"Param":"test","CreatedAt":0} CreatedAt = 1604395998 UpdatedAt = 1604395998 2.11.2020 E. Lavrik - Component databases online tutorial 26

  27. Object Store. Allow storage of arbitrary objects via serialization. Root streamer, json and boost serializations supported root [22] obj.SetObjectBoost(test) root [23] obj.Print() Instance: Id = -1 Name = Object =new test CreatedAt = 1604395998 UpdatedAt = 1604395998 root [25] obj.SetObjectRoot(&test) root [26] obj.Print() Instance: Id = -1 Name = Object = QAAAHQAA9U+UNgAAAABAAAALAAkIbmV3IHRlc3QAAAAA CreatedAt = 1604395998 UpdatedAt = 1604395998 2.11.2020 E. Lavrik - Component databases online tutorial 27

  28. Object Store. Storing and retrieving artbitrary objects, if you store with Id = -1 the new entry will be created. Otherwise new Version root [29] obj.SetObjectJson(test) root [30] obj.Store() root [31] objects = TGenBase::ObjectStore::GetAll() (std::vector<TGenBase::ObjectStore, std::allocator<TGenBase::ObjectStore> > &) { @0x564749680ea0 } root [32] objects[0].Print() Instance: Id = 1 Name = Object = {"Id":0,"Param":"new test","CreatedAt":0} CreatedAt = 1604397486 UpdatedAt = 1604397486 root [33] obj.SetId(-1) root [34] obj.Store() root [35] TGenBase::ObjectStore::GetAll() (std::vector<TGenBase::ObjectStore>) { @0x564749ff4750, @0x564749ff47c0 } 2.11.2020 E. Lavrik - Component databases online tutorial 28

  29. Now you can generate python client, download, unpack it and place into PhpServer directory. Then you can follow the commands to run the container. Edit the client config 2.11.2020 E. Lavrik - Component databases online tutorial 29

  30. Once again. Edit TGenBaseConfig.json file to include the http://php:8008 as the server address php is the hostname of a docker container running the web server 2.11.2020 E. Lavrik - Component databases online tutorial 30

  31. You are ready to write some python program 2.11.2020 E. Lavrik - Component databases online tutorial 31

  32. The interfaces are the same for getting linked objects, creating new versions, etc. 2.11.2020 E. Lavrik - Component databases online tutorial 32

  33. SQL-like Query Building is a powerful analysis tool. You can chain together many selection cuts, sort the output results. The interfaces are similar in the C++ and Web 2.11.2020 E. Lavrik - Component databases online tutorial 33

Related