Commit 21b7381a authored by Paul Rich's avatar Paul Rich
Browse files

PMIx and PRRTE building. Still need to test env control for rebuilds.

parent 3999e2be
......@@ -5,20 +5,29 @@
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
# https://docs.vagrantup.com.
# Every Vagrant development environment requires a box. You can search for
# boxes at https://vagrantcloud.com/search.
VAGRANT_PMIX_SHOW_ENVS = ENV.fetch("VAGRANT_PMIX_SHOW_ENVS", false)
VAGRANT_PMIX_CLIENTS = ENV.fetch('VAGRANT_PMIX_CLIENTS', 0).to_i
VAGRANT_PMIX_MASTER_MEM = ENV.fetch('VAGRANT_PMIX_MASTER_MEM', 4096).to_i
VAGRANT_PMIX_MASTER_CPU = ENV.fetch('VAGRANT_PMIX_MASTER_CPU', 4).to_i
VAGRANT_PMIX_CLIENT_MEM = ENV.fetch('VAGRANT_PMIX_CLIENT_MEM', 1024).to_i
VAGRANT_PMIX_CLIENT_CPU = ENV.fetch('VAGRANT_PMIX_CLIENT_CPU', 2).to_i
VAGRANT_PMIX_SSH_PUB_KEY = ENV.fetch('VAGRANT_PMIX_SSH_PUB_KEY', "#{Dir.home}/.ssh/id_rsa.pub")
Vagrant.configure("2") do |config|
config.vm.box = "bento/centos-7"
config.vm.provider "vmware_desktop"
# Disable automatic box update checking. If you disable this, then
# boxes will only be checked for updates when the user runs
# `vagrant box outdated`. This is not recommended.
# config.vm.box_check_update = false
if VAGRANT_PMIX_SHOW_ENVS
puts "Environment configured with:"
puts "VAGRANT_PMIX_CLIENTS #{VAGRANT_PMIX_CLIENTS}"
puts "VAGRANT_PMIX_MASTER_MEM #{VAGRANT_PMIX_MASTER_MEM}"
puts "VAGRANT_PMIX_MASTER_CPU #{VAGRANT_PMIX_MASTER_CPU}"
puts "VAGRANT_PMIX_CLIENT_MEM #{VAGRANT_PMIX_CLIENT_MEM}"
puts "VAGRANT_PMIX_CLIENT_CPU #{VAGRANT_PMIX_CLIENT_CPU}"
puts "VAGRANT_PMIX_SSH_PUB_KEY #{VAGRANT_PMIX_SSH_PUB_KEY}"
end
# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine. In the example below,
......@@ -34,34 +43,37 @@ Vagrant.configure("2") do |config|
# Create a private network, which allows host-only access to the machine
# using a specific IP.
config.vm.network "private_network", type: "dhcp"
config.vm.hostname = "mesos"
# Create a public network, which generally matched to bridged network.
# Bridged networks make the machine appear as another physical device on
# your network.
# config.vm.network "public_network"
# Share an additional folder to the guest VM. The first argument is
# the path on the host to the actual folder. The second argument is
# the path on the guest to mount the folder. And the optional third
# argument is a set of non-required options.
# config.vm.synced_folder "../data", "/vagrant_data"
# Provider-specific configuration so you can fine-tune various
# backing providers for Vagrant. These expose provider-specific options.
# Example for VirtualBox:
#
config.vm.provider "virtualbox" do |vb|
# # Display the VirtualBox GUI when booting the machine
# vb.gui = true
#
# # Customize the amount of memory on the VM:
vb.memory = "4096"
config.ssh.forward_agent = true
config.vm.define "pmix-sn1", primary: true do |boraxsn1|
boraxsn1.vm.hostname = "pmix-sn1"
boraxsn1.vm.provider "virtualbox" do |vb|
vb.memory = VAGRANT_PMIX_MASTER_MEM
vb.cpus = VAGRANT_PMIX_MASTER_CPU
end
boraxsn1.vm.provider "vmware_desktop" do |v|
v.vmx["memsize"] = VAGRANT_PMIX_MASTER_MEM
v.vmx["numvcpus"] = VAGRANT_PMIX_MASTER_CPU
end
end
config.vm.provider "vmware_desktop" do |v|
v.vmx["memsize"] = "4096"
v.vmx["numvcpus"] = 4
(1..VAGRANT_PMIX_CLIENTS).each do |i|
config.vm.define "pmix-cc#{i}" do |node|
node.vm.hostname = "pmix-cc#{i}"
node.vm.provider "virtualbox" do |vb|
vb.memory = VAGRANT_PMIX_CLIENT_MEM
vb.cpus = VAGRANT_PMIX_CLIENT_CPU
end
node.vm.provider "vmware_desktop" do |v|
v.vmx["memsize"] = VAGRANT_PMIX_CLIENT_MEM
v.vmx["numvcpus"] = VAGRANT_PMIX_CLIENT_CPU
end
end
end
config.vm.provision "shell" do |s|
# modify for your ssh path
ssh_pub_key = File.readlines(VAGRANT_PMIX_SSH_PUB_KEY).first.strip
s.inline = <<-SHELL
echo #{ssh_pub_key} >> /home/vagrant/.ssh/authorized_keys
SHELL
end
#
# View the documentation for the provider you are using for more
......
......@@ -8,8 +8,7 @@
sudo yum -y install epel-release
USER_PACKAGES="vim emacs tmux gcc nc json git lsof mlocate python2-pip \
python2-virtualenv python36-pip python36-virtualenv yum-utils \
mpich mpich-devel nmap libtool wget tar git lynx"
mpich mpich-devel nmap libtool wget tar git lynx nss-mdns avahi avahi-tools"
# Note: mpich is required, but already covered in general user packages.
PMIX_PACKAGES=""
yum install -y $USER_PACKAGES
yum -y install $PMIX_PACKAGES
PMIX_PACKAGES="m4 flex libevent-devel hwloc-devel"
yum install -y $USER_PACKAGES $PMIX_PACKAGES
......@@ -2,5 +2,45 @@
# Provision script for Mesos VM CentOS7 environment
# These are intended to run as the vagrant user.
if [ REBUILD_ALL ]; then
REBUILD_PMIX=1
REBUILD_PRRTE=1
fi
if [ ! -d pmix ]; then
git clone https://github.com/pmix/pmix
REBUILD_PMIX=1
fi
if [ $UPDATE_PMIX ]; then
cd pmix
git fetch --all
git pull master
cd -
REBUILD_PMIX=1
fi
if [ $REBUILD_PMIX ]; then
cd pmix
./autogen.pl
./configure
make -j 4 all
sudo make install
cd -
fi
if [ ! -d prrte ]; then
git clone https://github.com/pmix/prrte
REBUILD_PRRTE=1
fi
if [ $UPDATE_PRRTE ]; then
cd prrte
git fetch --all
git pull master
cd -
REBUILD_PRRTE=1
fi
if [ $REBUILD_PMIX ]; then
cd prrte
./autogen.pl
./configure --enable-debug --with-pmix=/usr/local
make -j 4 all
sudo make install
cd -
fi
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment