Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kwabena Antwi-Boasiako
slapos
Commits
aa295c15
Commit
aa295c15
authored
Jul 30, 2012
by
Antoine Catton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Switch to images for rootfs
parent
14bf54b1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
35 deletions
+19
-35
slapos/recipe/container.py
slapos/recipe/container.py
+7
-11
slapos/recipe/rootfs.py
slapos/recipe/rootfs.py
+4
-4
software/lxc/instance-lxc.cfg
software/lxc/instance-lxc.cfg
+7
-18
software/lxc/software.cfg
software/lxc/software.cfg
+1
-2
No files found.
slapos/recipe/container.py
View file @
aa295c15
...
...
@@ -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
:
...
...
slapos/recipe/rootfs.py
View file @
aa295c15
...
...
@@ -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
[
'
archiv
e'
],
subprocess
.
check_call
([
args
[
'wget'
],
args
[
'
imag
e'
],
'-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
[
'archiv
e-url'
],
'output'
:
self
.
options
[
'downloaded-
archiv
e'
],
'confirm'
:
self
.
options
[
'downloaded-
archiv
e-complete'
]
'
image'
:
self
.
options
[
'imag
e-url'
],
'output'
:
self
.
options
[
'downloaded-
imag
e'
],
'confirm'
:
self
.
options
[
'downloaded-
imag
e-complete'
]
}
)
)
...
...
software/lxc/instance-lxc.cfg
View file @
aa295c15
...
...
@@ -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-archiv
e}
archive-complete = $${rootfs:downloaded-archiv
e-complete}
lxc-config = $${
rootdirectory:etc}/lxc.conf
image = $${rootfs:downloaded-imag
e}
image-complete = $${rootfs:downloaded-imag
e-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
archiv
e-url = $${slap-parameter:rootfs}
downloaded-
archive = $${rootdirectory:tmp}/rootfs.tar.gz
downloaded-
archive-complete = $${rootdirectory:tmp}/rootfs.ok
imag
e-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}
software/lxc/software.cfg
View file @
aa295c15
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment