blob: 8f3a07c101c55e079192cef7f8df328f59122cd4 [file] [log] [blame]
Zsolt Harasztie060a7d2016-09-16 11:08:24 -07001# sourcing this file is needed to make local development and integration testing work
Nathan Knuthedc88da2016-09-17 00:28:05 -07002export VOLTHA_BASE=$PWD
Zsolt Harasztie060a7d2016-09-16 11:08:24 -07003
Zsolt Haraszti41612482016-09-21 12:26:20 -07004# load local python virtualenv if exists, otherwise create it
5VENVDIR="venv-$(uname -s | tr '[:upper:]' '[:lower:]')"
6if [ ! -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
12fi
13. $VENVDIR/bin/activate
Zsolt Harasztie060a7d2016-09-16 11:08:24 -070014
Zsolt Harasztie060a7d2016-09-16 11:08:24 -070015# assign DOCKER_HOST_IP to be the main ip address of this host
16export DOCKER_HOST_IP=$(python voltha/nethelpers.py)
17
Zsolt Haraszti61732d42016-09-16 15:06:30 -070018# to avoid permission issues, create a dir for fluentd logs
Zsolt Haraszticfd15e52016-09-22 23:18:17 -070019# of if it exists make sure we can write to it
Zsolt Haraszti61732d42016-09-16 15:06:30 -070020mkdir -p /tmp/fluentd
Zsolt Haraszticfd15e52016-09-22 23:18:17 -070021if ! 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 "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
28else
29 rm -f /tmp/fluentd/.check_write_permission
30fi
Zsolt Haraszti61732d42016-09-16 15:06:30 -070031