forked from scionrep/scioncc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
INSTALL
155 lines (116 loc) · 5 KB
/
INSTALL
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
==================
SciON INSTALLATION
==================
PREREQUISITES
=============
LINUX (UBUNTU):
---------------
Use a fresh Ubuntu 14.04 VM with latest patches:
> sudo apt-get update
> sudo apt-get upgrade -y
Execute dependencies install script (from repo root dir - only if you are comfortable):
Make sure no errors occur. NOTE: PostgreSQL 9.3 works too
> sudo sh misc/install/install_ubuntu.sh
Set postgres superuser password and create users (replace xxxxx with a good password):
> sudo -u postgres psql -U postgres -d postgres -c "alter user postgres with password 'xxxxx';"
> sudo -u postgres createuser ion
> sudo -u postgres psql -U postgres -d postgres -c "alter user ion with password 'xxxxx';"
Configure postgres:
> sudo vim /etc/postgresql/9.4/main/pg_hba.conf
# For rule all (1 line), change peer to md5 to enable password login
> sudo service postgresql restart
Create virtualenv:
> cd
> mkdir .virtualenvs
> cat <<EOF >> .profile
export EDITOR="/usr/bin/vim"
export WORKON_HOME="~/.virtualenvs"
source /usr/share/virtualenvwrapper/virtualenvwrapper.sh
EOF
> source .profile
MAC OS:
-------
Install homebrew package manager - NOTE: DO NOT USE brew ON LINUX
> ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Note: see 'brew doctor' for any issues with brew and 'brew update' often
Install python 2.7.x
> brew install python
Basic packages
> brew install git libevent libyaml rabbitmq pkg-config
Install Postgresql with postgis extension (version >= 9.3).
Easiest install with Postgres, PostGIS, PLV8 etc:
Download Postgres.app from http://http://postgresapp.com, unzip, drag into Applications, start.
Add to path in .profile or similar for command line tools:
> export PATH=$PATH:/Applications/Postgres.app/Contents/Versions/9.4/bin
Alternative install via brew (note: PLV8 does not install properly)
> brew install postgres postgis
As user postgres:
> createuser -s ion
Python packages and environment management:
> easy_install pip
> easy_install --upgrade virtualenv
> easy_install --upgrade virtualenvwrapper
Note: This requires Mac's XCode with installed command line tools
Troubleshooting Mac OS Python install (tested on Mac OS 10.9):
Sometimes, the system wide Python packages get outdated and errors like
pkg_resources.DistributionNotFound appear.
Always install and upgrade system packages with easy_install, not pip (if that's what
you've used before, see above).
In case of problems:
> brew rm python
Then delete outdated stuff out system site-packages directory:
> cd `python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())"`
The reinstall python, and redo above steps
> brew install python
> easy_install --upgrade pip stevedore setuptools virtualenv virtualenvwrapper
COMMON INSTALLATION
===================
Configure git:
> git config --global user.email "[email protected]"
> git config --global user.name "Full Name"
> git config --global core.editor vim
Setup a virtualenv to run the SciON capability container:
> mkvirtualenv --no-site-packages scion
> pip install setuptools --upgrade
Clone scioncc (this repository) in your code directory:
> cd code # Whatever your code repository directory is
> git clone [email protected]:scionrep/scioncc.git
> cd scioncc
Use buildout to install the python package dependencies with:
> python bootstrap.py -v 2.3.1
> bin/buildout
Add current directory to PYTHONPATH (you can add this to your ~/.profile or
bash_profile):
> export PYTHONPATH=.
Generate service definition interfaces and abstract base classes:
> bin/generate_interfaces
Note: These will be placed in the interfaces/ subdirectory.
Optional: You can establish a buildout cache by adding
> mkdir -p ~/.buildout/eggs ~/.buildout/dlcache
> printf "[buildout]\neggs-directory=$HOME/.buildout/eggs\ndownload-cache=$HOME/.buildout/dlcache\n" > ~/.buildout/default.cfg
RUN-TIME DEPENDENCIES
=====================
POSTGRESQL (DATABASE):
Start postgresql (in a terminal or as a service) before starting the container or running tests:
MacOS:
> /usr/local/bin/postgres -D /usr/local/var/postgres
Ubuntu Linux:
> sudo service postgresql start
RABBITMQ (MESSAGE BROKER):
MacOS:
> rabbitmq-server
Ubuntu Linux:
> sudo service rabbitmq-server start
DOCKER INSTALL
==============
Currently experimental - docker images not regularly maintained.
Install a recent docker on Ubuntu 14.04:
See https://docs.docker.com/installation/ubuntulinux/
> curl -sSL https://get.docker.com/ubuntu/ | sudo sh
Get docker images for Scion CC, database and message broker:
See https://registry.hub.docker.com/repos/scioncc/
> sudo docker pull scioncc/scion_cc:3.0.0
> sudo docker pull scioncc/scion_pg:9.4-1
> sudo docker pull scioncc/scion_rabbitmq:1.0
See also:
- https://github.com/phusion/baseimage-docker