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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Leo Le Bouter
slapos
Commits
39cad3e8
Commit
39cad3e8
authored
Sep 24, 2019
by
Thomas Gambier
🚴🏼
Browse files
Options
Browse Files
Download
Plain Diff
Update Release Candidate
parents
a28e5c01
9976017e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
19 deletions
+52
-19
component/qemu-kvm/buildout.cfg
component/qemu-kvm/buildout.cfg
+13
-7
slapos/recipe/wrapper.py
slapos/recipe/wrapper.py
+39
-12
No files found.
component/qemu-kvm/buildout.cfg
View file @
39cad3e8
...
@@ -67,15 +67,21 @@ md5sum = 096c1c18b44c269808bd815d58c53c8f
...
@@ -67,15 +67,21 @@ md5sum = 096c1c18b44c269808bd815d58c53c8f
version = 8.11.1
version = 8.11.1
md5sum = df0ce86d0b1d81e232ad08eef58754ed
md5sum = df0ce86d0b1d81e232ad08eef58754ed
[debian-amd64-stretch-netinst.iso]
<= debian-amd64-netinst-base
version = 9.11.0
md5sum = f525f0c3f1c4ca184a604a75dabf4f71
[debian-amd64-netinst.iso]
[debian-amd64-netinst.iso]
# Download the installer of Debian 9 (Stretch)
# Download the installer of Debian 10 (Buster)
# XXX: This is not the latest version because
# Debian does not provide a stable URL for it.
<= debian-amd64-netinst-base
<= debian-amd64-netinst-base
version =
9.8
.0
version =
10.0
.0
md5sum =
e0a43cbb8b991735c1b38e7041019658
md5sum =
f31779fcca35f5ce9833a9661a9bd5bd
[debian-amd64-testing-netinst.iso]
[debian-amd64-testing-netinst.iso]
# Download the installer of Debian Buster
<= debian-amd64-netinst-base
<= debian-amd64-netinst-base
release =
buster_di_rc
1
release =
daily/20190923-
1
version =
buster-DI-rc1
version =
testing
md5sum =
cf8f8e3afef91f3ce3a09e7cc5f530f0
md5sum =
00eda4218c401c46c15f491add41cd4e
slapos/recipe/wrapper.py
View file @
39cad3e8
...
@@ -25,27 +25,54 @@
...
@@ -25,27 +25,54 @@
#
#
##############################################################################
##############################################################################
import
shlex
import
os
,
shlex
from
six.moves
import
filter
from
slapos.recipe.librecipe
import
GenericBaseRecipe
,
generateHashFromFiles
from
slapos.recipe.librecipe
import
GenericBaseRecipe
,
generateHashFromFiles
from
zc.buildout
import
UserError
class
Recipe
(
GenericBaseRecipe
):
class
Recipe
(
GenericBaseRecipe
):
"""Recipe to create a script from given command and options.
"""Recipe to create a script from given command and options.
:param str command-line: shell command which launches the intended process
:param str command-line: shell command which launches the intended process
:param str wrapper-path: absolute path to file's destination
:param str wrapper-path: absolute path to file's destination
:param lines wait-for-files: list of files to wait for
:param lines wait-for-files: list of files to wait for
:param lines hash-files: list of files to be checked by hash
:param lines hash-files: list of buildout-generated files to be checked by hash
:param lines hash-existing-files: list of existing files to be checked by hash
:param str pidfile: path to pidfile ensure exclusivity for the process
:param str pidfile: path to pidfile ensure exclusivity for the process
:param str private-dev-shm: size of private /dev/shm, using user namespaces
:param str private-dev-shm: size of private /dev/shm, using user namespaces
:param bool reserve-cpu: command will ask for an exclusive CPU core
:param bool reserve-cpu: command will ask for an exclusive CPU core
"""
"""
_existing
=
()
def
__init__
(
self
,
buildout
,
name
,
options
):
self
.
buildout
=
buildout
self
.
options
=
options
hash_files
=
options
.
get
(
'hash-files'
)
if
hash_files
:
self
.
hash_files
=
hash_files
.
split
()
self
.
_existing
=
list
(
filter
(
os
.
path
.
exists
,
self
.
hash_files
))
else
:
self
.
hash_files
=
[]
hash_files
=
options
.
get
(
'hash-existing-files'
)
if
hash_files
:
hash_files
=
hash_files
.
split
()
options
[
'__hash_files__'
]
=
generateHashFromFiles
(
hash_files
)
self
.
hash_files
+=
hash_files
def
getWrapperPath
(
self
):
wrapper_path
=
self
.
options
[
'wrapper-path'
]
if
self
.
hash_files
:
wrapper_path
+=
'-'
+
generateHashFromFiles
(
self
.
hash_files
)
return
wrapper_path
def
install
(
self
):
def
install
(
self
):
if
self
.
_existing
:
raise
UserError
(
"hash-files must only list files that are generated by buildout:"
"
\
n
"
+
"
\
n
"
.
join
(
self
.
_existing
))
args
=
shlex
.
split
(
self
.
options
[
'command-line'
])
args
=
shlex
.
split
(
self
.
options
[
'command-line'
])
wrapper_path
=
self
.
options
[
'wrapper-path'
]
wait_files
=
self
.
options
.
get
(
'wait-for-files'
)
wait_files
=
self
.
options
.
get
(
'wait-for-files'
)
hash_files
=
self
.
options
.
get
(
'hash-files'
)
pidfile
=
self
.
options
.
get
(
'pidfile'
)
pidfile
=
self
.
options
.
get
(
'pidfile'
)
private_dev_shm
=
self
.
options
.
get
(
'private-dev-shm'
)
private_dev_shm
=
self
.
options
.
get
(
'private-dev-shm'
)
...
@@ -65,10 +92,10 @@ class Recipe(GenericBaseRecipe):
...
@@ -65,10 +92,10 @@ class Recipe(GenericBaseRecipe):
kw
[
'private_dev_shm'
]
=
private_dev_shm
kw
[
'private_dev_shm'
]
=
private_dev_shm
if
self
.
isTrueValue
(
self
.
options
.
get
(
'reserve-cpu'
)):
if
self
.
isTrueValue
(
self
.
options
.
get
(
'reserve-cpu'
)):
kw
[
'reserve_cpu'
]
=
True
kw
[
'reserve_cpu'
]
=
True
if
hash_files
:
return
self
.
createWrapper
(
self
.
getWrapperPath
(),
hash_file_list
=
hash_files
.
split
()
args
,
environment
,
**
kw
)
hash
=
generateHashFromFiles
(
hash_file_list
)
wrapper_path
=
"%s-%s"
%
(
wrapper_path
,
hash
)
return
self
.
createWrapper
(
wrapper_path
,
args
,
environment
,
**
kw
)
def
update
(
self
):
wrapper_path
=
self
.
getWrapperPath
()
if
not
os
.
path
.
isfile
(
wrapper_path
):
raise
UserError
(
"unstable wrapper path (%r)"
%
wrapper_path
)
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