Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update GSoC2024 projects in docs #2565

Open
wants to merge 30 commits into
base: stable
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
20bbf55
Merge pull request #2389 from Open-MSS/merge_stable_to_develop
ReimarBauer May 24, 2024
a650456
Merge branch 'stable' into merge_stable_to_develop
ReimarBauer Jul 4, 2024
455718f
Merge pull request #2427 from Open-MSS/merge_stable_to_develop
ReimarBauer Jul 4, 2024
eabc338
Fix spelling of the mslib.msui.aircraft module (#2429)
matrss Jul 7, 2024
6915b06
feat: Allow users to set custom profile pictures (#2405) (#2431)
ReimarBauer Jul 8, 2024
f814dab
Merge branch 'stable' into merge_stable_to_develop
ReimarBauer Aug 2, 2024
2753b87
Merge pull request #2446 from Open-MSS/merge_stable_to_develop
ReimarBauer Aug 2, 2024
42c8f2b
Use flask-migrate for database migrations (#2432)
matrss Aug 15, 2024
ad8e549
Bump benc-uk/workflow-dispatch from 1.2.3 to 1.2.4 (#2449)
dependabot[bot] Aug 15, 2024
da36488
Fix sequences after migrating data to PostgreSQL (#2466)
matrss Aug 21, 2024
4344e00
Fixes for using PostgreSQL (#2467)
matrss Aug 22, 2024
641b7f2
Merge branch 'stable' into merge_stable_to_develop
ReimarBauer Aug 22, 2024
2c89c79
Merge stable to develop (#2482)
ReimarBauer Aug 28, 2024
56f6c9e
Fix #2478 (#2479)
joernu76 Aug 28, 2024
0f294d9
Revert "Merge stable to develop (#2482)" (#2490)
joernu76 Aug 29, 2024
09afb6e
Merge pull request #2493 from Open-MSS/merge_stable_to_develop
ReimarBauer Aug 29, 2024
0b95679
Fix #2476
joernu76 Aug 22, 2024
d58f5fc
Gsoc2024 aryan gupta (#2501)
ReimarBauer Sep 4, 2024
ee9e832
remove the conda/mamba based updater. (#2495)
ReimarBauer Sep 6, 2024
863f052
renamed and refactored names for mscolab (#2499)
ReimarBauer Sep 6, 2024
52c7a04
rework active+archiving
joernu76 Aug 22, 2024
c485163
Use decorator to make msui/mscolab code more readable
joernu76 Aug 30, 2024
457ff08
fix:Further refactoring to simplify control flow (#2521)
joernu76 Sep 18, 2024
e33f8e3
fix #2530 (#2532)
joernu76 Sep 18, 2024
1c3693c
Merge branch 'stable' into merge_stable_to_develop
ReimarBauer Sep 19, 2024
4465221
Merge pull request #2537 from Open-MSS/merge_stable_to_develop
ReimarBauer Sep 19, 2024
22aa853
setup a config for tutorials to test the mscolab refactoring (#2528)
ReimarBauer Sep 19, 2024
b39536e
Improve tutorials (#2540)
ReimarBauer Sep 30, 2024
54854e1
Mscolab refactor2 (#2533)
joernu76 Sep 30, 2024
59a124a
Develop
sarthakvyas16 Oct 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ in alphabetic order by first name
- Andreas Hilboll <hilboll@uni-bremen.de>
- Anveshan Lal <anveshanrx8@gmail.com>
- Aravind Murali <aravindmurali711@gmail.com>
- Aryan Gupta <work.aryangupta@gmail.com>
- Christian Rolf <c.rolf@fz-juelich.de>
- Debajyoti Dasgupta <debajyotidasgupta6@gmail.com>
- Hrithik Kumar Verma <vermahrithik812@gmail.com>
Expand Down
6 changes: 3 additions & 3 deletions conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,9 @@ def generate_initial_config():
root_fs.makedir('colabTestData')
BASE_DIR = ROOT_DIR
DATA_DIR = fs.path.join(ROOT_DIR, 'colabTestData')
# mscolab data directory
MSCOLAB_DATA_DIR = fs.path.join(DATA_DIR, 'filedata')
MSCOLAB_SSO_DIR = fs.path.join(DATA_DIR, 'datasso')
# mscolab data directory for operation git repositories
OPERATIONS_DATA = fs.path.join(DATA_DIR, 'filedata')
SSO_DIR = fs.path.join(DATA_DIR, 'datasso')

# In the unit days when Operations get archived because not used
ARCHIVE_THRESHOLD = 30
Expand Down
6 changes: 6 additions & 0 deletions docs/conf_sso_test_msscolab.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,13 @@ To set up a local identity provider with the mscolab server, you'll first need t
----------------
Before getting started, you should correctly activate the environments, set the correct Python path as explained in the mss instructions : https://github.com/Open-MSS/MSS/tree/develop#readme

Setup your

**msidp_settings.py**

.. literalinclude:: samples/config/msidp/msidp_settings.py.sample

.. _configuration-mscolab:

2. Generate Keys, Certificates, and backend_saml files
------------------------------------------------------
Expand Down
31 changes: 30 additions & 1 deletion docs/development.rst
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ This plugin produces a coverage report, example::
--------------------------------------------------------------------------
mslib/__init__.py 2 0 0 0 100%
mslib/msui/__init__.py 23 0 0 0 100%
mslib/msui/aircrafts.py 52 1 8 1 97%
mslib/msui/aircraft.py 52 1 8 1 97%
mslib/msui/constants.py 12 2 4 2 75%
mslib/msui/flighttrack.py 383 117 141 16 66%

Expand Down Expand Up @@ -399,6 +399,26 @@ like e.g. a running MSColab server or a QApplication instance for GUI tests,
are collected in :mod:`tests.fixtures` in the form of pytest fixtures that can be requested as needed in tests.


Changing the database model
---------------------------

Changing the database model requires adding a corresponding migration script to MSS,
so that existing databases can be migrated automatically.

To generate such a migration script you can run::

flask --app mslib.mscolab.app db migrate -d mslib/mscolab/migrations -m "To version <next-major-version>"

Depending on the complexity of the changes that were made,
the generated migration script might need some tweaking.

If there is already a migration script for the next release,
then please incorporate the generated migration script into this existing one,
instead of adding a new one.
You can still generate a script with the above command first
to get a starting point for the changes.


Pushing your changes
--------------------

Expand Down Expand Up @@ -516,6 +536,15 @@ Google Summer of Code(TM)
MSS takes part in Google Summer of Code
as a sub-organization of Python Software Foundation(PSF).

GSoC'24 Projects
................

- `Aryan Gupta: (MSS) msui: Improve MSUI : GSoC 2024 <https://github.com/Open-MSS/MSS/wiki/Aryan-Gupta:-(MSS)-msui:-Improve-MSUI-:-GSOC2024>`_

- `Preetam-Das26: MISSION SUPPORT SYSTEM(MSS): GUI FOR AUTOMATED PLOTTING : GSOC 2024 <https://github.com/Open-MSS/MSS/wiki/Preetam-Sundar-Das:-MISSION-SUPPORT-SYSTEM(MSS):-GUI-FOR-AUTOMATED-PLOTTING-:-GSOC2024>`_

- `Rohit Prasad: Mission Support System: Improve multiple flightpath docking widget : GSOC 2024 <https://github.com/Open-MSS/MSS/wiki/Rohit-Prasad:-Mission-Support-System:-Improve-multiple-flightpath-docking-widget-:-GSOC2024>`_

GSoC'22 Projects
................

Expand Down
16 changes: 1 addition & 15 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -124,23 +124,9 @@ versions for dependencies. ::
(mssenv) $ msui


Update
------

Builtin Update
Update Methods
..............

Since version 5.0 we provide a feature for updating MSS by the UI or the command line
After you started the MSS UI it informs you after a while if there is a new update available.
From the command line you can trigger this update feature by ::

(mssenv) $ msui --update



Other Methods
.............

For updating an existing MSS installation to the current version, it is best to install
it into a new environment. If your current version is not far behind the new version
you could try the `mamba update mss` as described.
Expand Down
83 changes: 17 additions & 66 deletions docs/mscolab.rst
Original file line number Diff line number Diff line change
Expand Up @@ -150,75 +150,24 @@ by `pg_dump <https://www.postgresql.org/docs/current/app-pgdump.html>`_ using a
pg_dump -d mscolab -f "/home/mscolab/dump/$timestamp.sql"


Data Base Migration from version 8
..................................
Database Migration from Version 8 or 9
.................................

.. important::
This manual migration on the server side by a user is deprecated and will become removed with version 10.0.0.
With version 10.0.0, the initialization of the database will be refactored and migrations will be performed automatically when mscolab is started
From v10 onwards MSColab uses `Flask-Migrate <https://flask-migrate.readthedocs.io/en/latest/>` to automatically deal with database migrations.
To upgrade from v8 or v9 a recreation of the database and subsequent copy of existing data is necessary.
To do this follow these steps:

For an easy way to update the database scheme we implemented `flask migrate <https://flask-migrate.readthedocs.io/en/latest/>`_.

You have to create based on your configuration a migration script and call that afterwards. ::

mamba activate instance
cd ~/INSTANCE/config
export PYTHONPATH=`pwd`
cd ~/INSTANCE/wsgi
flask --app mscolab.py db init
flask --app mscolab.py db migrate -m "To version 9.0.0"
flask --app mscolab.py db upgrade

The migration script builder does the base but the created script needs first allow nullable so that we afterwards set the default for the existing data.
Use this as an example for your script ::

"""To version 9.0.0

Revision ID: e62d08ce88a4
Revises: 27a026b0daec
Create Date: 2024-06-07 16:53:43.314338

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'e62d08ce88a4'
down_revision = '27a026b0daec'
branch_labels = None
depends_on = None


def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('users', schema=None) as batch_op:
batch_op.add_column(sa.Column('authentication_backend', sa.String(length=255), nullable=True))
op.execute('UPDATE users SET authentication_backend = \'local\' WHERE authentication_backend IS NULL')

with op.batch_alter_table('users', schema=None) as batch_op:
batch_op.alter_column('authentication_backend', existing_type=sa.String(length=255), nullable=False)
batch_op.drop_constraint('users_password_key', type_='unique')

# ### end Alembic commands ###


def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('users', schema=None) as batch_op:
batch_op.create_unique_constraint('users_password_key', ['password'])
batch_op.drop_column('authentication_backend')

# ### end Alembic commands ###


The output looks like ::

~/INSTANCE/wsgi$ flask --app mscolab.py db upgrade
INFO [alembic.runtime.migration] Context impl SQLiteImpl.
INFO [alembic.runtime.migration] Will assume non-transactional DDL.
INFO [alembic.runtime.migration] Running upgrade -> e62d08ce88a, To version 9.0.0
#. Stop MSColab completely, no process interacting with the MSColab database should remain running
#. **Make a backup of your existing database**
#. Set ``SQLALCHEMY_DB_URI_TO_MIGRATE_FROM`` to your existing database
#. Set ``SQLALCHEMY_DB_URI`` to a new database
#. If you are not using SQLite: create the new database
#. Start MSColab
#. Check that everything was migrated successfully
#. Unset ``SQLALCHEMY_DB_URI_TO_MIGRATE_FROM``

If you want to keep using your old database URI you can first rename your existing database so that it has a different URI
and just set ``SQLALCHEMY_DB_URI_TO_MIGRATE_FROM`` to that.


Steps to use the MSColab UI features
Expand All @@ -241,6 +190,8 @@ Operation based features
- All the operations the user has created or has been added to can be found in Mscolab's main window along with the user's access level.
- To start working on an operation the user needs to select it which enables all the operation related buttons.
- Any change made to an operation by a user will be shared with everyone in real-time unless `Work Locally` is turned on.(More on this later)
- Operations can be manually archived to remove them from normal view without having to delete them.
They can be found again in the Archive view, where they can be unarchived for further use.

Operation Permissions
.....................
Expand Down
18 changes: 10 additions & 8 deletions docs/samples/config/mscolab/mscolab_settings.py.sample
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,16 @@ BASE_DIR = os.path.abspath(os.path.dirname(__file__))
# Directory in which all data related to Mscolab is stored
DATA_DIR = os.path.join(BASE_DIR, "colabdata")

# Where mscolab project files are stored on the server
MSCOLAB_DATA_DIR = os.path.join(DATA_DIR, 'filedata')
# mscolab data directory for operation git repositories
OPERATIONS_DATA = os.path.join(DATA_DIR, 'filedata')

# SSO by SAML2 is optional

# dir where mscolab single sign-on process files are stored
SSO_DIR = os.path.join(DATA_DIR, 'datasso')

# Enable SSL certificate verification during SSO between MSColab and IdP
SSO_SSL_CERT_VERIFICATION = True

# Directory where uploaded images and documents in the chat are stored
UPLOAD_FOLDER = os.path.join(DATA_DIR, 'uploads')
Expand Down Expand Up @@ -99,9 +107,3 @@ USE_SAML2 = False
# all users in that Group are set to the operations of that category
# having the roles in the TexGroup
GROUP_POSTFIX = "Group"

# Enable SSL certificate verification during SSO between MSColab and IdP
ENABLE_SSO_SSL_CERT_VERIFICATION = True

# dir where mscolab single sign process files are stored
MSCOLAB_SSO_DIR = os.path.join(DATA_DIR, 'datasso')
10 changes: 5 additions & 5 deletions docs/samples/config/mscolab/setup_saml2_backend.py.sample
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,19 @@ class setup_saml2_backend:

]

if os.path.exists(f"{mscolab_settings.MSCOLAB_SSO_DIR}/mss_saml2_backend.yaml"):
with open(f"{mscolab_settings.MSCOLAB_SSO_DIR}/mss_saml2_backend.yaml", encoding="utf-8") as fobj:
if os.path.exists(f"{mscolab_settings.SSO_DIR}/mss_saml2_backend.yaml"):
with open(f"{mscolab_settings.SSO_DIR}/mss_saml2_backend.yaml", encoding="utf-8") as fobj:
yaml_data = yaml.safe_load(fobj)
# go through configured IDPs and set conf file paths for particular files
for configured_idp in CONFIGURED_IDPS:
# set CRTs and metadata paths for the localhost_test_idp
if 'localhost_test_idp' == configured_idp['idp_identity_name']:
yaml_data["config"]["localhost_test_idp"]["key_file"] = \
f'{mscolab_settings.MSCOLAB_SSO_DIR}/key_mscolab.key' # set path to your mscolab key file
f'{mscolab_settings.SSO_DIR}/key_mscolab.key' # set path to your mscolab key file
yaml_data["config"]["localhost_test_idp"]["cert_file"] = \
f'{mscolab_settings.MSCOLAB_SSO_DIR}/crt_mscolab.crt' # set path to your mscolab certificate file
f'{mscolab_settings.SSO_DIR}/crt_mscolab.crt' # set path to your mscolab certificate file
yaml_data["config"]["localhost_test_idp"]["metadata"]["local"][0] = \
f'{mscolab_settings.MSCOLAB_SSO_DIR}/idp.xml' # set path to your idp metadata xml file
f'{mscolab_settings.SSO_DIR}/idp.xml' # set path to your idp metadata xml file

# configuration localhost_test_idp Saml2Client
try:
Expand Down
36 changes: 36 additions & 0 deletions docs/samples/config/msidp/msidp_settings.py.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# -*- coding: utf-8 -*-
"""

mslib.msidp.conf.py.example
~~~~~~~~~~~~~~~~~~~~~~~~~~~

config for msidp

This file is part of mss.

:copyright: Copyright 2023 Nilupul Manodya
:copyright: Copyright 2023-2024 by the MSS team, see AUTHORS.
:license: APACHE-2.0, see LICENSE for details.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""
import os


# our default dir for mss content
BASE_DIR = os.path.join(os.path.expanduser("~"), 'mss')

DATA_DIR = os.path.join(BASE_DIR, "colabdata")

# dir where mscolab single sign-on process files are stored
SSO_DIR = os.path.join(DATA_DIR, 'datasso')
2 changes: 1 addition & 1 deletion docs/sso_via_saml_mscolab.rst
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ Configuration in MSColab settings for Keycloak

Configuration mss_saml2_backend.yaml file

Create your mss_saml2_backend.yaml file in your ``MSCOLAB_SSO_DIR``.
Create your mss_saml2_backend.yaml file in your ``SSO_DIR``.

.. code:: text

Expand Down
29 changes: 25 additions & 4 deletions mslib/mscolab/app/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
"""

import os
import logging
import sqlalchemy

from flask_migrate import Migrate

Expand All @@ -33,7 +35,11 @@
from flask import Flask, url_for
from mslib.mscolab.conf import mscolab_settings
from flask_sqlalchemy import SQLAlchemy
from mslib.utils import prefix_route
from mslib.utils import prefix_route, release_info

message, update = release_info.check_for_new_release()
if update:
logging.warning(message)


DOCS_SERVER_PATH = os.path.dirname(os.path.abspath(mslib.__file__))
Expand All @@ -46,7 +52,7 @@
APP.config.from_object(__name__)
APP.route = prefix_route(APP.route, SCRIPT_NAME)

APP.config['MSCOLAB_DATA_DIR'] = mscolab_settings.MSCOLAB_DATA_DIR
APP.config['OPERATIONS_DATA'] = mscolab_settings.OPERATIONS_DATA
APP.config['SQLALCHEMY_DATABASE_URI'] = mscolab_settings.SQLALCHEMY_DB_URI
APP.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
APP.config['SQLALCHEMY_ECHO'] = mscolab_settings.SQLALCHEMY_ECHO
Expand All @@ -62,8 +68,23 @@
APP.config['MAIL_USE_TLS'] = getattr(mscolab_settings, "MAIL_USE_TLS", None)
APP.config['MAIL_USE_SSL'] = getattr(mscolab_settings, "MAIL_USE_SSL", None)

db = SQLAlchemy(APP)
migrate = Migrate(APP, db, render_as_batch=True)
db = SQLAlchemy(
metadata=sqlalchemy.MetaData(
naming_convention={
# For reference: https://alembic.sqlalchemy.org/en/latest/naming.html#the-importance-of-naming-constraints
"ix": "ix_%(column_0_label)s",
"uq": "uq_%(table_name)s_%(column_0_name)s",
"ck": "ck_%(table_name)s_`%(constraint_name)s`",
"fk": "fk_%(table_name)s_%(column_0_name)s_%(referred_table_name)s",
"pk": "pk_%(table_name)s",
},
),
)
db.init_app(APP)
import mslib.mscolab.models

migrate = Migrate(render_as_batch=True, user_module_prefix="cu.")
migrate.init_app(APP, db)


def get_topmenu():
Expand Down
Loading