Skip to content

Instantly share code, notes, and snippets.

@YungSang
Last active August 29, 2015 14:05
Show Gist options
  • Save YungSang/0440f754c01a07d0f1ce to your computer and use it in GitHub Desktop.
Save YungSang/0440f754c01a07d0f1ce to your computer and use it in GitHub Desktop.
Panamax without Installer

Panamax without Installer

for VirtualBox

$ vagrant up
$ open http://localhost:8888

for Parallels Desktop 9

$ vagrant up --provider parallels
$ open http://$(vagrant ssh-config | sed -n "s/[ ]*HostName[ ]*//gp"):3000

for Parallels Desktop 10

$ vagrant up --provider parallels
$ open http://localhost:8888
#cloud-config
coreos:
units:
- name: etcd.service
command: start
- name: fleet.service
command: start
- name: panamax-metrics.service
command: start
runtime: no
content: |
[Unit]
Description=Panamax Metrics
[Service]
ExecStartPre=-/usr/bin/docker rm -f PMX_CADVISOR
ExecStart=/usr/bin/docker run --volume=/var/run:/var/run:rw --volume=/sys/fs/cgroup/:/sys/fs/cgroup:ro --volume=/var/lib/docker/:/var/lib/docker:ro --publish=:8080 --name=PMX_CADVISOR google/cadvisor:0.1.0
ExecStop=/usr/bin/docker stop PMX_CADVISOR
Restart=always
[Install]
WantedBy=multi-user.target
- name: panamax-api.service
command: start
runtime: no
content: |
[Unit]
Description=Panamax API
After=docker.service
Requires=docker.service
[Service]
ExecStartPre=-/usr/bin/docker rm -f PMX_API
ExecStart=/usr/bin/docker run --name PMX_API -v /var/panamax-data:/usr/src/app/db/mnt -m=1g -c=10 -v /var/run/docker.sock:/run/docker.sock:rw -e PANAMAX_ID=%PANAMAX_ID% -e JOURNAL_ENDPOINT=http://172.17.42.1:19531 -e FLEETCTL_ENDPOINT=http://172.17.42.1:4001 -t -p 3001:3000 centurylink/panamax-api
ExecStop=/usr/bin/docker stop PMX_API
Restart=always
[Install]
WantedBy=multi-user.target
- name: panamax-ui.service
command: start
runtime: no
content: |
[Unit]
Description=Panamax UI
After=panamax-api.service panamax-metrics.service
Requires=panamax-api.service panamax-metrics.service
[Service]
ExecStartPre=-/usr/bin/docker rm -f PMX_UI
ExecStart=/usr/bin/docker run --name PMX_UI -m=1g -c=10 -v /var/run/docker.sock:/run/docker.sock:rw --link PMX_API:PMX_API --link PMX_CADVISOR:CADVISOR -p 3000:3000 centurylink/panamax-ui
ExecStop=/usr/bin/docker stop PMX_UI
Restart=always
[Install]
WantedBy=multi-user.target
# -*- 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|
config.vm.box = "yungsang/coreos"
config.vm.define "panamax" do |panamax|
panamax.vm.hostname = "panamax"
panamax.vm.network :forwarded_port, guest: 3000, host: 8888
panamax.vm.network :forwarded_port, guest: 3001, host: 8889
panamax.vm.provision :docker do |d|
d.pull_images "centurylink/panamax-ui:latest"
d.pull_images "centurylink/panamax-api:latest"
d.pull_images "google/cadvisor:0.1.0"
end
panamax.vm.provision :file, source: "./panamax.yml", destination: "/tmp/vagrantfile-user-data"
panamax.vm.provision :shell do |sh|
sh.privileged = true
sh.inline = <<-EOT
export PANAMAX_ID=$(/usr/bin/uuidgen)
sed -e "s/%PANAMAX_ID%/${PANAMAX_ID}/g" -i /tmp/vagrantfile-user-data
mv /tmp/vagrantfile-user-data /var/lib/coreos-vagrant/
EOT
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment