diff --git a/README.md b/README.md index c6ad145e..44d1152a 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,17 @@ To clone the IntegratedConformance with all the submodules, use the command, git clone --recurse-submodules https://github.com/Dash-Industry-Forum/DASH-IF-Conformance +You can also use the included Vagrant box to run locally. + +``` + cd DASH-IF-Conformance/vagrant/ + vagrant up +``` + +Once `vagrant up` completes, visit [visit http://localhost:8090/DASH-IF-Conformance/Conformance-Frontend/index.html](http://localhost:8090/DASH-IF-Conformance/Conformance-Frontend/index.html) + +** Refer to https://www.vagrantup.com/ for Vagrant installation and usage documentation. + ### Usage Guide Information on how to use the conformance software, please refer to our [Usage Guide](https://github.com/Dash-Industry-Forum/DASH-IF-Conformance/blob/master/Doc/Conformance%20Software%20Usage%20Guide.pdf) document. diff --git a/vagrant/.gitignore b/vagrant/.gitignore new file mode 100644 index 00000000..a977916f --- /dev/null +++ b/vagrant/.gitignore @@ -0,0 +1 @@ +.vagrant/ diff --git a/vagrant/Vagrantfile b/vagrant/Vagrantfile new file mode 100644 index 00000000..34422222 --- /dev/null +++ b/vagrant/Vagrantfile @@ -0,0 +1,14 @@ +Vagrant.configure("2") do |config| + config.vm.box = "bento/ubuntu-16.04" + + config.vm.provider "virtualbox" do |v| + v.name = "DASH-IF-Conformance" + end + + config.vm.network "forwarded_port", guest: 8090, host: 8090 + config.vm.provision :shell, path: "provision.sh" + config.vm.synced_folder ".", "/vagrant", disabled: true + config.vm.synced_folder "../", "/vagrant" + +end + diff --git a/vagrant/provision.sh b/vagrant/provision.sh new file mode 100644 index 00000000..45158811 --- /dev/null +++ b/vagrant/provision.sh @@ -0,0 +1,60 @@ +set -o errexit +set -o pipefail +set -o nounset +shopt -s failglob +set -o xtrace + +export DEBIAN_FRONTEND=noninteractive + +# ref https://github.com/Dash-Industry-Forum/DASH-IF-Conformance/blob/master/Doc/Conformance%20Software%20Installation%20Guide.pdf + +apt-get update +apt-get install -y php php-dev php-xml php-curl php-xdebug libapache2-mod-php \ + default-jdk apache2 apache2-doc python2.7 python-pip \ + python-matplotlib ant git libstdc++6:i386 gcc-multilib \ + g++-multilib + + +java -version +javac -version + + +echo '' > /etc/sudoers.d/dash +echo '# the conformance software requires sudo permission to run' >> /etc/sudoers.d/dash +echo '%www-data ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers.d/dash +echo '' >> /etc/sudoers.d/dash +chmod 0440 /etc/sudoers.d/dash +cat /etc/sudoers.d/dash + + +service apache2 restart + +usermod -a -G www-data vagrant + +cd /var/www + +git clone --recurse-submodules https://github.com/Dash-Industry-Forum/DASH-IF-Conformance + +MAKE_PARALLEL_JOBS=10 +MAKEFLAGS=-j$MAKE_PARALLEL_JOBS + +cd DASH-IF-Conformance/ISOSegmentValidator/public/linux/ +make $MAKEFLAGS + +chmod -R 0777 /var/www/ + + +echo '' > /etc/apache2/sites-available/000-dash.conf +echo 'Listen 8090' >> /etc/apache2/sites-available/000-dash.conf +echo '' >> /etc/apache2/sites-available/000-dash.conf +echo ' ServerAdmin webmaster@localhost' >> /etc/apache2/sites-available/000-dash.conf +echo ' DocumentRoot /var/www' >> /etc/apache2/sites-available/000-dash.conf +echo ' ErrorLog ${APACHE_LOG_DIR}/error.log' >> /etc/apache2/sites-available/000-dash.conf +echo ' CustomLog ${APACHE_LOG_DIR}/access.log combined' >> /etc/apache2/sites-available/000-dash.conf +echo '' >> /etc/apache2/sites-available/000-dash.conf +echo '' >> /etc/apache2/sites-available/000-dash.conf + +a2ensite 000-dash +service apache2 reload + +echo "Success! Use your browser to visit http://localhost:8090/DASH-IF-Conformance/Conformance-Frontend/index.html"