1
0
Fork 0
mirror of https://github.com/yweber/lodel2.git synced 2025-11-13 01:19:16 +01:00
No description
Find a file
Yann c5522816fe Starting implementation of the forking webserver
The server is listening, fork on new request, and then loads the context from URL.
Now we have to call properly the webui plugin in order to answer the request
2016-11-03 16:10:40 +01:00
debian Update the build-dependencies of the package 2016-09-23 16:56:04 +02:00
doc/img Add autyhentication/session flowcharts 2016-08-10 11:10:33 +02:00
examples em_test updates 2016-09-30 17:26:30 +02:00
globconf.d Add a new sttings validator + use it 2016-09-08 14:48:35 +02:00
lodel Changes to slim for LodelContext 2016-11-03 16:03:14 +01:00
lodelsites Bugfix with debian package build 2016-11-03 10:54:24 +01:00
m4 Add a forgotten (not mandatory file) 2016-09-07 14:43:27 +02:00
plugins Starting implementation of the forking webserver 2016-11-03 16:10:40 +01:00
progs Changes to slim for LodelContext - some corrections 2016-11-03 16:03:14 +01:00
scripts bugfix in CBL 2016-09-30 17:26:30 +02:00
tests em_test updates 2016-09-30 17:26:30 +02:00
.gitignore Updated the doxygen documentation 2016-01-27 16:58:55 +01:00
AUTHORS Configure autotools for distributing lodel2 2016-08-30 14:01:25 +02:00
bootstrap.sh Configure autotools for distributing lodel2 2016-08-30 14:01:25 +02:00
ChangeLog Configure autotools for distributing lodel2 2016-08-30 14:01:25 +02:00
configure.ac Bugfix with debian package build 2016-11-03 10:54:24 +01:00
COPYING Configure autotools for distributing lodel2 2016-08-30 14:01:25 +02:00
Doxyfile Doxygen documentation update 2016-08-31 11:58:06 +02:00
em_test.py em_test updates 2016-09-30 17:26:30 +02:00
INSTALL Configure autotools for distributing lodel2 2016-08-30 14:01:25 +02:00
Makefile.am Bugfix with debian package build 2016-11-03 10:54:24 +01:00
NEWS Configure autotools for distributing lodel2 2016-08-30 14:01:25 +02:00
README Modified README to deploy in VM 2016-10-04 17:00:10 +02:00
requirements.txt Updated the requirements file 2016-06-23 14:46:10 +02:00
runtest.sh Fixed runtest scripts 2016-10-19 11:50:40 +02:00

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

Dependencies :
==============

	lodel2 components :
	-------------------
		core :
			python3 python3-lxml

		build dependencies :
			autoconf automake make

		webui plugin :
			python3-jinja2 python3-werkzeug uwsgi-plugin-python3

		mongodb_datasource plugin :
			python3-pymongo

	lodel2 utils :
	--------------
		mass_deploy dependencies :
			pwgen wamerican mongodb-clients

Build & install :
=================

	./bootstrap.sh #generate the configure, refresh the Makefile.in files
	#--prefix=/usr is mandatory on debian because of a python3.4.2 bug
	./configure --sysconfdir=/etc --localstatedir=/var --prefix=/usr
	#build lodel2 (actually substitute paths script and buildconf.py files)
	make
	#Install lodel2 on system
	make install
	#Uninstall lodel2
	make uninstall

Creating debian package :
=========================

	make deb

Other make targets :
====================

	Doxygen documentation generation :
	----------------------------------
		make doxygen

	Run unit tests :
	----------------

		make check
		#or
		make unittest
	
	Cleaning to stop being annoyed when running git status :
	--------------------------------------------------------
		
		make gitclean

