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 about 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 Kubernetes (k8s) for development and testing so that the
build environment, test environment, and test results are reproducible and
independent of the host environment. It uses make to provide a consistent
interface; run make help to view the available targets.
Install minikube
You will need to install minikube or an equivalent Kubernetes installation to set up your test environment. Follow the instructions in the deploy-minikube repository:
git clone git@gitlab.com:ska-telescope/sdi/deploy-minikube.git
cd 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, and use another shell for other work.
How to use
Clone this repo:
git clone https://gitlab.com/ska-telescope/ska-tmc-mid-integration.git
cd ska-tmc-mid-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 that:
libtango-devinstalls an old version of the Tango Controls framework (9.2.5);the recommended way to obtain the framework is to compile it, as described in the cppTango installation instructions;
the above script has been tested with Ubuntu 20.04.
During this step, ``libtango-dev`` may ask for the Tango server IP address 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 through the installation of the dependencies. Then run the following commands:
$ 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-mid-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