Skip to content
Snippets Groups Projects
Commit 01f01e4f authored by Jörn Künsemöller's avatar Jörn Künsemöller Committed by Jorrit Schaap
Browse files

TMSS-135: Rename LSMR to TMSS

parent 0103d064
No related branches found
No related tags found
1 merge request!92TMSS-135
Showing
with 80 additions and 80 deletions
......@@ -179,7 +179,7 @@ if(NOT DEFINED LOFAR_PACKAGE_LIST_INCLUDED)
set(SpecificationServices_SOURCE_DIR ${CMAKE_SOURCE_DIR}/SAS/SpecificationServices)
set(XSD_SOURCE_DIR ${CMAKE_SOURCE_DIR}/SAS/XSD)
set(TBBAlertVOeventPublisher_SOURCE_DIR ${CMAKE_SOURCE_DIR}/SAS/TBBAlertVOeventPublisher)
set(LSMR_SOURCE_DIR ${CMAKE_SOURCE_DIR}/SAS/LSMR)
set(TMSS_SOURCE_DIR ${CMAKE_SOURCE_DIR}/SAS/TMSS)
set(DataManagementCommon_SOURCE_DIR ${CMAKE_SOURCE_DIR}/SAS/DataManagement/DataManagementCommon)
set(StorageQueryService_SOURCE_DIR ${CMAKE_SOURCE_DIR}/SAS/DataManagement/StorageQueryService)
set(Cleanup_SOURCE_DIR ${CMAKE_SOURCE_DIR}/SAS/DataManagement/Cleanup)
......
......@@ -132,19 +132,19 @@ LOGGING = {
# Read Postgres DB settings
# this requires a config file in ~/.lofar/dbcredentials/lsmr.ini
# this requires a config file in ~/.lofar/dbcredentials/tmss.ini
# if no such file exists then it is automatically created.
# It is also possible to set another credentials-name via the LSMR_DBCREDENTIALS env-var for testing for example.
# It is also possible to set another credentials-name via the TMSS_DBCREDENTIALS env-var for testing for example.
#
# contents should be like this (adapt as needed):
#
# [database:mdb]
# type = postgresql
# host = localhost
# database = <your_lsmr_database_name>
# database = <your_tmss_database_name>
# port = 5432
# user = <your_lsmr_user_name>
# password = <your_lsmr_password>
# user = <your_tmss_user_name>
# password = <your_tmss_password>
creds_name = os.environ.get('MDB_DBCREDENTIALS', 'mdb')
django_db_credentials = dbcredentials.DBCredentials().get(creds_name)
......
......@@ -4,7 +4,7 @@
This allows running Django tests using a temporary postgres db (set up by tesing.postgresql) instead of using the
stock config in settings.py. Run as script to start postgres instance, returns PID to allow stopping it after use.
To use this in Django tests, run: '.../manage.py test lsmrapp --testrunner=postgres_testrunner.PostgresqlTestRunner'
To use this in Django tests, run: '.../manage.py test tmssapp --testrunner=postgres_testrunner.PostgresqlTestRunner'
"""
import testing.postgresql
......
......@@ -13,7 +13,7 @@ lofar_add_package(TriggerEmailService)
lofar_add_package(SpecificationServices)
lofar_add_package(XSD)
lofar_add_package(TBBAlertVOeventPublisher)
lofar_add_package(LSMR)
lofar_add_package(TMSS)
add_subdirectory(MoM)
add_subdirectory(ResourceAssignment)
......
lofar_package(LSMR 0.1 DEPENDS PyCommon)
lofar_package(TMSS 0.1 DEPENDS PyCommon)
add_subdirectory(src)
add_subdirectory(bin)
......
lofar_add_bin_scripts(lsmr)
lofar_add_bin_scripts(lsmr_testdatabase)
lofar_add_bin_scripts(lsmr_testldap)
\ No newline at end of file
lofar_add_bin_scripts(tmss)
lofar_add_bin_scripts(tmss_testdatabase)
lofar_add_bin_scripts(tmss_testldap)
\ No newline at end of file
......@@ -18,18 +18,18 @@
# with the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>.
# Startup script for the development LSMR server
# Startup script for the development TMSS server
#defaults
PORT=8000
CREDENTIALS="lsmr"
CREDENTIALS="tmss"
# Parse args:
while getopts "p:C:h" opt; do
case ${opt} in
p ) PORT=${OPTARG} ;;
C ) CREDENTIALS=${OPTARG} ;;
h ) echo "usage: lsmr [OPTIONS]"
h ) echo "usage: tmss [OPTIONS]"
echo " where options are:"
echo " -p <port> the port where django runs the rest http interface on. default=$PORT"
echo " -C <credentials-name> the name of the credentials in ~/.lofar/dbcredentials. default=$CREDENTIALS"
......@@ -38,19 +38,19 @@ while getopts "p:C:h" opt; do
esac
done
echo "!!! This lsmr application is for testing only, properly deploy in Nginx or Apache for production use !!!"
echo "!!! This tmss application is for testing only, properly deploy in Nginx or Apache for production use !!!"
echo "Using Django port=$PORT credentials=$CREDENTIALS"
export LSMR_DBCREDENTIALS=$CREDENTIALS
export TMSS_DBCREDENTIALS=$CREDENTIALS
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# run the django migration (is a noop when nothing changed)
/usr/bin/python3 $DIR/../lib*/python*/site-packages/lofar/sas/lsmr/manage.py migrate
/usr/bin/python3 $DIR/../lib*/python*/site-packages/lofar/sas/tmss/manage.py migrate
# fire up the django server in the background...
/usr/bin/python3 $DIR/../lib*/python*/site-packages/lofar/sas/lsmr/manage.py runserver 0.0.0.0:$PORT &
/usr/bin/python3 $DIR/../lib*/python*/site-packages/lofar/sas/tmss/manage.py runserver 0.0.0.0:$PORT &
SERVER_PID=$!
# setup propagation of signals to child processes
......
......@@ -20,7 +20,7 @@
# Script to create, setup, and run a temporary postgres instance for easy functional testing
from lofar.sas.lsmr.test.postgres_testrunner import main
from lofar.sas.tmss.test.postgres_testrunner import main
if __name__ == "__main__":
main()
......@@ -20,7 +20,7 @@
# Script to create, setup, and run a temporary ldap service with fixtures for easy functional testing
from lofar.sas.lsmr.test.ldap_test_service import main
from lofar.sas.tmss.test.ldap_test_service import main
if __name__ == "__main__":
main()
# LSMR {#lsmr}
# TMSS {#tmss}
......
/**
\ingroup SAS
\defgroup LSMR LSMR
\ref lsmr
The LSMR package will replace the current MoM as the central Lofar operational management software.
\defgroup TMSS TMSS
\ref tmss
The TMSS package will replace the current MoM as the central Lofar operational management software.
It is mainly a Django-based REST API with a complex underlying database model.
The name is a working title and subject to change.
......
......@@ -13,12 +13,12 @@ pipeline {
steps {
script {
dir ('SAS/LSMR/docker/lsmr'){
docker.build("lsmr", "--build-arg BRANCH=${env.BRANCH_NAME} .").tag("${env.DOCKER_TAG}")
dir ('SAS/TMSS/docker/tmss'){
docker.build("tmss", "--build-arg BRANCH=${env.BRANCH_NAME} .").tag("${env.DOCKER_TAG}")
}
dir ('SAS/LSMR/docker/lsmr-postgres'){
docker.build("lsmr-postgres").tag("${env.DOCKER_TAG}")
dir ('SAS/TMSS/docker/tmss-postgres'){
docker.build("tmss-postgres").tag("${env.DOCKER_TAG}")
}
}
......@@ -28,8 +28,8 @@ pipeline {
steps {
script {
withDockerRegistry(credentialsId: 'nexus', url: env.LOFAR_REGISTRY_URL) {
tag_and_push("lsmr:${env.DOCKER_TAG}", env.LOFAR_REGISTRY)
tag_and_push("lsmr-postgres:${env.DOCKER_TAG}")
tag_and_push("tmss:${env.DOCKER_TAG}", env.LOFAR_REGISTRY)
tag_and_push("tmss-postgres:${env.DOCKER_TAG}")
}
}
......
To build:
docker build -t lsmr-postgres lsmr-postgres
docker build -t lsmr [--build-arg BRANCH=LSMR-epic] [--build-arg UID=`id -u`] lsmr
docker build -t tmss-postgres tmss-postgres
docker build -t tmss [--build-arg BRANCH=TMSS-epic] [--build-arg UID=`id -u`] tmss
To start the PostgreSQL container:
docker run [-it] --name=postgres-$USER --rm lsmr-postgres
docker run [-it] --name=postgres-$USER --rm tmss-postgres
To start the LSMR container (exposing port 8001 to surf to) AND LSMR app:
To start the TMSS container (exposing port 8001 to surf to) AND TMSS app:
docker run [-it] --rm -p 0.0.0.0:8001:8000 --link=postgres-$USER:postgres lsmr
docker run [-it] --rm -p 0.0.0.0:8001:8000 --link=postgres-$USER:postgres tmss
To start the LSMR container (exposing port 8001 to surf to) for debugging/testing:
To start the TMSS container (exposing port 8001 to surf to) for debugging/testing:
docker run -it --rm -p 0.0.0.0:8001:8000 --link=postgres-$USER:postgres lsmr bash
docker run -it --rm -p 0.0.0.0:8001:8000 --link=postgres-$USER:postgres tmss bash
Note: "-it" allows one to abort the container with ^C.
CREATE USER lsmr WITH SUPERUSER PASSWORD 'lsmr';
CREATE DATABASE lsmr;
GRANT ALL PRIVILEGES ON DATABASE lsmr TO lsmr;
CREATE USER tmss WITH SUPERUSER PASSWORD 'tmss';
CREATE DATABASE tmss;
GRANT ALL PRIVILEGES ON DATABASE tmss TO tmss;
version: '3'
services:
lsmr_test:
tmss_test:
build:
context: .
dockerfile: lsmr_testenv_Dockerfile
container_name: lsmr_test
dockerfile: tmss_testenv_Dockerfile
container_name: tmss_test
ports:
- "8000:8000"
- "3000:3000"
lsmr_test_nginx:
tmss_test_nginx:
build:
context: .
dockerfile: lsmr_nginx_Dockerfile
container_name: lsmr_test_nginx
dockerfile: tmss_nginx_Dockerfile
container_name: tmss_test_nginx
ports:
- "5000:5000"
#
# This sets up a Docker image that runs the lsmr frontend for testing
# This sets up a Docker image that runs the tmss frontend for testing
#
FROM centos:7
......
#
# This sets up a Docker image that runs an nginx proxy for lsmr fronend testing
# Both the frontend as well as the API have to be served from the same origin (unless LSMR serves appropriate CORS headers).
# This sets up a Docker image that runs an nginx proxy for tmss fronend testing
# Both the frontend as well as the API have to be served from the same origin (unless TMSS serves appropriate CORS headers).
#
FROM centos:7
......
#
# This sets up a Docker image that runs lsmr for testing
# This sets up a Docker image that runs tmss for testing
#
FROM centos:7
......@@ -11,7 +11,7 @@ RUN yum -y groupinstall 'Development Tools' && \
n stable && \
npm install -g serve
RUN echo "Installing packages for LSMR..." && \
RUN echo "Installing packages for TMSS..." && \
yum -y install https://download.postgresql.org/pub/repos/yum/9.4/redhat/rhel-7-x86_64/pgdg-centos94-9.4-3.noarch.rpm && \
yum -y install postgresql94-devel openldap-devel postgresql94-server which && \
pip3 install django-filter django-auth-ldap coreapi python-ldap-test django-jsonforms django-json-widget "git+git://github.com/nnseva/django-jsoneditor.git" psycopg2-binary markdown ldap3 drf-yasg flex swagger-spec-validator testing.postgresql
......@@ -23,7 +23,7 @@ RUN echo "Checking out code base" && \
cd lofar && \
git checkout LEI-40 && \
. CMake/gen_LofarPackageList_cmake.sh && \
PACKAGE=LSMR && \
PACKAGE=TMSS && \
VARIANT=gnucxx11_opt && \
echo "Building $PACKAGE..." && \
mkdir -p build/$VARIANT && \
......@@ -35,35 +35,35 @@ RUN echo "Checking out code base" && \
USER postgres
RUN mkdir -p ~postgres/.lofar/dbcredentials/ && \
echo -e '[database:lsmr_ldap_test]\n\
echo -e '[database:tmss_ldap_test]\n\
host=localhost\n\
user=lsmrldap\n\
password=lsmrldap\n\
user=tmssldap\n\
password=tmssldap\n\
type=unknown\n\
port=3389\n\
database=lsmr_ldap_test' > ~postgres/.lofar/dbcredentials/lsmr_ldap_test.ini && \
echo -e '[database:lsmr]\n\
database=tmss_ldap_test' > ~postgres/.lofar/dbcredentials/tmss_ldap_test.ini && \
echo -e '[database:tmss]\n\
type = postgresql\n\
host = localhost\n\
database = lsmr\n\
database = tmss\n\
port = 5432\n\
user = lsmrdb\n\
password = lsmrdb\n' > ~postgres/.lofar/dbcredentials/lsmr.ini
user = tmssdb\n\
password = tmssdb\n' > ~postgres/.lofar/dbcredentials/tmss.ini
ENV LSMR_DBCREDENTIALS=lsmr
ENV LSMR_LDAPCREDENTIALS=lsmr_ldap_test
ENV TMSS_DBCREDENTIALS=tmss
ENV TMSS_LDAPCREDENTIALS=tmss_ldap_test
ENTRYPOINT /bin/bash -c 'export VARIANT=gnucxx11_opt; \
source /lofar/build/$VARIANT/lofarinit.sh; \
cat /var/lib/pgsql/.lofar/dbcredentials/lsmr.ini; \
cat /var/lib/pgsql/.lofar/dbcredentials/lsmr_ldap_test.ini; \
lsmr_testldap & \
lsmr_testdatabase & \
cat /var/lib/pgsql/.lofar/dbcredentials/tmss.ini; \
cat /var/lib/pgsql/.lofar/dbcredentials/tmss_ldap_test.ini; \
tmss_testldap & \
tmss_testdatabase & \
sleep 15 && \
lsmr & \
tmss & \
cd /lofar/build/gnucxx11_opt/installed/share/www && \
serve -s . -p 3000'
# It also works to serve the dev server for interactive development as such:
# cd /lofar/build/gnucxx11_opt/SAS/LSMR/frontend/frontend_poc && \
# cd /lofar/build/gnucxx11_opt/SAS/TMSS/frontend/frontend_poc && \
# npm start
\ No newline at end of file
......@@ -18,22 +18,22 @@ http {
}
location @api_proxy {
proxy_pass http://lsmr_test:8000$uri;
proxy_pass http://tmss_test:8000$uri;
proxy_intercept_errors on;
recursive_error_pages on;
error_page 404 = @frontend_proxy;
}
location @frontend_proxy {
proxy_pass http://lsmr_test:3000$uri;
proxy_pass http://tmss_test:3000$uri;
}
location /api/ {
proxy_pass http://lsmr_test:8000;
proxy_pass http://tmss_test:8000;
}
location /frontend/ {
proxy_pass http://lsmr_test:3000;
proxy_pass http://tmss_test:3000;
}
}
}
\ No newline at end of file
FROM ubuntu:18.04
# LOFAR branch to build
ARG BRANCH=LSMR-epic
ARG BRANCH=TMSS-epic
# Export build-time variables to containters
ENV BRANCH=$BRANCH
......@@ -36,19 +36,19 @@ RUN cd /src && \
svn co -N https://svn.astron.nl/LOFAR/branches/$BRANCH/ && \
cd $BRANCH/ && \
svn up CMake
RUN mkdir -p /build/gnu_debug && cd /build/gnu_debug && cmake /src/$BRANCH/ -DBUILD_PACKAGES=LSMR -DCMAKE_INSTALL_PREFIX=/opt/lofar && make -j 8 && make -j 8 install
RUN mkdir -p /build/gnu_debug && cd /build/gnu_debug && cmake /src/$BRANCH/ -DBUILD_PACKAGES=TMSS -DCMAKE_INSTALL_PREFIX=/opt/lofar && make -j 8 && make -j 8 install
# Configure authentication
ADD dbcreds.ini /opt/lofar/etc/dbcredentials/lsmr.ini
RUN echo "REST_FRAMEWORK['DEFAULT_AUTHENTICATION_CLASSES']=[]" >> /opt/lofar/lib/python3.6/site-packages/lofar/sas/lsmr/lsmr/settings.py
RUN echo "REST_FRAMEWORK['DEFAULT_PERMISSION_CLASSES']=[]" >> /opt/lofar/lib/python3.6/site-packages/lofar/sas/lsmr/lsmr/settings.py
ADD dbcreds.ini /opt/lofar/etc/dbcredentials/tmss.ini
RUN echo "REST_FRAMEWORK['DEFAULT_AUTHENTICATION_CLASSES']=[]" >> /opt/lofar/lib/python3.6/site-packages/lofar/sas/tmss/tmss/settings.py
RUN echo "REST_FRAMEWORK['DEFAULT_PERMISSION_CLASSES']=[]" >> /opt/lofar/lib/python3.6/site-packages/lofar/sas/tmss/tmss/settings.py
# Allow Django HTTP access
EXPOSE 8000
RUN echo "ALLOWED_HOSTS=['*']" >> /opt/lofar/lib/python3.6/site-packages/lofar/sas/lsmr/lsmr/settings.py
RUN echo "ALLOWED_HOSTS=['*']" >> /opt/lofar/lib/python3.6/site-packages/lofar/sas/tmss/tmss/settings.py
# Hot patches
# Run LOFAR app
CMD bash -c 'source /opt/lofar/lofarinit.sh && lsmr'
CMD bash -c 'source /opt/lofar/lofarinit.sh && tmss'
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment