Commit aa295c15 authored by Antoine Catton's avatar Antoine Catton

Switch to images for rootfs

parent 14bf54b1
...@@ -102,20 +102,16 @@ class Recipe(GenericSlapRecipe): ...@@ -102,20 +102,16 @@ class Recipe(GenericSlapRecipe):
config.set('requested', 'status', config.set('requested', 'status',
self.computer_partition.getState()) self.computer_partition.getState())
config.set('requested', 'name', self.options['slapcontainer-name']) config.set('requested', 'name', self.options['slapcontainer-name'])
config.add_section('rootfs')
config.set('rootfs', 'image', self.options['image'])
config.set('rootfs', 'complete', self.options['image-complete'])
config.add_section('network') config.add_section('network')
config.set('network', 'ipv6', self.options['ipv6'])
config.set('network', 'ipv4', self.options['ipv4'])
config.set('network', 'interface', self.options['interface']) config.set('network', 'interface', self.options['interface'])
config.add_section('rootfs')
config.set('rootfs', 'directory', self.options['rootfs'])
config.set('rootfs', 'tmp', self.options['tmp-dir'])
config.set('rootfs', 'complete', self.options['archive-complete'])
config.add_section('config') config.add_section('config')
config.set('config', 'file', self.options['config-file']) config.set('config', 'file', self.options['lxc-config'])
config.add_section('tar')
config.set('tar', 'binary', self.options['tar-binary']) # Just a touch
config.set('tar', 'path', self.options['tar-path']) open(self.options['lxc-config'], 'a').close()
config.set('tar', 'archive', self.options['archive'])
config_filename = self.options['config'] config_filename = self.options['config']
with open(config_filename, 'w') as config_file: with open(config_filename, 'w') as config_file:
......
...@@ -32,7 +32,7 @@ from slapos.recipe.librecipe import GenericBaseRecipe ...@@ -32,7 +32,7 @@ from slapos.recipe.librecipe import GenericBaseRecipe
def service(args): def service(args):
if not os.path.exists(args['confirm']): if not os.path.exists(args['confirm']):
subprocess.check_call([args['wget'], args['archive'], subprocess.check_call([args['wget'], args['image'],
'-O', args['output']]) '-O', args['output']])
open(args['confirm'], 'w').close() open(args['confirm'], 'w').close()
...@@ -49,9 +49,9 @@ class Recipe(GenericBaseRecipe): ...@@ -49,9 +49,9 @@ class Recipe(GenericBaseRecipe):
'slapos.recipe.rootfs.service', 'slapos.recipe.rootfs.service',
{ {
'wget': self.options['wget-binary'], 'wget': self.options['wget-binary'],
'archive': self.options['archive-url'], 'image': self.options['image-url'],
'output': self.options['downloaded-archive'], 'output': self.options['downloaded-image'],
'confirm': self.options['downloaded-archive-complete'] 'confirm': self.options['downloaded-image-complete']
} }
) )
) )
......
...@@ -7,13 +7,13 @@ offline = true ...@@ -7,13 +7,13 @@ offline = true
parts = parts =
slapcontainer slapcontainer
rootfs rootfs
publish
slapcontainer-promise slapcontainer-promise
[rootdirectory] [rootdirectory]
recipe = slapos.cookbook:mkdirectory recipe = slapos.cookbook:mkdirectory
etc = $${buildout:directory}/etc etc = $${buildout:directory}/etc
tmp = $${buildout:directory}/tmp tmp = $${buildout:directory}/tmp
srv = $${buildout:directory}/srv
[basedirectory] [basedirectory]
recipe = slapos.cookbook:mkdirectory recipe = slapos.cookbook:mkdirectory
...@@ -22,18 +22,12 @@ promises = $${rootdirectory:etc}/promise ...@@ -22,18 +22,12 @@ promises = $${rootdirectory:etc}/promise
[slapcontainer] [slapcontainer]
recipe = slapos.cookbook:slapcontainer recipe = slapos.cookbook:slapcontainer
ipv4 = $${slap-network-information:local-ipv4}
ipv6 = $${slap-network-information:global-ipv6}
interface = $${slap-network-information:network-interface} interface = $${slap-network-information:network-interface}
config = $${buildout:directory}/.slapcontainer config = $${buildout:directory}/.slapcontainer
lxc-config = $${buildout:directory}/config lxc-config = $${rootdirectory:etc}/lxc.conf
archive = $${rootfs:downloaded-archive} image = $${rootfs:downloaded-image}
archive-complete = $${rootfs:downloaded-archive-complete} image-complete = $${rootfs:downloaded-image-complete}
tmp-dir = $${rootdirectory:tmp}/slapcontainer/ tmp-dir = $${rootdirectory:tmp}/slapcontainer/
config-file = $${buildout:directory}/config
rootfs = $${buildout:directory}/rootfs
tar-binary = ${tar:location}/bin/tar
tar-path = ${tar:location}/bin:${gzip:location}/bin:${bzip2:location}/bin:${xz-utils:location}/bin
[slapcontainer-promise] [slapcontainer-promise]
recipe = slapos.cookbook:slapcontainer.promise recipe = slapos.cookbook:slapcontainer.promise
...@@ -41,15 +35,10 @@ promise = $${basedirectory:promises}/slapcontainer ...@@ -41,15 +35,10 @@ promise = $${basedirectory:promises}/slapcontainer
lxc-info = ${lxc:location}/bin/lxc-info lxc-info = ${lxc:location}/bin/lxc-info
slapcontainer-name = $${slapcontainer:slapcontainer-name} slapcontainer-name = $${slapcontainer:slapcontainer-name}
[rootfs] [rootfs]
recipe = slapos.cookbook:rootfs recipe = slapos.cookbook:rootfs
archive-url = $${slap-parameter:rootfs} image-url = $${slap-parameter:rootfs}
downloaded-archive = $${rootdirectory:tmp}/rootfs.tar.gz downloaded-image = $${rootdirectory:srv}/rootfs.img
downloaded-archive-complete = $${rootdirectory:tmp}/rootfs.ok downloaded-image-complete = $${:downloaded-image}.complete
binary = $${basedirectory:services}/rootfsdownload binary = $${basedirectory:services}/rootfsdownload
wget-binary = ${wget:location}/bin/wget wget-binary = ${wget:location}/bin/wget
[publish]
recipe = slapos.cookbook:publish
ip = $${slap-network-information:global-ipv6}
...@@ -6,7 +6,6 @@ extends = ...@@ -6,7 +6,6 @@ extends =
../../component/lxml-python/buildout.cfg ../../component/lxml-python/buildout.cfg
../../component/curl/buildout.cfg ../../component/curl/buildout.cfg
../../component/wget/buildout.cfg ../../component/wget/buildout.cfg
../../component/tar/buildout.cfg
../../component/gzip/buildout.cfg ../../component/gzip/buildout.cfg
../../component/bzip2/buildout.cfg ../../component/bzip2/buildout.cfg
../../component/xz-utils/buildout.cfg ../../component/xz-utils/buildout.cfg
...@@ -29,7 +28,7 @@ mode = 0644 ...@@ -29,7 +28,7 @@ mode = 0644
[template-lxc] [template-lxc]
recipe = slapos.recipe.template recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-lxc.cfg url = ${:_profile_base_location_}/instance-lxc.cfg
md5sum = e2f2dd3dbbd2aa886aa64823238d1cfe md5sum = 901fd10e1404d10aa399b3dffcf68845
output = ${buildout:directory}/template-lxc.cfg output = ${buildout:directory}/template-lxc.cfg
mode = 0644 mode = 0644
......
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