OET Scripts
Overview
This project contains library code that is useful when creating observing scripts and engineering tests. It provides the user with simple Python objects that can be used to control SKA telescope Tango devices. The primary use case for this module is to support the execution of Scheduling Blocks (SBs). Hence, much of the code is concerned with translating Scheduling Blocks into the equivalent set of scan configuration and execution instructions, and with the issuing of these instructions to TMC devices at the appropriate times.
OET Scripts project modules ska_oso_scripting.domain and ska_oso_scripting.observingtasks are used for
Creating Observing Scripts
High-level control of Tango devices through use of domain objects, for example in SKAMPI BDD tests
The observing scripts can be managed and executed by using Observation Execution Tool (OET). For documentation on how to use OET REST client and server to manage observing scripts, see the Observation Execution Tool project documentation
Quickstart
This project is structured to use Docker containers for development and
testing so that the build environment, test environment and test results are
all completely reproducible and are independent of host environment. It uses
make
to provide a consistent UI (see Makefile targets).
Build a new Docker image for the OET with:
make oci-build-all
Execute the test suite and lint the project with:
make python-test && make python-lint
Format the Python code:
make python-format
Launch an OET REST server, with your workspace visible inside the container:
make rest
Makefile targets
This project contains a Makefile Gitlab Submodule which acts as a UI for building Docker images, testing images, and for launching interactive developer environments. The following make targets are defined:
Makefile target |
Description |
---|---|
oci-build |
Build a new application image containing REST server and scripts |
python-test |
Test the application image |
python-lint |
Lint the application image |
rest |
start the OET REST server |
help |
show a summary of the makefile targets above |
Creating a new application image
make oci-build
target creates a new Docker image for the application based
on the ‘ska-python-runtime’ image. To optimise final image size and to support
the inclusion of C extension Python libraries such as pytango, the application
is built inside an intermediate Docker image which includes compilers and
cached eggs and wheels for commonly-used Python libraries
(‘ska-python-builder’). The resulting Python environment from this
intermediate stage is copied into a final image which extends a minimal SKA
Python runtime environment (‘ska-python-runtime’), to give the final Docker
image for this application.
Interactive development using containers
make interactive
launches an interactive session using the application
image, mounting the project source directory at /app inside the container.
This allows the container to run code from the local workspace. Any changes
made to the project source code will immediately be seen inside the container.
Test execution
make python-test
runs the application test procedure defined in
.make/python.mk . The Makefile example for
this project runs ‘test’ and copies the resulting output and
test artefacts into a ‘build’ directory, ready for
inclusion in the CI server’s downloadable artefacts.