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 | e060a7d | 2016-09-16 11:08:24 -0700 | [diff] [blame] | 15 | # assign DOCKER_HOST_IP to be the main ip address of this host |
| 16 | export DOCKER_HOST_IP=$(python voltha/nethelpers.py) |
| 17 | |
Zsolt Haraszti | 61732d4 | 2016-09-16 15:06:30 -0700 | [diff] [blame] | 18 | # to avoid permission issues, create a dir for fluentd logs |
Zsolt Haraszti | cfd15e5 | 2016-09-22 23:18:17 -0700 | [diff] [blame] | 19 | # of if it exists make sure we can write to it |
Zsolt Haraszti | 61732d4 | 2016-09-16 15:06:30 -0700 | [diff] [blame] | 20 | mkdir -p /tmp/fluentd |
Zsolt Haraszti | cfd15e5 | 2016-09-22 23:18:17 -0700 | [diff] [blame] | 21 | if ! touch /tmp/fluentd/.check_write_permission; then |
| 22 | echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" |
| 23 | echo "You don't have write privileges for the log directory" |
| 24 | echo "/tmp/fluentd. This will cause issues when running the" |
| 25 | echo "fluentd container with docker-compose. We suggest you" |
| 26 | echo "fox your write permission before proceeding." |
| 27 | echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" |
| 28 | else |
| 29 | rm -f /tmp/fluentd/.check_write_permission |
| 30 | fi |
Zsolt Haraszti | 61732d4 | 2016-09-16 15:06:30 -0700 | [diff] [blame] | 31 | |