Lodel2 instance management utilities :
======================================
NOTE: You have to run in root to use this below
	SLIM : Simple Lodel Instance Manager
	------------------------------------

		- create a new instance named foo :
			slim -n foo -c

		- list instances : 
			slim -l

		- list instances with details :
			slim -lv[v[v]]

		- list instances with output formated for bash processing :
			slim -l -b [-v[v[v]]

		- run make all for instance foo :
			slim -n foo -m

		- run make for all existing instances :
			slim --all -m

		- start an instance in forground
			slim -n foo --start -f

		- start all instances :
			slim -a --start

		- generate a nginx conf for all instances :
			slim -a --nginx-conf

		- get some help for more options & actions :
			slim -h


	mass_deploy.sh :
	----------------
		Use for easy mass deployment of instances with webui & uwsgi
		the script at $prefix/share/lodel2/scripts/mass_deploy.sh

		Usage : 
		-------
			#with N the number of instances to deploy
			mass_deploy.sh N 		

		Notes :
		-------

		- configuration can be found in /etc/lodel2/mass_deploy.cfg 
		  to indicate mongodb admin credentials

		- mass deploy create instances directories 
		  in /tmp/lodel2_instances

Mass deployments tricks & tips:
===============================

	Mass deployment on fresh install :
	----------------------------------
	
	#Install nginx & mongodb
	apt-get install nginx mongodb-server mongodb-clients
	#choose your credential
	export mongoadmin="admin"; export mongopass="pass";
	#Disable auth to be able to connect to mongodb
	sed -ie 's/^#noauth = /noauth = /' /etc/mongodb.conf
	#Add an admin user to mongodb
	echo -e "use admin\ndb.addUser('$mongoadmin', '$mongopass')\nexit\n"|mongo
	#Reactivate auth
	sed -i -e 's/^noauth = /#noauth =/' -e 's/^#auth = /auth =/' /etc/mongodb.conf
	#Test connection
	echo "exit" | mongo --quiet -u $mongoadmin -p $mongopass admin && echo "Connection ok" || echo "connection fails"
	#Indicate mongodb credentials to mass_deploy
	echo -e "MONGODB_ADMIN_USER='$mongoadmin'\nMONGODB_ADMIN_PASSWORD='$mongopass'\n" >> /etc/lodel2/mass_deploy.cfg
	#Deploying 50 instances
	NINSTANCE=50
	#Running mass_deploy
	/usr/share/lodel2/scripts/mass_deploy $NINSTANCE
	#Updating nginx conf (delete /etc/nginx/sites-enabled/default if exists)
	slim --nginx-conf -a > /etc/nginx/sites-enabled/lodel2
	/etc/init.d/nginx reload
	#Start all instances and check if they managed to start
	slim --start -a && sleep 2 && slim -l


	Cleaning mongodb + instances :
	------------------------------

	slim --purge && /usr/share/lodel2/scripts/mass_deploy purgedb ; slim -l

	Debuging an instance in foreground (if it didn't manage to start) :
	-------------------------------------------------------------------

	slim --start -f -n INSTANCE_NAME

Instance operations :
=====================

	- Two utils are available for instances operations :
		* Make for op without parameters
		* lodel_admin.py for op with parameters

	- Makefile available target :
		# Leapi dynamic code creation ( in leapi_dyncode.py in lodel2 
		#instance root dir)
		make dyncode 

		# Call migration handlers to tell them to init all needed 
		#databases. (note : this target has dyncode as dependencie)
		make init_db 
		make list_hooks # List all the hooks registered

	- lodel_admin.py : see lodel_admin.py -h


##########################################
# Following informations can be obsolete #
##########################################

Dynamic code generation :
	python3 scripts/refreshdyn.py examples/em_test.pickle OUTPUTFILE.py

Instance creation :
	Use the script in scripts/create_instance.sh

	Usage : scripts/create_instance.sh instance_name instance_dir [lodel_libdir]


Instance loader uppdate :
	If the install/loader.py is updated you can update instance's loader.py using
		scripts/create_instance.sh -u INSTANCE_PATH