The Sensitivity Calculator is an application for calculating the sensitivity of the SKA Mid-Frequency Aperture Array.
The front end of the application is currently being split into a separate component which will be deployed in Kubernetes alongside the new API. For now, the old API is still available in this repo.
Below are two sets of instructions, one for deploying the old application to Docker and the second for deploying the new API to Kubernetes.
## Deploying the Backend server to Docker
The project uses a Docker container to make the results independent
of host environment. Starting and stopping the Calculator is done
make, but first the code must be downloaded from the SKA
The necessary steps are:
Install Git if you don’t already have it.
To find if Git is installed on your computer, type in a terminal:
git --version. The output will either say which version of Git is installed, or that
gitis an unknown command.
If Git is not there, point your browser to https://git-scm.com/book/en/v2/Getting-Started-Installing-Git and follow the instructions for installation.
Install Docker if you don’t already have it.
To find if Docker is installed on your computer, type in a terminal:
docker -v. The output will either say which version of Docker is installed, or that
dockeris an unknown command.
If Docker is not there, point your browser to https://docs.docker.com/get-docker and follow the instructions for installation.
Clone the sensitivity calculator from the SKA Git repository by moving to the destination directory on your machine, and typing:
git clone --recurse-submodules https://gitlab.com/ska-telescope/ska-ost-senscalc.git.
Enter the code directory with:
To refresh the GitLab Submodule, execute below commands:
git submodule update --recursive --remote
git submodule update --init --recursive
6. Install all dependencies using Poetry: First go to the poetry shell, It opens the poetry virtual environment and then run poetry install command
To update the poetry.lock file, use command:
> poetry update
Build a new Docker image for ska-ost-senscalc:
Execute the unit tests and lint the project with:
make python-test && make python-lint
Format the Python code:
make upto build and run a Docker container with the Sensitivity Calculator.The process may take several minutes the first time.
To shut down the Sensitivity Calculator and remove its Docker container, type:
## Deploying the API to Kubernetes
The Ingress rule in the Helm chart only allows access to the new API path, so the old UI will not be visible as this requires root path access.
The Docker image can be built with make oci-build. To deploy to Kubernetes, using the Helm chart, run
and uninstall the chart with
Once installed, the Sensitivity Calculator API should be available externally to the Kubernetes cluster. If using minikube, run minikube ip and use the IP to access the API, eg http://192.168.48.1/api/v1/subarrays.
## Further help
Further documentation, including a
User Guide can be found in the
docs folder. To build the html version of the documentation, start
ska-ost-senscalc directory and first install the dependency using
poetry install --extras "docs" and then type
make docs-build html.
Read the documentation by pointing your browser
## Release a new version
Run make help release or make long-help release to see available documentation
Check if a release exists
ERROR: version not yet tagged in git. make [minor,major,patch]-release.
make: *** [.make/release.mk:166: check-release] Error 1
- Bump minor version for docker and python and follow the output
Note: If there are outstanding(uncommitted tracked) changes existing this will fail so commit first
commit the changes for the version files
This will create a GitLab release with the changelog, follow the Releases page in gitLab UI to see the details. In addition, if you have a CHANGELOG file in the repository it will get updated.
Note: If there is same version tag existing this will fail so first delete the tag
git tag -d <tag>
If your push of tag fails that could be because the tag is already present on Gitlab or CAR. To fix this, just update your version to latest version in .release file and push it. It should pass then.
Documentation can be found in the