Commit aa295c15 authored by Antoine Catton's avatar Antoine Catton

Switch to images for rootfs

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