Skip to content

Commit

Permalink
Showing 3 changed files with 88 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -105,3 +105,6 @@ build.eclipse
truffle-findbugs-report.html
findbugs-noUpdateChecks-3.0.0.tar.gz
findbugs-3.0.0

# Vagrant
/.vagrant
25 changes: 25 additions & 0 deletions tool/truffle/Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :

# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|

# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "hashicorp/precise64"

# Bootstrap with a script
config.vm.provision :shell, :path => 'tool/truffle/vagrant_bootstrap.sh'

# Remote debug port
config.vm.network "forwarded_port", guest: 5005, host: 5005

config.vm.provider "virtualbox" do |vb|

# Set the vm memory
vb.customize ["modifyvm", :id, "--memory", "4096"]

end

end
60 changes: 60 additions & 0 deletions tool/truffle/vagrant_bootstrap.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#!/usr/bin/env bash

# Don't run this script directly
# This vagrant box and bootstrap was set up to be travis like with additional tools
# This script will be run by vagrant during `vagrant up`
# Install vagrant from: https://www.vagrantup.com/
#
# Run this command from the Jruby project home, which will import the vm and run this script
# VAGRANT_VAGRANTFILE=tool/truffle/Vagrantfile vagrant up
#
# Then to ssh to vagrant vm:
# VAGRANT_VAGRANTFILE=tool/truffle/Vagrantfile vagrant ssh
# You should now be inside the jruby project directory on but on the vm at /vagrant
# The usual build commands should work from here.
#
# When not is use, suspend the vm, vagrant suspend
# VAGRANT_VAGRANTFILE=tool/truffle/Vagrantfile vagrant suspend
#
# And resume, vagrant resume
# VAGRANT_VAGRANTFILE=tool/truffle/Vagrantfile vagrant resume
#
# If you want to test making updates to this script, after `vagrant up` run:
# VAGRANT_VAGRANTFILE=tool/truffle/Vagrantfile vagrant provision
# which will run the script again on the running vm
#
# If you need to make an update to this script on a brand new vm, run:
# VAGRANT_VAGRANTFILE=tool/truffle/Vagrantfile vagrant reload
# This is like running vagrant halt, vagrant up
# Delete the vm
# VAGRANT_VAGRANTFILE=tool/truffle/Vagrantfile vagrant destroy
#

# Install jdk-7
sudo apt-get update
sudo apt-get install -y openjdk-7-jdk

echo "Downloading and installing ruby-install and ruby-1.9.3"
wget -O ruby-install-0.5.0.tar.gz https://github.com/postmodern/ruby-install/archive/v0.5.0.tar.gz
tar -xzvf ruby-install-0.5.0.tar.gz
cd ruby-install-0.5.0/
sudo make install
ruby-install --system ruby 1.9.3

echo "Downloading and installing maven 3.2.5"

This comment has been minimized.

Copy link
@nirvdrum

nirvdrum May 10, 2015

Contributor

I think JRuby is looking to switch to maven 3.3.x. It'd be best if we just started there.

wget -q http://apache.osuosl.org/maven/maven-3/3.2.5/binaries/apache-maven-3.2.5-bin.tar.gz
sudo mkdir /usr/local/apache-maven
sudo mkdir /usr/local/apache-maven/apache-maven-3.2.5
sudo tar -xvzf apache-maven-3.2.5-bin.tar.gz -C /usr/local/apache-maven

echo "Setup bash and environment"
echo 'function jt { ruby tool/jt.rb $@; }' >> /home/vagrant/.bashrc
echo "cd /vagrant" >> /home/vagrant/.bashrc
echo "export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64/jre" >> /home/vagrant/.bashrc
echo "export PATH=$PATH:/usr/local/apache-maven/apache-maven-3.2.5/bin" >> /home/vagrant/.bashrc
echo 'export MAVEN_OPTS="-Xms512m -XX:MaxPermSize=2048m -Xmx2048m"' >> /home/vagrant/.bashrc

# Check versions
ruby -v
java -version
echo "Done"

6 comments on commit 73017c4

@bjfish
Copy link
Contributor Author

@bjfish bjfish commented on 73017c4 May 9, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chrisseaton I don't think this is exactly like travis yet because I can see some test failures for jt test specs and jt test mri. They might be real failures though. Let me know if anything doesn't look right here.

It might be nice to have another VM setup too with all the new stuff like Graal, etc.

@bjfish
Copy link
Contributor Author

@bjfish bjfish commented on 73017c4 May 9, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also here's a link to the errors: https://gist.github.com/bjfish/1d17a640df836d49cd84

I think the last error is interesting.

@chrisseaton
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about a VM with Graal in it - I wouldn't want people testing Graal inside VirtualBox and comparing performance against their native system running MRI.

@chrisseaton
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pinging @eregon, @petr-ch and @nirvdrum so they know about this.

@nirvdrum
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've thought about this is the past and it never felt quite right in the JRuby repo. Now that we have the jruby-truffle-stack repo, it might more sense over there.

@pitr-ch
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe other Implementations could be added to the VM so it's easy to compare them in the same environment?

Please sign in to comment.