.. _getting_started:
Getting started
===============
This page contains instructions for software developers who want to get started with usage and development of the TMC integration repository.
Background
----------
Detailed information on how the SKA Software development
community works is available at the `SKA software developer portal `_.
There you will find guidelines, policies, standards and a range of other
documentation.
Set up your development environment
-----------------------------------
This project uses virtualization for development and testing so that the build environment, test environment, and test results are reproducible and independent of the host environment. Makefiles are used to simplify various development tasks that triggers procedures for build, test, package and deploy the subsystem.
Install minikube
^^^^^^^^^^^^^^^^
You will need to install `minikube` or an equivalent Kubernetes installation to set up your test environment. Follow the instructions in ``_::
git clone git@gitlab.com:ska-telescope/sdi/ska-cicd-deploy-minikube.git
cd ska-cicd-deploy-minikube
make all
eval $(minikube docker-env)
Please note that the command `eval $(minikube docker-env)` points your local Docker client to Minikube's Docker daemon. Use this only for building the Docker image; use another shell for other work.
How to Use
^^^^^^^^^^
Clone this repo::
git clone https://gitlab.com/ska-telescope/ska-tmc-low-integration.git
cd ska-tmc-low-integration
Install dependencies::
apt update
apt install -y curl git build-essential libboost-python-dev libtango-dev
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python3 -
source $HOME/.poetry/env
Please note the following:
* the `libtango-dev` will install an old version of the TANGO-controls framework (9.2.5);
* the best way to obtain the framework is to compile it (instructions can be found `here `_);
* the above script has been tested on Ubuntu 20.04.
*During this step, `libtango-dev` installation may ask for the Tango server IP and port. Accept the proposed default value.*
Install python requirements for linting and unit testing::
$ poetry install
Activate the poetry environment::
$ source $(poetry env info --path)/bin/activate
Alternate way to install and activate poetry:
Follow the steps till installation of dependencies. Then run below command::
$ virtualenv cn_venv
$ source cn_venv/bin/activate
$ make requirements
Run python-test::
$ make python-test
PyTango 9.4.2
PyTango compiled with:
python : 3.10 or above
numpy = 1.23.0 or above
Boost : 1.71.0
PyTango runtime is:
python : 3.10 or above
numpy = 1.23.0 or above
PyTango 9.4.2
PyTango running on:
uname_result(system='Linux', node='LAPTOP-5LBGJH83', release='4.19.128-microsoft-standard', version='#1 SMP Tue Jun 23 12:58:10 UTC 2020', machine='x86_64', processor='x86_64')
============================= test session starts ==============================
platform linux -- Python 3.8.5, pytest-5.4.3, py-1.10.0, pluggy-0.13.1 -- /home/
[....]
--------------------------------- JSON report ----------------------------------
JSON report written to: build/reports/report.json (165946 bytes)
----------- coverage: platform linux, python 3.8.5-final-0 -----------
Coverage HTML written to dir build/htmlcov
Coverage XML written to file build/reports/code-coverage.xml
======================== 48 passed, 5 deselected in 42.42s ========================
Formatting the code::
$ make python-format
[...]
--------------------------------------------------------------------
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00)
Python linting::
$ make python-lint
[...]
--------------------------------------------------------------------
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00)
Helm Charts linting::
$ make helm-lint
[...]
10 chart(s) linted, 0 chart(s) failed
Build the container image for the project::
$ make oci-image-build
[...]
[+] Building 111.7s (14/14) FINISHED
[...]
Install the umbrella chart::
$ make k8s-install-chart
[...]
NAME: test
LAST DEPLOYED: Fri Nov 5 10:35:18 2021
NAMESPACE: ska-tmc-low-integration
STATUS: deployed
REVISION: 1
TEST SUITE: None
Test the deployment with (the result of the tests are stored into the folder ``charts/build``)::
make k8s-wait && make k8s-test
To watch the pods, services status::
make k8s-watch
Uninstall the chart::
$ make k8s-uninstall-chart
release "test" uninstalled