Skip to content

Commit

Permalink
Merge pull request #71 from lsst-ts/release/2.0.0
Browse files Browse the repository at this point in the history
Release/2.0.0
  • Loading branch information
sfehlandt authored Apr 22, 2020
2 parents cfb98a6 + 51b4bbf commit c1a56dd
Show file tree
Hide file tree
Showing 111 changed files with 14,542 additions and 1,115 deletions.
3 changes: 2 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
**/__pycache__
**/__pycache__
**/db_data
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,10 @@ webpack-stats.*
*.sqlite3
**/__pycache__
**/.DS_Store
**/db_data

# preserve folder structure with dummy gitinclude file
manager/media/thumbnails/**
!manager/media/thumbnails/.gitinclude
manager/ui_framework/tests/media/thumbnails/**
!manager/ui_framework/tests/media/thumbnails/.gitinclude
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.6.7-stretch
FROM python:3.8.2-buster

# Install required packages
RUN apt-get update && \
Expand All @@ -22,12 +22,14 @@ RUN python manage.py collectstatic --noinput

# Expose static files and port
VOLUME /usr/src/love/manager/static
VOLUME /usr/src/love/manager/media
EXPOSE 8000

# Set env variables for runtime (to be replaced in docker-cpomse files)
ENV ADMIN_USER_PASS=test
ENV USER_USER_PASS=test
ENV CMD_USER_PASS=test
ENV NO_DEBUG=True

# Run daphne server in runtime
CMD ["./runserver.sh"]
4 changes: 2 additions & 2 deletions Dockerfile-dev
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.6.7-stretch
FROM python:3.8.2-buster

# Install required packages
RUN apt-get update && \
Expand All @@ -10,7 +10,7 @@ RUN apt-get update && \
rm -rf /var/lib/apt/lists/*

# Set workdir and install python requirements
WORKDIR /usr/src/love
WORKDIR /usr/src/love/manager
COPY manager/requirements.txt .
RUN pip install -r requirements.txt

Expand Down
32 changes: 16 additions & 16 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,22 +37,22 @@ pipeline {
}
}
}
stage("Test Docker Image") {
when {
anyOf {
branch "master"
branch "develop"
branch "bugfix/*"
branch "hotfix/*"
branch "release/*"
}
}
steps {
script {
sh "docker run ${dockerImageName} pytest"
}
}
}
// stage("Test Docker Image") {
// when {
// anyOf {
// branch "master"
// branch "develop"
// branch "bugfix/*"
// branch "hotfix/*"
// branch "release/*"
// }
// }
// steps {
// script {
// sh "docker run ${dockerImageName} pytest"
// }
// }
// }
stage("Push Docker image") {
when {
anyOf {
Expand Down
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,21 @@ All these variables are initialized with default variables defined in :code:`.en
* `ADMIN_USER_PASS`: password for the default `admin` user, which has every permission.
* `USER_USER_PASS`: password for the default `user` user, which has readonly permissions and cannot execute commands.
* `CMD_USER_PASS`: password for the default `cmd` user, which has readonly permissions but can execute commands.
* `LOVE_MANAGER_REDIS_HOST`: the location of the redis host that implements the `Channels Layer`.
* `REDIS_PASS`: the password that the LOVE-manager needs tio use to connect with `redis`.
* `REDIS_HOST`: the location of the redis host that implements the `Channels Layer`.
* `REDIS_PASS`: the password that the LOVE-manager needs to use to connect with `redis`.
* `PROCESS_CONNECTION_PASS`: the password that the LOVE-producer will use to establish a websocket connection with the LOVE-manager.
* `DB_ENGINE`: describe which database engine should be used. If its value is `postgresql` Postgres will be used, otherwise it will use Sqlite3.
* `DB_NAME`: defines the name of the Database. Only used if `DB_ENGINE=postgresql`.
* `DB_USER`: defines the user of the Database. Only used if `DB_ENGINE=postgresql`.
* `DB_PASS`: defines the password of the Database. Only used if `DB_ENGINE=postgresql`.
* `DB_HOST`: defines the host of the Database. Only used if `DB_ENGINE=postgresql`.
* `DB_PORT`: defines the port of the Database. Only used if `DB_ENGINE=postgresql`.
* `NO_DEBUG`: defines wether or not the LOVE-.manager will be run using Django's debug mode. If the variable is defined, then Debug mode will be off.
* `SECRET_KEY`: overrides Django's SECRET_KEY, if not defined the default value (public in this repo) will be used.
* `AUTH_LDAP_SERVER_URI`: (deprecated) the location of the LDAP authentication server. No LDAP server is used if this variable is empty

# Local load for development
We provide a docker image and a docker-compose file in order to load the LOVE-manager locally for development purposes, i.e. run tests and build documentation.
We provide a docker image and a docker-compose file in order to load the LOVE-manager with a Postgres database locally, for development purposes, such as run tests and build documentation.

This docker-compose does not copy the code into the image, but instead it mounts the repository inside the image, this way you can edit the code from outside the docker container with no need to rebuild or restart.

Expand Down
25 changes: 24 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,37 @@ version: "3.7"

services:

database:
container_name: manager-postgres-local
image: postgres:12.0
environment:
- POSTGRES_DB=postgres
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
volumes:
- ./db_data:/var/lib/postgresql/data
restart: always

manager:
container_name: manager-local
build:
context: .
dockerfile: Dockerfile-dev
image: love-manager-image-mount
environment:
- DB_ENGINE=postgresql
- DB_NAME=postgres
- DB_USER=postgres
- DB_PASS=postgres
- DB_HOST=database
- DB_PORT=5432
ports:
- "8000:8000"
depends_on:
- database
restart: always
volumes:
- .:/usr/src/love
command: ""
command: "sleep infinity"
stdin_open: true
tty: true
Binary file modified docs/doctrees/apidoc/api.doctree
Binary file not shown.
Binary file modified docs/doctrees/apidoc/api.tests.doctree
Binary file not shown.
Binary file modified docs/doctrees/apidoc/manager.doctree
Binary file not shown.
Binary file modified docs/doctrees/apidoc/modules.doctree
Binary file not shown.
Binary file added docs/doctrees/apidoc/ui_framework.doctree
Binary file not shown.
Binary file added docs/doctrees/apidoc/ui_framework.tests.doctree
Binary file not shown.
Binary file modified docs/doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/doctrees/modules/how_to_use_it.doctree
Binary file not shown.
Binary file modified docs/doctrees/modules/readme_link.doctree
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/html/.buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 953d8bcde9ceff8398c74730e916263b
config: 0e75181af2d457cfd432dc4ec2676b09
tags: 645f666f9bcd5a90fca523b33c5a78b7
1 change: 1 addition & 0 deletions docs/html/_sources/apidoc/modules.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ These are the ApiDocs of the project.
manage
manager
subscription
ui_framework
69 changes: 69 additions & 0 deletions docs/html/_sources/apidoc/ui_framework.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
ui\_framework package
=====================

Subpackages
-----------

.. toctree::

ui_framework.tests

Submodules
----------

ui\_framework.admin module
--------------------------

.. automodule:: ui_framework.admin
:members:
:undoc-members:
:show-inheritance:

ui\_framework.apps module
-------------------------

.. automodule:: ui_framework.apps
:members:
:undoc-members:
:show-inheritance:

ui\_framework.models module
---------------------------

.. automodule:: ui_framework.models
:members:
:undoc-members:
:show-inheritance:

ui\_framework.serializers module
--------------------------------

.. automodule:: ui_framework.serializers
:members:
:undoc-members:
:show-inheritance:

ui\_framework.urls module
-------------------------

.. automodule:: ui_framework.urls
:members:
:undoc-members:
:show-inheritance:

ui\_framework.views module
--------------------------

.. automodule:: ui_framework.views
:members:
:undoc-members:
:show-inheritance:


Module contents
---------------

.. automodule:: ui_framework
:members:
:undoc-members:
:show-inheritance:
38 changes: 38 additions & 0 deletions docs/html/_sources/apidoc/ui_framework.tests.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
ui\_framework.tests package
===========================

Submodules
----------

ui\_framework.tests.tests\_api module
-------------------------------------

.. automodule:: ui_framework.tests.tests_api
:members:
:undoc-members:
:show-inheritance:

ui\_framework.tests.tests\_models module
----------------------------------------

.. automodule:: ui_framework.tests.tests_models
:members:
:undoc-members:
:show-inheritance:

ui\_framework.tests.utils module
--------------------------------

.. automodule:: ui_framework.tests.utils
:members:
:undoc-members:
:show-inheritance:


Module contents
---------------

.. automodule:: ui_framework.tests
:members:
:undoc-members:
:show-inheritance:
17 changes: 17 additions & 0 deletions docs/html/_sources/modules/how_to_use_it.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -213,3 +213,20 @@ Specifying the variables necessary to subscribe a to a group in a JSON message,
}
Where pairs :code:`param1` and :code:`value1` represent the parameters (name and value) to be passed to the command.


UI Framework
============

The UI Framework backend is composed of 3 models:

- **Workspace:** represents a workspace, composed by different views
- **View:** represents a view, all the data of the view is contained in JSON format in the :code:`data` field of the view
- **WorkspaceView:** relates a Workspace and a View, it is the intermediary table of the many-to-many relationship between Workspace and View.

Currently the API provides a standard REST api for these models.
For more info you can either:

- Use the browsable API available in: :code:`<IP>/manager/ui_framework/`
- See the apidoc in Swagger format, available in: :code:`<IP>/manager/apidoc/swagger/`
- See the apidoc in ReDoc format, available in: :code:`<IP>/manager/apidoc/redoc/`
11 changes: 6 additions & 5 deletions docs/html/_static/basic.css
Original file line number Diff line number Diff line change
Expand Up @@ -520,23 +520,24 @@ dl.citation > dd:after {
}

dl.field-list {
display: flex;
flex-wrap: wrap;
display: grid;
grid-template-columns: fit-content(30%) auto;
}

dl.field-list > dt {
flex-basis: 20%;
font-weight: bold;
word-break: break-word;
padding-left: 0.5em;
padding-right: 5px;
}

dl.field-list > dt:after {
content: ":";
}

dl.field-list > dd {
flex-basis: 70%;
padding-left: 1em;
padding-left: 0.5em;
margin-top: 0em;
margin-left: 0em;
margin-bottom: 0em;
}
Expand Down
Loading

0 comments on commit c1a56dd

Please sign in to comment.