Skip to content
Snippets Groups Projects
Commit bda420c4 authored by Christian Darsow-Fromm's avatar Christian Darsow-Fromm
Browse files

Resolve "gunicorn test in docker"

parent 5855c7c4
No related branches found
No related tags found
No related merge requests found
......@@ -56,13 +56,17 @@ tests:
- env/adwin-lib/
test wheel installation:
image: python:3
image: lasnq/adwin_control:lib
stage: test
before_script:
- echo 'DEVICES_LIST = [0]' > src/adwin_control/settings_local.py
script:
- pip3 install $PIP_EXTRA_FLAGS `ls dist/adwin_control*.whl`
- python3 -c "from adwin_control import Servo"
- python3 -c "from adwin_control import ServoDevice"
- python3 -c "from adwin_control import run"
- which adwin_control
- which gunicorn
cache:
key: adwin_control:pip
paths:
......
......@@ -4,10 +4,10 @@ PIPFLAGS = -r requirements.txt --trusted-host las-nq-serv.physnet.uni-hamburg.de
all: requirements test doc package
requirements:
@pip3 install $(PIPFLAGS)
@pip3 install --upgrade $(PIPFLAGS)
requirements-user:
@pip3 install --user $(PIPFLAGS)
@pip3 install --upgrade --user $(PIPFLAGS)
doc:
@export PYTHONPATH=$PYTHONPATH:`pwd`/src; cd doc; make html
......
......@@ -6,3 +6,10 @@ project=adwin_control
docker build -t $project .
docker tag $project lasnq/$project
docker push lasnq/$project
cd env
project=adwin_control:lib
docker build -t $project .
docker tag $project lasnq/$project
docker push lasnq/$project
......@@ -23,7 +23,7 @@ function ctrl_c() {
exit 0
}
VBoxManage startvm Win7 --type headless 2> /dev/null || VBoxManage startvm Win7 2> /dev/null
nice -n 19 VBoxManage startvm Win7 --type headless 2> /dev/null || VBoxManage startvm Win7 2> /dev/null
while true;
do
......
......@@ -11,15 +11,15 @@ Then, you can install
* this `adwin_control` package
* and the `ADwin` library.
## Install adwin_control
## Install adwin\_control
### Using PyPi (recommended)
This is the recommended, easiest version to install adwin_control.
This is the recommended, easiest version to install adwin\_control.
It is not fully optimized and on a local repository and needs some extra flags for now.
And for now it is only available from the Uni Hamburg network.
```bash
pip3 install --upgrade --user --extra-index-url https://las-nq-serv.physnet.uni-hamburg.de/pypiserver/ adwin_control
pip3 install --upgrade --user --trusted-host las-nq-serv.physnet.uni-hamburg.de --extra-index-url https://las-nq-serv.physnet.uni-hamburg.de/pypiserver/ adwin_control
```
If you don't have `pip3` on your system, try `pip`.
To install system wide don't use the `--user` flag.
......
# Introduction
adwin_control is a python project aiming the replacement of analog PID controllers in the lab.
`adwin_control` is a python project aiming the replacement of analog PID controllers in the lab.
## System Description
......
......@@ -21,7 +21,6 @@ services:
cache_from:
- lasnq/adwin_control
image: lasnq/adwin_control
# command: python3 setup.py bdist_wheel
command: bash -c "rsync -ur /mnt/{*,.git} /code/ && make bdist && chown -R 1000:1000 /code/dist"
environment:
PYTHONPATH: "/code/src"
......@@ -47,10 +46,10 @@ services:
context: .
cache_from:
- lasnq/adwin_control
command: bash -c "rsync -ur /mnt/* /code/ && ipython3 `pwd`/src/adwin_control/run.py"
command: bash -c "rsync -ur /mnt/* /code/ && ipython3 `pwd`/src/adwin_control/gunirun.py"
environment:
PYTHONPATH: "/code/src"
volumes:
- ./:/mnt:ro
ports:
- "8050:8050"
- "8000:8000"
FROM python:3
WORKDIR /code
COPY ./adwin-lib*.tar.gz /code/
RUN tar -xvf adwin-lib*.tar.gz
WORKDIR /code/adwin-lib/
RUN ./configure
RUN make
RUN make install
WORKDIR /code
......@@ -26,7 +26,36 @@ package_dir =
=src
# Add here dependencies of your project (semicolon-separated), e.g.
# install_requires = numpy; scipy
install_requires = adwin; scipy; pandas; matplotlib; tabulate; numpy; jsonpickle; nqlab>=0.4.9; websocket-client
install_requires =
adwin>=0.16.1
sphinx>=1.7.5
numpy>=1.14
dash>=0.31.1 # The core dash backend
dash-renderer>=0.15.1 # The dash front-end
dash-html-components>=0.13.0 # HTML components
dash-core-components>=0.40.0 # Supercharged components
plotly
pandas
pandas-datareader>=0.5.0
flask
matplotlib
tabulate
scipy>=1.0
nbconvert
fastnumbers
recommonmark
sphinx-markdown-tables
sphinx_rtd_theme
wheel
setuptools
nqlab>=0.4.9
jupyter_contrib_nbextensions
pytest<4.0
pytest-cov
jsonpickle
websocket-client
websockets
gunicorn
# Add here test requirements (semicolon-separated)
tests_require = pytest; pytest-cov; adwin; scipy; pandas; matplotlib; tabulate; numpy; jsonpickle; nqlab; websocket-client
......
......@@ -14,7 +14,7 @@ from setuptools import setup
# Add here console scripts and other entry points in ini-style format
entry_points = """
[console_scripts]
adwin_control = adwin_control.run:main
adwin_control = adwin_control.gunirun:main
# For example:
# fibonacci = adwin_control.skeleton:run
"""
......
import subprocess
import os
def main():
script_path = os.path.dirname(os.path.realpath(__file__))
os.chdir(script_path)
subprocess.run(['gunicorn', '-c', 'guniconfig.py.ini', 'run:server'])
subprocess.run(['pwd'])
if __name__ == '__main__':
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment