Zsolt Haraszti | e060a7d | 2016-09-16 11:08:24 -0700 | [diff] [blame] | 1 | # sourcing this file is needed to make local development and integration testing work |
Nathan Knuth | edc88da | 2016-09-17 00:28:05 -0700 | [diff] [blame] | 2 | export VOLTHA_BASE=$PWD |
Zsolt Haraszti | e060a7d | 2016-09-16 11:08:24 -0700 | [diff] [blame] | 3 | |
Zsolt Haraszti | 4161248 | 2016-09-21 12:26:20 -0700 | [diff] [blame] | 4 | # load local python virtualenv if exists, otherwise create it |
| 5 | VENVDIR="venv-$(uname -s | tr '[:upper:]' '[:lower:]')" |
| 6 | if [ ! -e "$VENVDIR/.built" ]; then |
| 7 | echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" |
| 8 | echo "Initializing OS-appropriate virtual env." |
| 9 | echo "This will take a few minutes." |
| 10 | echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" |
| 11 | make venv |
| 12 | fi |
| 13 | . $VENVDIR/bin/activate |
Zsolt Haraszti | e060a7d | 2016-09-16 11:08:24 -0700 | [diff] [blame] | 14 | |
Zsolt Haraszti | eb43507 | 2016-09-23 17:10:49 -0700 | [diff] [blame] | 15 | # add top-level voltha dir to pythonpath |
Zsolt Haraszti | 89a2730 | 2016-12-08 16:53:06 -0800 | [diff] [blame] | 16 | export PYTHONPATH=$VOLTHA_BASE/$VENVDIR/lib/python2.7/site-packages:$PYTHONPATH:$VOLTHA_BASE:$VOLTHA_BASE/voltha/protos/third_party |
Zsolt Haraszti | eb43507 | 2016-09-23 17:10:49 -0700 | [diff] [blame] | 17 | |
Zsolt Haraszti | e060a7d | 2016-09-16 11:08:24 -0700 | [diff] [blame] | 18 | # assign DOCKER_HOST_IP to be the main ip address of this host |
Zsolt Haraszti | 023ea7c | 2016-10-16 19:30:34 -0700 | [diff] [blame] | 19 | export DOCKER_HOST_IP=$(python common/utils/nethelpers.py) |
Zsolt Haraszti | e060a7d | 2016-09-16 11:08:24 -0700 | [diff] [blame] | 20 | |
Zsolt Haraszti | 61732d4 | 2016-09-16 15:06:30 -0700 | [diff] [blame] | 21 | # to avoid permission issues, create a dir for fluentd logs |
Zsolt Haraszti | cfd15e5 | 2016-09-22 23:18:17 -0700 | [diff] [blame] | 22 | # of if it exists make sure we can write to it |
Zsolt Haraszti | 61732d4 | 2016-09-16 15:06:30 -0700 | [diff] [blame] | 23 | mkdir -p /tmp/fluentd |
Zsolt Haraszti | cfd15e5 | 2016-09-22 23:18:17 -0700 | [diff] [blame] | 24 | if ! touch /tmp/fluentd/.check_write_permission; then |
| 25 | echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" |
| 26 | echo "You don't have write privileges for the log directory" |
| 27 | echo "/tmp/fluentd. This will cause issues when running the" |
| 28 | echo "fluentd container with docker-compose. We suggest you" |
| 29 | echo "fox your write permission before proceeding." |
| 30 | echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" |
| 31 | else |
| 32 | rm -f /tmp/fluentd/.check_write_permission |
| 33 | fi |
Zsolt Haraszti | 61732d4 | 2016-09-16 15:06:30 -0700 | [diff] [blame] | 34 | |