vagrant-g5k 0.9.2 → 0.9.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 66d54d0bd6561de0ae64704dd3d193bc33c9315c
4
- data.tar.gz: cf831d202c096f406b2e5bd6fc28096f8aa041a4
3
+ metadata.gz: b263753a8f181ae3e7087bf0d6ff5b1fbf761d07
4
+ data.tar.gz: f28daaa87480bc5c97dab02f6680573fd2f2fe73
5
5
  SHA512:
6
- metadata.gz: aae8a2021bc6d8aa4fa49e2c9756a896a7170dbb75b15886f47d8eeef45aa02fdcfff91309c7913948ade786b230ae91d0b06bfdbd9e1394ddae7d2ad9a121f8
7
- data.tar.gz: 27845918e8cb2457d69c89a20f97dc9236473b918087fd70a1276e5692c87a790556c6353a8f15459c55851c04b6f98b62e61b45bf9e26540eea4bf1011e4740
6
+ metadata.gz: 6e828bf21b4b8e3f7f6513f5f9f655eaa31b5b372ada250cee510187d691f1ed7d1dc91b22b49ab1dc983b36bb2b0ea7722b522bfc5dc949da9c83da5cbe6055
7
+ data.tar.gz: 06c053d8fe628a8927f75c16b6899ead22a6c32c3a843b895ca50be18793af24fe2783a147812aac1ab1bb85648a0dd69dd838985f56b29c6bbace0ca4019880
data/.Vagrantfile.swp ADDED
Binary file
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 0.9.3
2
+
3
+ * Rsync support. The Vagrantfile needs to be updated.
4
+
1
5
  # 0.9.2
2
6
 
3
7
  * Make the monitor socket location unique
@@ -8,7 +12,7 @@
8
12
 
9
13
  # 0.9.0
10
14
 
11
- * Code refactoring :
15
+ * Code refactoring :
12
16
  * Introduce oar_driver to handle operation involving oar
13
17
  * Introduce net_driver to configure the network used by the VMs
14
18
  * Introduce disk_driver to configure the disk used by the VMs
@@ -74,7 +78,7 @@
74
78
  * SSH ports has to be forwarded explicitly
75
79
 
76
80
  # 0.0.5
77
-
81
+
78
82
  * Add destroy command
79
83
  * Remove vmlist command
80
84
 
data/README.md CHANGED
@@ -22,10 +22,33 @@ $ vagrant plugin install vagrant-g5k
22
22
  $ vagrant up --provider=g5k
23
23
  ...
