Commit 3d533afe authored by Laurent Claustre's avatar Laurent Claustre

Merge branch '3-create-ci-and-conda-build' into 'master'

Resolve "create CI and conda build"

Closes #3

See merge request limagroup/bpm-web!8
parents f063e843 1e771fb1
Pipeline #16394 passed with stages
in 1 minute and 47 seconds
node_modules/
build/
*~
stages:
- build
- deploy
build-noarch:
stage: build
script:
- conda build ./conda --prefix-length=80 --output-folder=dist/ -c conda-forge -c tango-controls --channel=http://bcu-ci.esrf.fr/stable
artifacts:
paths:
- dist/
tags:
- conda
deploy_devel:
stage: deploy
environment:
name: devel/$CI_COMMIT_REF_NAME
url: http://bcu-ci.esrf.fr/devel
dependencies:
- build-noarch
script:
- cp -Rf dist/* /conda-devel/
- conda index /conda-devel/
tags:
- conda
- linux
only:
- branches
except:
- stable
when: manual
deploy_stable:
stage: deploy
environment:
name: production
url: http://bcu-ci.esrf.fr/stable
dependencies:
- build-noarch
script:
- cp -Rf dist/* /conda/
- conda index /conda/
tags:
- conda
- linux
only:
- tags
- stable
###########################################################################
# This file is part of LImA, a Library for Image Acquisition
#
# Copyright (C) : 2009-2019
# European Synchrotron Radiation Facility
# CS40220 38043 Grenoble Cedex 9
# FRANCE
#
# Contact: lima@esrf.fr
#
# This is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>.
############################################################################
cmake_minimum_required(VERSION 3.1)
project(lima-bpm-web-server NONE)
find_package(PythonInterp REQUIRED)
find_package(PythonLibs REQUIRED)
# python site-packages folder
execute_process(
COMMAND ${PYTHON_EXECUTABLE} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib())"
OUTPUT_VARIABLE _PYTHON_SITE_PACKAGES_DIR
OUTPUT_STRIP_TRAILING_WHITESPACE
)
set(PYTHON_SITE_PACKAGES_DIR ${_PYTHON_SITE_PACKAGES_DIR} CACHE PATH "where should python modules be installed?")
install(PROGRAMS scripts/LimaBpmWebServer DESTINATION "${CMAKE_INSTALL_PREFIX}/bin")
install(FILES webserver.py DESTINATION "${PYTHON_SITE_PACKAGES_DIR}/LimaBpmWebServer")
install(FILES index.html DESTINATION "${PYTHON_SITE_PACKAGES_DIR}/LimaBpmWebServer")
install(FILES __init__.py DESTINATION "${PYTHON_SITE_PACKAGES_DIR}/LimaBpmWebServer")
install(DIRECTORY webpack_output DESTINATION "${PYTHON_SITE_PACKAGES_DIR}/LimaBpmWebServer")
This diff is collapsed.
......@@ -13,11 +13,15 @@
The web-server can be only used with the LimaCCDs tango server version 1.9.2 or greater.
## Web interface
![LimaBpmWebServer on firefox](doc/LimaBpmWebServer-1.png)
## Install from conda package
A Conda package is available on Anaconda forge from channel `esrf-bcu`:
```bash
conda install -c esrf-bcu -c tango-controls lima-bpm-webserver
conda install -c esrf-bcu -c tango-controls lima-bpm-web-server
```
## Build & Install from source
......@@ -28,7 +32,7 @@ and to run the server.
### Get the source from github.com
git clone https://github.com/esrf-bliss/Lima-bpm-webserver
git clone https://github.com/esrf-bliss/Lima-bpm-web-server
### Install dependencies
......@@ -92,4 +96,4 @@ optional arguments:
The white-list yml file allows to provide a short list of cameras you want to access through the web interface. One can find a example file whitelist-example.yml
Without a white-list the server will access the Tango database to find all the LimaCCDs servers running on your local network.
Start a browser pointing to [localhost:8066](http://localhost:8066)
\ No newline at end of file
Start a browser pointing to [localhost:8066](http://localhost:8066)
==============
Bpm-webserver
==============
Repository for the BeamViewer using the new Bpm_
.. _Bpm: https://gitlab.esrf.fr/limagroup/Lima-tango-python/blob/1-bpm-device/plugins/Bpm.py
Description
------------
This project is a BeamViewer using web technologies, it can be open from a browser and display images and informations. All camera running new Bpm plugin are accessible from url @host.esrf.fr:8066.
The webserver interact with camera hardware through TANGO device servers.
Dependencies
------------
System : Linux Debian 8.11 (Jessie)
Was working with following versions
**Python**
- bottle : 0.12.13
- gevent : 1.0.1
- PyTango : 9.2.0
- struct
- gevent-websocket
- pyyaml
**JavaScript**
- node : 6.14.2
- npm : 6.1.0
other dependencies are listed in package.json, and they are installed in a node_modules directory when you run "npm install" in the package.json directory.
If you need to re-write the web application and bundle it again using webpack, try to install webpack and run "npx webpack --config webpack.config.js"
Run
------------
Launch webserver with python "python bpm-webserver.py". Then you can open your broswer and go to url "host_name.esrf.fr:8066", the index page will display all camera found with new BPM plugin, and display the name in green if the camera is running.
############################################################################
# This file is part of LImA, a Library for Image Acquisition
#
# Copyright (C) : 2009-2017
# European Synchrotron Radiation Facility
# CS40220 38043 Grenoble Cedex 9
# FRANCE
# Contact: lima@esrf.fr
#
# This is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>.
############################################################################
__all__ = []
def _init_module() :
import os
for root,dirs,files in os.walk(__path__[0]) :
for file_name in files :
if file_name.startswith('__') : continue
base,ext = os.path.splitext(file_name)
if ext == '.py' :
subdir = root[len(__path__[0]) + 1:]
if subdir:
base = '%s.%s' % (subdir,base)
__all__.append(base)
_init_module()
cmake -Bbuild -H. -DCMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% -DPYTHON_SITE_PACKAGES_DIR=%SP_DIR% -DCMAKE_FIND_ROOT_PATH=%LIBRARY_PREFIX%
IF %ERRORLEVEL% NEQ 0 exit /b %ERRORLEVEL%
cmake --build build --config Release --target install
IF %ERRORLEVEL% NEQ 0 exit /b %ERRORLEVEL%
#!/bin/bash
cmake -Bbuild -H. -DCMAKE_INSTALL_PREFIX=$PREFIX -DPYTHON_SITE_PACKAGES_DIR=$SP_DIR -DCMAKE_FIND_ROOT_PATH=$PREFIX
cmake --build build --target install
# Strip the 'v' from the version tag
{% if GIT_DESCRIBE_TAG is defined %}
{% set version = GIT_DESCRIBE_TAG[1:] %}
{% else %}
{% set version = "0.0.0" %}
{% endif %}
package:
name: lima-bpm-web-server
version: {{ version }}
source:
path: ..
build:
number: {{ environ.get('GIT_DESCRIBE_NUMBER', 0) }}
noarch: python
entry_points:
- LimaBpmWebServer = LimaBpmWebServer.webserver:main
requirements:
build:
- cmake
- git
run:
- pytango
- bottle
- numpy
- gevent
- gevent-websocket
- pyyaml
about:
home: https://github.com/esrf-bliss/Lima
license: GPL
license_file: COPYING
summary: a library for the unified control of 2D detectors
......@@ -3,11 +3,11 @@
"start": "npm run dev",
"dev": "webpack-dev-server"
},
"name": "bpm-webserver-packages",
"name": "lima-bpm-web-server-packages",
"version": "0.1.0",
"repository": {
"type": "git",
"url": "https://gitlab.esrf.fr/limagroup/bpm-web"
"url": "https://github.com/esrf-bliss/Lima-bpm-web-server"
},
"license": "MIT",
"main": "main.jsx",
......
#!/usr/bin/env python
############################################################################
# This file is part of LImA, a Library for Image Acquisition
#
# Copyright (C) : 2009-2019
# European Synchrotron Radiation Facility
# CS40220 38043 Grenoble Cedex 9
# FRANCE
# Contact: lima@esrf.fr
#
# This is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>.
#############################################################################
from LimaBpmWebServer.webserver import main
main()
###########################################################################
# This file is part of LImA, a Library for Image Acquisition
#
# Copyright (C) : 2009-2019
# European Synchrotron Radiation Facility
# CS40220 38043 Grenoble Cedex 9
# FRANCE
#
# Contact: lima@esrf.fr
#
# This is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>.
############################################################################
import os
import time
import struct
......@@ -447,6 +471,10 @@ class BVWebserver:
########--------------------------------------------------------------------------------------########
if __name__ == "__main__":
main()
def main():
parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument('-b', '--bind', help='IP/Hostname of interface to bind to', default=socket.gethostname())
parser.add_argument('-p', '--port', help='The port to bind to', default=8066, type=int, metavar='Port')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment