-
Notifications
You must be signed in to change notification settings - Fork 1
Getting Started
In this guide we will go through the simple steps that would help to start with th2, based on the demo example. If you are already familiar with the th2 paradigm and interested in installing th2 for your business needs, refer to our th2 technical requirements page to check which th2 configuration will be suitable for you.
These steps require you to have a cluster running a compatible version of Kubernetes. It's possible to use any supported platform, for example Minikube or install it locally, guide for kubernetes installation on Centos-7 is available in the FAQ section.
More information regarding the use cases covered in the demo example, it's configuration, execution process and results' verification can be found on our th2 demo example page.
Follow these steps to get started with th2:
step #1: Install required software to the test-box and operator-box;
step #2: Download th2 to your Git repository;
step #3: Download th2 Demo Example configuration to your Git repository;
step #4: Set up your cluster and Install th2;
step #5: Create your first th2 custom environment in a dedicated namespace;
step #6: Get and Run th2-script-demo
th2 is a Kubernetes-driven microservices solution. So, to start with th2 you would need the fully functional Kubernetes cluster installed on your test-box/test-boxes (a quick guide for kubernetes installation on Centos-7 is available in the FAQ section), please also check if your test-box and operator-box meet th2 software requirements.
Minimal hardware th2 requirements for demo example:
- 6 CPU cores
- 16 GB RAM
- 100 GB disk space
If you would like to enhance demo configuration with additional boxes, please check th2 technical requirements.
th2 components should be copied to your Git repository if you would like to try th2 custom componets, modify them based on your business logic or evaluate th2 onboarding process. If, at this step, you do not want to make any changes, but just run a demo example without any modifications, this step can be skipped.
You would need the following:
- th2-infra for core platform
- th2 custom, components from the demo example:
Get th2-infra-schema for custom components and copy or fork to your GIT repository.
Details regarding specific cluster setup, required for th2 installation process are available in th2-infra README.md file.
In th2, environment is called infractructure schema or just schema, it's created by the dedicated infra-mgr component that watches for changes in the repositories and rolling out schemas from git repository to kubernetes. Please refer to infra-schema-demo instruction to create your first th2 environment.
In demo example all required links between th2 boxes are configured, available in the infra-schema-demo repository and can be used as an example for your new components. Additional information on th2-infra configuration can be also found on the infra: Theory of Pins and Links wiki page.
Copy th2-script-demo example to your GIT and run it based on the following instruction:
Steps:
- Copy to your repository content from the link
- Get python environment 3.7+ (e.g. conda).
Recommended: get IDE to work with python (e.g. pycharm, spyder). You can also start this script from the command line, but IDE will make this process more convenient.
- Install the libraries described in requirements.txt in branch with script version you choose. Latest requirements you can find in requirements_latest.txt
requirements.txt contains standart packages to work with grpc (e.g. google-api-core) and custom packages to work with th2 boxes. Please note that grpc client (script) and grpc server (th2 box) should use the same package. You can find more information about
requirements.txtand package installation here: https://pip.pypa.io/en/stable/user_guide/#requirements-files
- Set up configs from directory configs (
mq.json,rabbit.json,grpc.json,ds_config.yaml) according to your components.
- Fill
grpc.jsonin folder configs with host and external port of your act and check1 pods. You can find it in Kubernetes Dashboard in Services tab or execute in kubectl -kubectl get services - Fill
mq.jsonin folder configs with RabbitMQ exchange and routing key from script-entry-point to estore. You can find this queue in Kubernetes Dashboard inConfig Mapstab - script-entry-point-app-config. - Fill
rabbit.jsonin folder configs with your RabbitMQ credentials. You can find these credentials in Kubernetes Dashboard inConfig Mapstab - rabbit-mq-app-config. - Fill
ds_config.yaml
- Start run.py
- After run.py will be finished. Jupyter notebook will happen in your browser. Run this notebook to execute data services demo part.
Get in touch with us to learn more about th2 mail to: info@exactprosystems.com
- Architecture
- Tutorials