24
24
  ```
25
+ Vagrant requires a box to start with. As a consequence you can add one `dummy` box with the following command :
26
+
27
+ ```
28
+ vagrant box add dummy https://github.com/msimonin/vagrant-g5k/raw/master/dummy.box
29
+ ```
30
+
31
+
25
32
  ## Configuration
26
33
 
27
34
  Check the Vagrantfile.
28
35
 
36
+ ## Note on the insecure vagrant key
37
+
38
+ By default, Vagrant uses a insecure key to connect to the VM.
39
+ Prior to some operation vagrant will replace this by a generated key.
40
+ This operation isn't supported by vagrant-g5k thus you need to specify
41
+ `config.vmssh.insert_key = false` in the Vagrantfile.
42
+
43
+ For instance this is needed when using shared folders, hostmanager plugin.
44
+
45
+ ## Note on shared folders
46
+
47
+ Rsync shared folders are supported. The copy of your local files is hooked in the `up` phase. After this you can use :
48
+
49
+ * `vagrant rsync` to force a synchronization
50
+ * `vagrant rsync-auto` to watch your local modifications
51
+
29
52
  ## Note on disk format and backing strategy
30
53
 
31
54
  Virtual Machines can be booted either :
@@ -93,6 +116,7 @@ You can use `:cpu => -1` to express that you want all the cpu of the reserved no
93
116
  * `vagrant destroy`
94
117
  * `vagrant halt`
95
118
  * `vagrant provision`
119
+ * `vagrant rsync|rsync-auto`
96
120
  * `vagrant ssh`
97
121
  * `vagrant ssh-config`
98
122
  * `vagrant status`
data/Vagrantfile CHANGED
@@ -3,48 +3,73 @@
3
3
  #
4
4
  # Sample Vagrantfile
5
5
  #
6
- N = 3
7
6
  Vagrant.configure(2) do |config|
7
+ config.hostmanager.enabled = true
8
+ config.hostmanager.manage_guest = true
8
9
 
9
- ## This define a VM.
10
- ## a g5k provider section will override top level options
11
- ## To define multiple VMs you can
12
- ## * either repeat the block
13
- ## * loop over using (1..N).each block
14
- (1..N).each do |i|
15
- config.vm.define "vm#{i}" do |my|
16
- my.vm.box = "dummy"
17
-
18
- ## Access to the vm
19
- ## This is specific to alpine_docker
20
- ## It's better to use a vagrant image
21
- ## converted to qcow2
22
- my.ssh.username = "root"
23
- my.ssh.password = ""
24
- my.vm.provider "g5k" do |g5k|
25
- g5k.project_id = "vagrant-g5k"
26
- g5k.site = "lille"
27
- g5k.username = ENV["USER"]
28
- g5k.gateway = "access.grid5000.fr"
29
- g5k.walltime = "01:00:00"
30
- g5k.image = {
31
- :path => "public/alpine_docker.qcow2",
32
- :backing => "snapshot"
33
- }
34
- g5k.net = {
35
- :type => "nat",
36
- :ports => ["222#{i}-:22"]
37
- }
38
-
39
- g5k.oar = "virtual != 'none'"
40
-
41
- g5k.resources = {
42
- :cpu => 1,
43
- :mem => 2048
44
- }
45
- end #g5k
46
- end
47
- end
48
- end
10
+ (0..9).each do |i|
11
+ config.vm.provider "g5k" do |g5k, override|
12
+ # This is mandatory for the shared folders to work correctly
13
+ override.nfs.functional = false
14
+ # project id must be unique accross all
15
+ # your projects using vagrant-g5k to avoid conflict
16
+ # on vm disks
17
+ g5k.project_id = "test-vagrant-g5k"
18
+
19
+ #g5k.site = "igrida"
20
+ g5k.site = "rennes"
21
+ g5k.username = "msimonin"
22
+ g5k.gateway = "access.grid5000.fr"
23
+ g5k.walltime = "02:00:00"
24
+
25
+ # Image backed on the frontend filesystem
26
+ g5k.image = {
27
+ # :path => "/udd/msimonin/precise.qcow2",
28
+ :path => "/home/msimonin/public/ubuntu1404-9p.qcow2",
29
+ :backing => "snapshot"
30
+ }
31
+
32
+ ## Bridged network : this allow VMs to communicate
33
+ g5k.net = {
34
+ :type => "bridge"
35
+ }
49
36
 
37
+ ## Nat network : VMs will only have access to the external world
38
+ ## Forwarding ports will allow you to access services hosted inside the
39
+ ## VM.
40
+ #g5k.net = {
41
+ # :type => "nat",
42
+ # :ports => ["2222-:22"]
43
+ #}
50
44
 
45
+ ## OAR selection of resource
46
+ g5k.oar = "virtual != 'none'"
47
+ #g5k.oar = "virtual != 'None' and network_address in ('paranoia-2.rennes.grid5000.fr')"
48
+ #g5k.oar = "network_address in ('igrida12-12.irisa.fr')"
49
+
50
+ ## VM size customization default values are
51
+ ## cpu => -1 -> all the cpu of the reserved node
52
+ ## mem => -1 -> all the mem of the reserved node
53
+ ##
54
+ #g5k.resources = {
55
+ # :cpu => 1,
56
+ # :mem => 2048
57
+ #}
58
+ end #g5k
59
+
60
+ ## This define a VM.
61
+ ## a g5k provider section will override top level options
62
+ ## To define multiple VMs you can
63
+ ## * either repeat the block
64
+ ## * loop over using (1..N).each block
65
+ config.vm.define "exp#{i}" do |my|
66
+ my.vm.box = "dummy"
67
+ ## Configure the shared folders between your host and the VM
68
+ my.vm.synced_folder ".", "/vagrant", type: "rsync", disabled: true
69
+ ## This is mandatory until #6 is fixed
70
+ ## In particular this is needed for the shared folders
71
+ my.ssh.insert_key = false
72
+
73
+ end #vm
74
+ end
75
+ end
data/Vagrantfile.old ADDED
@@ -0,0 +1,72 @@
1
+ # -*- mode: ruby -*-
2
+ # vi: set ft=ruby :
3
+ #
4
+ # Sample Vagrantfile
5
+ #
6
+ Vagrant.configure(2) do |config|
7
+
8
+ config.vm.provider "g5k" do |g5k, override|
9
+ # This is mandatory for the shared folders to work correctly
10
+ override.nfs.functional = false
11
+ # project id must be unique accross all
12
+ # your projects using vagrant-g5k to avoid conflict
13
+ # on vm disks
14
+ g5k.project_id = "test-vagrant-g5k"
15
+
16
+ #g5k.site = "igrida"
17
+ g5k.site = "rennes"
18
+ g5k.username = "msimonin"
19
+ g5k.gateway = "access.grid5000.fr"
20
+ g5k.walltime = "00:10:00"
21
+
22
+ # Image backed on the frontend filesystem
23
+ g5k.image = {
24
+ # :path => "/udd/msimonin/precise.qcow2",
25
+ :path => "/home/msimonin/public/ubuntu1404-9p.qcow2",
26
+ :backing => "snapshot"
27
+ }
28
+
29
+ ## Bridged network : this allow VMs to communicate
30
+ #g5k.net = {
31
+ # :type => "bridge"
32
+ #}
33
+
34
+ ## Nat network : VMs will only have access to the external world
35
+ ## Forwarding ports will allow you to access services hosted inside the
36
+ ## VM.
37
+ g5k.net = {
38
+ :type => "nat",
39
+ :ports => ["2222-:22"]
40
+ }
41
+
42
+ ## OAR selection of resource
43
+ g5k.oar = "virtual != 'none'"
44
+ #g5k.oar = "virtual != 'None' and network_address in ('paranoia-2.rennes.grid5000.fr')"
45
+ #g5k.oar = "network_address in ('igrida12-12.irisa.fr')"
46
+
47
+ ## VM size customization default values are
48
+ ## cpu => -1 -> all the cpu of the reserved node
49
+ ## mem => -1 -> all the mem of the reserved node
50
+ ##
51
+ g5k.resources = {
52
+ :cpu => 1,
53
+ :mem => 2048
54
+ }
55
+ end #g5k
56
+
57
+ ## This define a VM.
58
+ ## a g5k provider section will override top level options
59
+ ## To define multiple VMs you can
60
+ ## * either repeat the block
61
+ ## * loop over using (1..N).each block
62
+ config.vm.define "exp5" do |my|
63
+ my.vm.box = "dummy"
64
+ ## Configure the shared folders between your host and the VM
65
+ my.vm.synced_folder ".", "/vagrant", type: "rsync", disabled: false
66
+ ## This is mandatory until #6 is fixed
67
+ ## In particular this is needed for the shared folders
68
+ my.ssh.insert_key = false
69
+
70
+ end #vm
71
+
72
+ end
data/dummy.box ADDED
Binary file
Binary file
@@ -77,6 +77,8 @@ module VagrantPlugins
77
77
  b1.use ConnectG5K
78
78
  b1.use CreateLocalWorkingDir
79
79
  b1.use RunInstance # launch a new instance
80
+ b1.use WaitForCommunicator, [:Running]
81
+ b1.use SyncedFolders
80
82
  end
81
83
  end
82
84
  end
@@ -43,7 +43,7 @@ module VagrantPlugins
43
43
  @logger.debug("Returning #{stdout}")
44
44
  }
45
45
  stdout
46
-
46
+
47
47
  end
48
48
 
49
49
  def upload(src, dst)
@@ -42,7 +42,7 @@ module VagrantPlugins
42
42
  ports = @net[:ports]
43
43
  ssh_fwd = ports.select{ |x| x.split(':')[1] == '22'}.first
44
44
  if ssh_fwd.nil?
45
- env[:ui].error "SSH port 22 must be forwarded"
45
+ @env[:ui].error "SSH port 22 must be forwarded"
46
46
  raise Error "SSh port 22 isn't forwarded"
47
47
  end
48
48
  ssh_fwd = ssh_fwd.split('-:')[0]
@@ -61,5 +61,3 @@ module VagrantPlugins
61
61
  end
62
62
  end
63
63
  end
64
-
65
-
@@ -16,7 +16,7 @@ module VagrantPlugins
16
16
  return Action.send(action_method) if Action.respond_to?(action_method)
17
17
  nil
18
18
  end
19
-
19
+
20
20
  def ssh_info
21
21
  # Run a custom action called "read_ssh_info" which does what it
22
22
  # says and puts the resulting SSH info into the `:machine_ssh_info`
@@ -79,7 +79,7 @@ clean_shutdown() {
79
79
  trap clean_shutdown 12
80
80
 
81
81
  # Launch virtual machine
82
- kvm -m $VM_MEM -smp cores=$SMP,threads=1,sockets=1 -fsdev local,security_model=none,id=fsdev0,path=$HOME -device virtio-9p-pci,id=fs0,fsdev=fsdev0,mount_tag=hostshare -nographic -monitor unix:/tmp/vagrant-g5k.$OAR_JOB_ID.mon,server,nowait -localtime -enable-kvm $net $@ &
82
+ kvm -m $VM_MEM -smp cores=$SMP,threads=1,sockets=1 -fsdev local,security_model=none,id=fsdev0,path=$HOME -device virtio-9p-pci,id=fs0,fsdev=fsdev0,mount_tag=hostshare -nographic -monitor unix:/tmp/vagrant-g5k.$OAR_JOB_ID.mon,server,nowait -localtime -enable-kvm -vnc :1,password $net $@ &
83
83
 
84
84
  wait
85
85
 
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module G5K
3
- VERSION = '0.9.2'
3
+ VERSION = '0.9.3'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-g5k
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.2
4
+ version: 0.9.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthieu Simonin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-17 00:00:00.000000000 Z
11
+ date: 2017-03-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: iniparse
@@ -138,6 +138,7 @@ executables: []
138
138
  extensions: []
139
139
  extra_rdoc_files: []
140
140
  files:
141
+ - ".Vagrantfile.swp"
141
142
  - ".gitignore"
142
143
  - ".rspec"
143
144
  - CHANGELOG.md
@@ -145,7 +146,10 @@ files:
145
146
  - LICENSE
146
147
  - README.md
147
148
  - Vagrantfile
149
+ - Vagrantfile.old
150
+ - dummy.box
148
151
  - lib/vagrant-g5k.rb
152
+ - lib/vagrant-g5k/.action.rb.swp
149
153
  - lib/vagrant-g5k/.config.rb.swp
150
154
  - lib/vagrant-g5k/action.rb
151
155
  - lib/vagrant-g5k/action/connect_g5k.rb