forked from d9w/WindFLO
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
69 lines (54 loc) · 1.69 KB
/
Makefile
File metadata and controls
69 lines (54 loc) · 1.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
P=python
current_dir=$(shell pwd)
base_dir=${current_dir}/..
default: build clean test
# Build locally the package
# This will create a .so file that can be imported as a python module
build:
$(P) setup.py build_ext --inplace
# Install the package
install:
$(P) setup.py install
# Install everything including the python pre-requisits
# Pre-requisits are listed in the requirements.txt file
pip_install:
pip install -r requirements.txt
# Run the test files
test:
$(P) test_*.py
# Clean-up the extra files created
clean:
rm -rf build *.egg-info
rm pyKusiakLayoutEvaluator.cpp
# Clean install on a virgin ubuntu image
clean_install_ubuntu:
sudo apt-get update && apt-get install -y -q \
build-essential \
make \
gcc \
git \
python \
python-dev \
python-pip
# Create a Docker image called windflo_python
docker_image:
docker build -t windflo_python .
# Run the docker image in Jupyther sever mode
# You can access the server using your browser at the address http://127.0.0.1:81
# On linux and windows the IP address is different and can be found using the command
# $ boot2docker ip
# The password is `windflo`
jupyter_start:
docker run -d -p 81:8888 -e 'PASSWORD=windflo' -e 'USE_HTTP=1' -v ${base_dir}:/install/WindFLO --name windflo windflo_python /notebook.sh
# Stop the jupyter server
jupyter_stop:
docker stop windflo
# Start the jupyter server
jupyter_restart:
docker restart windflo
jupyter_rm:
docker rm windflo
# Run the docker image in bash mode (the container will be erased)
bash_run:
docker run -it --rm -v ${base_dir}:/install/WindFLO windflo_python /bin/bash
.PHONY: build_ext install pip_install test clean ubuntu docker_image jupyter_start jupyter_stop jupyter_restart bash