Commit fec6607f authored by Nathalie Rousse's avatar Nathalie Rousse
Browse files

Comments and documentation

parent 7ffb6bae
......@@ -280,7 +280,7 @@ class ActivityLock(Lock):
if vpzact.id is not None :
if vpzact.has_lock() :
lock = vpzact.lock_list.all()[0] # the only one
#if not isinstance(lock, ActivityLock) : # should be !!!
#if not isinstance(lock, ActivityLock) : #...should be
if hasattr(vpzact, "vpzorigin"):
lock.lock(vpzact.vpzorigin)
if hasattr(vpzact, "vpzinput"):
......@@ -318,7 +318,7 @@ class ActivityLock(Lock):
if (vpzact.id is not None) and (load_document.id is not None) :
if vpzact.has_lock() :
activity_lock = vpzact.lock_list.all()[0] # the only one
#if not isinstance(activity_lock, ActivityLock) : #should be!!!
#if not isinstance(activity_lock, ActivityLock) : #...should be
activity_user = activity_lock.get_user()
load_lock = LoadLock(text=text)
load_lock.save()
......
......@@ -41,7 +41,7 @@ class VleRepInline(admin.TabularInline):
class VleVersionAdmin(admin.ModelAdmin):
form = VleVersionForm
list_display = ('id', 'name', 'verbose_name', 'usr_path',)
#actions = [generate_tree, update_tree, delete_tree] ...!!!
#actions = [generate_tree, update_tree, delete_tree] ...could be added
inlines = [VleRepInline]
search_fields = ['name']
......
......@@ -75,13 +75,13 @@ def get_vlereppath_choices() :
text = "Don't choose one of the following values, \
(existing vle packages shown only for help) :"
#!! plus = [ empty_choice, ("",text) ]
#!! for (path,c) in choices_list :
#!! for pkgname in get_rep_pkgname_list(path) :
#!! text = c+": "+pkgname
#!! plus.append( ("",text) )
#!! for p in plus :
#!! choices_list.append(p)
#plus = [ empty_choice, ("",text) ]
#for (path,c) in choices_list :
# for pkgname in get_rep_pkgname_list(path) :
# text = c+": "+pkgname
# plus.append( ("",text) )
#for p in plus :
# choices_list.append(p)
choices_list.insert(0, empty_choice)
......
......@@ -22,21 +22,23 @@ from erecord_cmn.utils.vle import is_structured_as_vle_version_name
from erecord_cmn.utils.vle import is_structured_as_vle_install
from erecord_cmn.utils.vle import vle_bash_cmd
# !!!!!!!!!!!!! a deplacer dans traitement repository
###############################################################################
#
# Operations to record a (already physically installed)
# models repository into the database :
#
# Notes about current management and some possible improvements
#
# Operations to record a (already physically installed) models repository into
# the database :
#
# The models repository is recorded into the database through the following
# information : its own characteristics (VleRep), the set of its vle packages
# { VlePkg } and their vpz files { VleVpz }.
#
# inputs :
# - path : path of the directory where the models repository has been
# installed.
# Input information :
# - path : path of the folder where the models repository has been installed.
# - name : name given to the models repository into the database
#
# outputs (result into the database) :
# Result into the database :
# - VleRep, the set of its vle packages { VlePkg } and their vpz files
# { VleVpz }.
#
......@@ -44,32 +46,34 @@ from erecord_cmn.utils.vle import vle_bash_cmd
#
# 1) Creation of VleRep
#
# 2) Creation of the { VlePackage } of VleRep :
# 2) Creation of the { VlePkg } of VleRep :
#
# Functions are called to define packages_list, the list of the
# existing vle packages of VleRep ; then for each pkg in packages_list,
# creation of VlePkg :
# Definition of packages_list, the list of the existing vle packages of
# VleRep ; then for each pkg in packages_list, creation of VlePkg :
# - VleRep = the VleRep
# - name = pkg
# (- others : description, maintainer ...)
#
# At this step, the local.pkg file could be used (if active) to :
# a) control packages_list (coherence between packages_list from vle
# functions and packages_list from local.pkg).
# b) define/get some information for each pkg in packages_list :
# (- depends_list : list of the vle packages that it depends on.)
# - others : description, maintainer ...
#
# 3) Creation of the { VleVpz } of the { VlePkg } of the VleRep :
#
# For each VlePkg of the VleRep : vle functions are called to define
# vpzfiles_list, the list of its vpz files ; then for each vpz in
# vpzfiles_list, creation of VleVpz :
# For each VlePkg of the VleRep : definition of vpzfiles_list, the list of
# its vpz files ; then for each vpz in vpzfiles_list, creation of VleVpz :
# - VlePkg = the VlePkg
# - name = vpz
#
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
# Some possible improvements :
#
# - when treating packages_list (see 2.), the vle local.pkg file could be
# used (if active) to :
#
# a) control packages_list (coherence between the defined/found
# packages_list and packages_list from local.pkg).
#
# b) define/get some information for each pkg in packages_list :
# (- depends_list : list of the vle packages that it depends on.)
# - others : description, maintainer ...
#
###############################################################################
# A vle version is recorded into the database through the following
# information : its own characteristics (VleVersion), the set of its
......@@ -101,9 +105,9 @@ class VleVersion(DefaultVerboseNameMixin, models.Model):
usr_path = models.FilePathField(blank=False,
help_text=ht_vleversion_usr_path)
#def delete_tree(self): ...!!!!
#def generate_tree(self): ...!!!!
#def update_tree(self): ...!!!!
#def delete_tree(self): ...could be added
#def generate_tree(self): ...could be added
#def update_tree(self): ...could be added
def clean(self):
"""clean """
......@@ -211,9 +215,6 @@ class VleRep(DefaultVerboseNameMixin, VleRepMixin, models.Model):
"VLE_HOME directory."
raise ValidationError(msg)
# verifier aussi pkgs-V conforme a self.vleversion.name vle-V.rev !!!
def save(self, *args, **kwargs):
"""save """
self.set_default_value_verbose_name()
......
......@@ -45,7 +45,6 @@ class VleRepMixin(object):
vlepkg.vlevpz_list.create(name=vlevpzname)
def read_and_update_tree(self) :
pass
"""reads a VleRep tree (its vle packages and their vpz files) in its
path and add or remove the relevant VlePkg and VleVpz into the
database """
......
......@@ -107,7 +107,7 @@ class VlehomeWorkspaceMixin(WorkspaceMixin):
src = vlepkgpath
dest = os.path.join(pkgs_path,pkgname)
if pkgname == "erecord" : # particular case !!!
if pkgname == "erecord" : # particular case
shutil.copytree(src, dest)
output_path = get_pkg_output_path(pkg_path=dest)
create_dir_if_absent(dirpath=output_path)
......
......@@ -329,7 +329,6 @@ def home_services( request, pk=None, format=None ):
"whose id is vpzpath="+str(pk)+ " (value to be replaced by " + \
"the VpzPath id value)."
#!!! a revoir !!!
titles['id'] = capital + " of the existing "+classname+" whose id " + \
"is "+str(pk)+" (value to be replaced by the "+classname+ \
" id value)."
......
*******************************************************************************
Run vle simulation (development under ubuntu)
*******************************************************************************
"RENAME" !!!
ln -s /home/nrousse/workspace_git/DEVELOPPEMENT_WEB/recordweb/vle-x/trunk/erecord /opt/erecord
*******************************************************************************
vle-2.0.0
source /opt/erecord/erecord/install/vle_2.0.0_precmd.sh
verif : vle --version
export VLE_HOME=/work/erecord/.vle
vle -P pkgname vpzname.vpz
*******************************************************************************
vle-1.1.3
source /opt/erecord/erecord/install/vle_1.1.3_precmd.sh
verif : vle --version
*******************************************************************************
*******************************************************************************
Install development sous ubuntu
Install erecord
*******************************************************************************
Case of development under ubuntu
================================
see ubuntu/install.txt
"RENAME" : ln -s /home/nrousse/workspace_git/DEVELOPPEMENT_WEB/recordweb/vle-x/trunk/erecord /opt/erecord
General
=======
-------
The erecord project software is developed with :
......@@ -37,7 +55,7 @@ Some other basic required tools :
Installation of the erecordenv virtualenv
=========================================
-----------------------------------------
* erecordenv creation :
virtualenv /opt/erecord/factory/install/erecordenv -p /usr/bin/python2.7 --no-site-packages
......@@ -58,7 +76,7 @@ Installation of the erecordenv virtualenv
erecord software modifications and generations
==============================================
----------------------------------------------
* /opt/erecord/erecord/apps/erecord_cmn/configs/config.py :
......@@ -81,12 +99,13 @@ erecord software modifications and generations
* DOC STATIC...
INSTALL vle
===========
Install vle
-----------
* INSTALL vle-2.0.0 and its dependencies,
* INSTALL vle-1.1.3 and its dependencies,
* INSTALL repositories :
* Install vle and its dependencies, models repositories
(vle-1.1.3 version, vle-2.0.0 version) :
see dev_install_vle.txt
see install_vle.txt
*******************************************************************************
*******************************************************************************
Install vle and models repositories (vle packages)
*******************************************************************************
Case of development under ubuntu
================================
see ubuntu/install_vle.txt
*******************************************************************************
*******************************************************************************
Run erecord (development under ubuntu)
Run erecord
*******************************************************************************
"RENAME" !!!
ln -s /home/nrousse/workspace_git/DEVELOPPEMENT_WEB/recordweb/vle-x/trunk/erecord /opt/erecord
Case of development under ubuntu
================================
"RENAME" : ln -s /home/nrousse/workspace_git/DEVELOPPEMENT_WEB/recordweb/vle-x/trunk/erecord /opt/erecord
cd /opt/erecord/erecord/projects/ws
* erecordenv :
erecordenv
----------
#source ../../../factory/install/erecordenv/bin/activate.csh
source ../../../factory/install/erecordenv/bin/activate
... which python ...
source ../../../factory/install/erecordenv/bin/activate ; which python
* django INIT :
django INIT
-----------
python manage.py makemigrations erecord_db
python manage.py makemigrations erecord_acs
......@@ -26,8 +32,11 @@ cd /opt/erecord/erecord/projects/ws
python manage.py collectstatic
python manage.py runserver
* django :
django
------
python manage.py migrate
python manage.py runserver
*******************************************************************************
*******************************************************************************
Run vle simulation (vpzname.vpz simulator of pkgname vle package)
*******************************************************************************
(Case of development under ubuntu)
(================================)
"RENAME" : ln -s /home/nrousse/workspace_git/DEVELOPPEMENT_WEB/recordweb/vle-x/trunk/erecord /opt/erecord
Case of vle-1.1.3 version
-------------------------
source /opt/erecord/erecord/install/vle_1.1.3_precmd.sh ; vle --version
export VLE_HOME=/opt/erecord/repositories/vle-1.1.3/pkgname
vle -P pkgname vpzname.vpz
Case of vle-2.0.0 version
-------------------------
source /opt/erecord/erecord/install/vle_2.0.0_precmd.sh ; vle --version
export VLE_HOME=/opt/erecord/repositories/vle-2.0.0/pkgname
vle -P pkgname vpzname.vpz
*******************************************************************************
*******************************************************************************
Install erecord
Case of development under ubuntu
*******************************************************************************
"RENAME" : ln -s /home/nrousse/workspace_git/DEVELOPPEMENT_WEB/recordweb/vle-x/trunk/erecord /opt/erecord
General
=======
The erecord project software is developed with :
- python language (python 2.7 version),
- django framework,
- some django applications, like for example django-rest-framework.
- SQLite for databases.
- Sphinx for documentation.
Some other basic required tools :
- virtualenv
- install LibYAML version 0.1.5 :
- Download and extract the source package :
wget http://pyyaml.org/download/libyaml/yaml-0.1.5.tar.gz
tar -zxvf yaml-0.1.5.tar.gz
- Build and install LibYAML :
./configure
make
sudo make install
- install about libcurl :
sudo apt-get install libcurl4-openssl-dev
sudo apt-get install libssl-dev
Installation of the erecordenv virtualenv
=========================================
erecordenv creation
-------------------
virtualenv /opt/erecord/factory/install/erecordenv -p /usr/bin/python2.7 --no-site-packages
erecordenv virtualenv activation
--------------------------------
- in bash or sh case :
source /opt/erecord/factory/install/erecordenv/bin/activate
- in csh or tcsh case :
source /opt/erecord/factory/install/erecordenv/bin/activate.csh
- just to control the activation on the erecordenv virtualenv :
which python
- installation from requirement.txt :
pip install -r /opt/erecord/erecord/install/requirement.txt
erecord software modifications and generations
==============================================
/opt/erecord/erecord/apps/erecord_cmn/configs/config.py
-------------------------------------------------------
IN_PRODUCTION = False
ONLINEDOC_URL = 'http://erecord.toulouse.inra.fr/docs.html' ...?
/opt/erecord/erecord/projects/ws/ws/settings.py
-----------------------------------------------
DEBUG = True
/opt/erecord/docs/source/devel/design/webapi/include/online_url.rst and
/opt/erecord/docs/source/devel/design/webapi/include/online_*.rst
-----------------------------------------------------------------
Put the appropriate url value : http://erecord.toulouse.inra.fr:8000 ...?
(commands, if '127.0.0.1' has to be replaced by 'erecord.toulouse.inra.fr' into online_*.rst files :
cd /home/erecord/save/opt/erecord/docs/source/devel/design/webapi/include ;
sed -i 's/127.0.0.1/erecord.toulouse.inra.fr/g' online_url*.rst ; )
DOC STATIC
----------
............
Install vle
===========
Install vle and its dependencies, models repositories (vle-X.a.b versions)
--------------------------------------------------------------------------
see install_vle.txt
*******************************************************************************
*******************************************************************************
Install vle and models repositories (vle packages)
Case of development under ubuntu
*******************************************************************************
"RENAME" : ln -s /home/nrousse/workspace_git/DEVELOPPEMENT_WEB/recordweb/vle-x/trunk/erecord /opt/erecord
*******************************************************************************
Install vle
Case of development under ubuntu
*******************************************************************************
Case of vle-1.1.3 version
=========================
see install_vle_1.1.3.txt
Case of vle-2.0.0 version
=========================
see install_vle_2.0.0.txt
*******************************************************************************
Install models repositories (vle packages)
Case of development under ubuntu
*******************************************************************************
Case of vle-1.1.3 version
=========================
see install_vle_1.1.3_repositories.txt
Case of vle-2.0.0 version
=========================
see install_vle_2.0.0_repositories.txt
*******************************************************************************
*******************************************************************************
Install vle
Case of :
- development under ubuntu
- vle-1.1.3 version
*******************************************************************************
"RENAME" : ln -s /home/nrousse/workspace_git/DEVELOPPEMENT_WEB/recordweb/vle-x/trunk/erecord /opt/erecord
INSTALL vle-1.1.3 and its dependencies
======================================
* Dependencies (Ubuntu 16.04) : (nothing more than for vle-2.0.0)
* VLE :
- Get the source :
mkdir /opt/erecord/factory/install/vle-1.1.3
cd /opt/erecord/factory/install/vle-1.1.3
git clone https://github.com/vle-forge/vle.git
cd vle
git checkout -b v1.1.3 v1.1.3
- Build the code :
cd /opt/erecord/factory/install/vle-1.1.3/vle
mkdir build && cd build
mkdir /opt/erecord/factory/install/usr_1.1.3
cmake -DWITH_GTKSOURCEVIEW=OFF -DWITH_GTK=OFF -DWITH_CAIRO=ON \
-DWITH_MPI=OFF \
-DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_INSTALL_PREFIX=/opt/erecord/factory/install/usr_1.1.3 ..
make
make install
*******************************************************************************
*******************************************************************************
Install vle and packages (development under ubuntu)
*******************************************************************************
"RENAME" : ln -s /home/nrousse/workspace_git/DEVELOPPEMENT_WEB/recordweb/vle-x/trunk/erecord /opt/erecord
vle-2.0.0
=========
INSTALL vle-2.0.0 and its dependencies
--------------------------------------
...Following http://www.vle-project.org/download/linux/
* Dependencies : Boost (...using mpi)
- Install dependencies (Ubuntu 16.04) :
sudo apt-get update
sudo apt-get install curl libxml2-dev libboost-dev cmake pkg-config g++
* VLE :
- Get the source :
cd $HOME
cd /opt/erecord/factory/install
wget http://vle-project.org/pub/vle/2.0/2.0.0/vle-2.0.0.tar.gz
tar zxf vle-2.0.0.tar.gz
cd vle-2.0.0
- Build the code :
cd vle-2.0.0