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
Eric Zheng
slapos
Commits
24adc453
Commit
24adc453
authored
Jan 22, 2020
by
Thomas Gambier
🚴🏼
Browse files
Options
Browse Files
Download
Plain Diff
Update Release Candidate
parents
a1efb131
9dc8a4e2
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
196 additions
and
95 deletions
+196
-95
component/proftpd/buildout.cfg
component/proftpd/buildout.cfg
+8
-9
software/kvm/buildout.hash.cfg
software/kvm/buildout.hash.cfg
+6
-6
software/kvm/instance-kvm-resilient.cfg.jinja2
software/kvm/instance-kvm-resilient.cfg.jinja2
+7
-0
software/kvm/instance-kvm.cfg.jinja2
software/kvm/instance-kvm.cfg.jinja2
+7
-4
software/kvm/instance-nbd.cfg.in
software/kvm/instance-nbd.cfg.in
+0
-71
software/kvm/instance-nbd.cfg.jinja2
software/kvm/instance-nbd.cfg.jinja2
+85
-0
software/kvm/instance.cfg.in
software/kvm/instance.cfg.in
+14
-1
software/kvm/software.cfg
software/kvm/software.cfg
+2
-2
software/kvm/template/template-kvm-run.in
software/kvm/template/template-kvm-run.in
+3
-0
software/kvm/test/test.py
software/kvm/test/test.py
+60
-0
software/nayuos/buildout.hash.cfg
software/nayuos/buildout.hash.cfg
+1
-1
software/nayuos/instance.cfg
software/nayuos/instance.cfg
+2
-1
software/nayuos/scripts/cros_full_build.in
software/nayuos/scripts/cros_full_build.in
+1
-0
software/nayuos/wallpaper/guest_large.jpg
software/nayuos/wallpaper/guest_large.jpg
+0
-0
software/nayuos/wallpaper/guest_small.jpg
software/nayuos/wallpaper/guest_small.jpg
+0
-0
No files found.
component/proftpd/buildout.cfg
View file @
24adc453
...
...
@@ -29,15 +29,14 @@ configure-options =
--enable-nls
--enable-ctrls
--enable-dso
--disable-cap
--with-modules=mod_sftp:mod_ban
--prefix=${buildout:parts-directory}/${:_buildout_section_name_}
environment =
CPPFLAGS=
${:cppflags}
LDFLAGS=
${:ldflags}
CPPFLAGS=
-I${zlib:location}/include -I${openssl:location}/include
LDFLAGS=
-L${zlib:location}/lib -Wl,-rpath=${zlib:location}/lib -L${openssl:location}/lib -Wl,-rpath=${openssl:location}/lib
install_user=${proftpd-environment:USER}
install_group=${proftpd-grp:GROUP}
cppflags=-I${zlib:location}/include -I${openssl:location}/include
ldflags=-L${zlib:location}/lib -Wl,-rpath=${zlib:location}/lib -L${openssl:location}/lib -Wl,-rpath=${openssl:location}/lib
patch-binary = ${patch:location}/bin/patch
patch-options = -p1
patches =
...
...
@@ -56,14 +55,14 @@ git-executable = ${git:location}/bin/git
[proftpd-mod_auth_web]
recipe = plone.recipe.command
stop-on-error = true
# prxs does not support setting rpath, but we can "inject" -R that will be passed to libtool
command =
LIBTOOL=${libtool:location}/bin/libtool \
LDFLAGS="-Wl,-rpath=${curl:location}/lib ${proftpd:ldflags}" \
${proftpd-output:prxs} -c -i \
-I ${curl:location}/include ${proftpd:cppflags} \
-L ${curl:location}/lib/ \
${proftpd-output:prxs} -c -i -d \
-I ${curl:location}/include \
-L '${curl:location}/lib/ -R ${openssl:location}/lib -R ${zlib:location}/lib' \
-l curl \
-d
${proftpd-mod_auth_web-repository:location}/mod_auth_web.c
${proftpd-mod_auth_web-repository:location}/mod_auth_web.c
location=${proftpd:location}/libexec/mod_auth_web.so
...
...
software/kvm/buildout.hash.cfg
View file @
24adc453
...
...
@@ -15,11 +15,11 @@
[template]
filename = instance.cfg.in
md5sum =
2cbfd6b08c65369c1d45cf3ba2ff335
a
md5sum =
a236b719aaac61ac342ada0ce569151
a
[template-kvm]
filename = instance-kvm.cfg.jinja2
md5sum =
36e7a8656e52d3aace8d9e52dcb3864e
md5sum =
891d98667feb8daaa9f61b5bf09d5de0
[template-kvm-cluster]
filename = instance-kvm-cluster.cfg.jinja2.in
...
...
@@ -27,7 +27,7 @@ md5sum = 2e743132ba4e001f784791311df9ba6a
[template-kvm-resilient]
filename = instance-kvm-resilient.cfg.jinja2
md5sum =
e50e45c3097ed5a7115817fbc967f173
md5sum =
7de5756f59ef7d823cd8ed33e6d15230
[template-kvm-import]
filename = instance-kvm-import.cfg.jinja2.in
...
...
@@ -46,8 +46,8 @@ filename = template/kvm-export.sh.jinja2
md5sum = b617d64de73de1eed518185f310bbc82
[template-nbd]
filename = instance-nbd.cfg.
in
md5sum =
c3667c9bbaa8627dad90f1abd62d2f16
filename = instance-nbd.cfg.
jinja2
md5sum =
003112c44ef8d536861a46e3dfc67a37
[template-ansible-promise]
filename = template/ansible-promise.in
...
...
@@ -55,7 +55,7 @@ md5sum = 2036bf145f472f62ef8dee5e729328fd
[template-kvm-run]
filename = template/template-kvm-run.in
md5sum =
71e0c6c8a0b9a46498f25b67a3ab6894
md5sum =
08af4ed0e2a53e76c844e3d7325aac09
[template-kvm-controller]
filename = template/kvm-controller-run.in
...
...
software/kvm/instance-kvm-resilient.cfg.jinja2
View file @
24adc453
...
...
@@ -13,6 +13,7 @@
{% set monitor_dict = {'parameter': monitor_parameter, 'return': monitor_return} -%}
{% endif -%}
{% set monitor_interface_url = slapparameter_dict.pop('monitor-interface-url', 'https://monitor.app.officejs.com') -%}
{% set additional_frontend = (slapparameter_dict.get('frontend-additional-instance-guid', '').strip() != '') %}
[buildout]
eggs-directory = {{ eggs_directory }}
...
...
@@ -66,6 +67,9 @@ return =
url ssh-public-key resilient-ssh-url notification-id ip {{ monitor_return | join(' ') }}
# KVM related parameters
# XXX: return ALL parameters (like nat rules), through jinja
{% if additional_frontend %}
url-additional
{% endif %}
backend-url url ip
{{ ' ' }}ipv6-network-info
...
...
@@ -81,6 +85,9 @@ monitor-user = ${monitor-publish-parameters:monitor-user}
monitor-base-url = ${monitor-publish-parameters:monitor-base-url}
monitor-setup-url = {{ monitor_interface_url }}/#page=settings_configurator&url=${monitor-publish-parameters:monitor-url}&username=${monitor-publish-parameters:monitor-user}&password=${publish-early:monitor-password}
{% endif -%}
{% if additional_frontend %}
url-additional = ${request-kvm:connection-url-additional}
{% endif %}
[kvm-frontend-url-bin]
recipe = collective.recipe.template
...
...
software/kvm/instance-kvm.cfg.jinja2
View file @
24adc453
...
...
@@ -88,6 +88,7 @@ nbd2-host = ${slap-parameter:nbd2-host}
nbd2-port = ${slap-parameter:nbd2-port}
tap-interface = {{ slap_configuration.get('tap-name', '') }}
tap-ipv6-addr = {{ slap_configuration.get('tap-ipv6-addr', '') }}
disk-size = ${slap-parameter:disk-size}
disk-type = ${slap-parameter:disk-type}
...
...
@@ -532,7 +533,7 @@ key_info = Get the publick key file in your VM with the command: wget {{ kvm_htt
{% if use_tap == 'true' and slap_configuration.get('tap-ipv4-addr') -%}
ipv4-network-info =
Use this configuration in /etc/network/interfaces to configure IPv4 on interface {{ iface }} in your VM.
PERMANENT SOLUTION: in your VM, add the lines below in /etc/network/interfaces and then run: "ifup {{ iface }}"
auto {{ iface }}
iface {{ iface }} inet static
address {{ slap_configuration.get('tap-ipv4-addr') }}
...
...
@@ -540,13 +541,14 @@ ipv4-network-info =
gateway {{ slap_configuration.get('tap-ipv4-gateway') }}
{% if enable_http == 'true' %}
${helper:blank-line}
Or run in your VM the command: wget -O- {{ kvm_http }}/${network-config-ipv4:filename} | /bin/sh -
TEMPORARY SOLUTION: run in your VM the command: "wget -O- {{ kvm_http }}/${network-config-ipv4:filename} | /bin/sh -"
(the configuration will be gone after the next reboot)
{% endif %}
{% endif %}
ipv6-network-info =
{% if use_tap == 'true' and slap_configuration.get('tap-ipv6-addr') %}
Use this configuration in /etc/network/interfaces to configure IPv6 on interface {{ iface }} in your VM.
PERMANENT SOLUTION: in your VM, add the lines below in /etc/network/interfaces and then run: "ifup {{ iface }}"
auto {{ iface }}
iface {{ iface }} inet6 static
address {{ slap_configuration.get('tap-ipv6-gateway') }}
...
...
@@ -554,7 +556,8 @@ ipv6-network-info =
gateway {{ slap_configuration.get('tap-ipv6-addr') }}
{% if enable_http == 'true' %}
${helper:blank-line}
Or run in your VM the command: wget -O- {{ kvm_http }}/${network-config-ipv6:filename} | /bin/sh -
TEMPORARY SOLUTION: run in your VM the command: "wget -O- {{ kvm_http }}/${network-config-ipv6:filename} | /bin/sh -"
(the configuration will be gone after the next reboot)
{% endif %}
{% endif %}
...
...
software/kvm/instance-nbd.cfg.in
deleted
100644 → 0
View file @
a1efb131
#############################
#
# Instanciate nbdserver
#
#############################
[buildout]
parts =
nbd-promise
onetimeupload-promise
publish-connection-information
extends = ${monitor-template:output}
eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
offline = true
[rootdirectory]
recipe = slapos.cookbook:mkdirectory
etc = $${buildout:directory}/etc
srv = $${buildout:directory}/srv
log = $${buildout:directory}/log
[basedirectory]
recipe = slapos.cookbook:mkdirectory
services = $${rootdirectory:etc}/run
watched-services = $${rootdirectory:etc}/service
[nbd-instance]
recipe = slapos.cookbook:nbdserver
ip = $${slap-network-information:global-ipv6}
port = 1024
image-path = $${onetimeupload-instance:image-path}
qemu-path = ${kvm:location}/bin/qemu-nbd
shell-path = ${dash:location}/bin/dash
# XXX TODO: Wait for the iso to be uploaded (execute_wait)
path = $${basedirectory:services}/nbdserver
[nbd-promise]
<= monitor-promise-base
module = check_port_listening
name = nbd_promise.py
config-hostname = $${nbd-instance:ip}
config-port = $${nbd-instance:port}
[gen-passwd]
recipe = slapos.cookbook:generate.password
storage-path = $${rootdirectory:srv}/passwd
bytes = 24
[onetimeupload-instance]
recipe = slapos.cookbook:onetimeupload
ip = $${slap-network-information:global-ipv6}
port = 8080
image-path = $${rootdirectory:srv}/cdrom.iso
log-path = $${rootdirectory:log}/onetimeupload.log
shell-path = ${dash:location}/bin/dash
onetimeupload-path = ${buildout:bin-directory}/onetimeupload
path = $${basedirectory:watched-services}/onetimeupload
key = $${gen-passwd:passwd}
[onetimeupload-promise]
<= monitor-promise-base
module = check_port_listening
name = onetimeupload_promise.py
config-hostname = $${onetimeupload-instance:ip}
config-port = $${onetimeupload-instance:port}
[publish-connection-information]
recipe = slapos.cookbook:publish
nbd_url = nbd://[$${nbd-instance:ip}]:$${nbd-instance:port}
upload_url = http://[$${onetimeupload-instance:ip}]:$${onetimeupload-instance:port}/
upload_key = $${onetimeupload-instance:key}
software/kvm/instance-nbd.cfg.jinja2
0 → 100644
View file @
24adc453
#############################
#
# Instanciate nbdserver
#
#############################
[buildout]
parts =
nbd-promise
onetimeupload-promise
publish-connection-information
extends = {{ template_monitor }}
eggs-directory = {{ eggs_directory }}
develop-eggs-directory = {{ develop_eggs_directory }}
offline = true
[rootdirectory]
recipe = slapos.cookbook:mkdirectory
bin = ${buildout:directory}/bin
etc = ${buildout:directory}/etc
srv = ${buildout:directory}/srv
log = ${buildout:directory}/log
[basedirectory]
recipe = slapos.cookbook:mkdirectory
services = ${rootdirectory:etc}/run
watched-services = ${rootdirectory:etc}/service
[nbd-instance]
recipe = slapos.cookbook:nbdserver
ip = ${slap-network-information:global-ipv6}
port = 1024
image-path = ${onetimeupload-instance:image-path}
qemu-path = {{ qemu_nbd_executable_location }}
shell-path = {{ dash_executable_location }}
# XXX TODO: Wait for the iso to be uploaded (execute_wait)
path = ${basedirectory:services}/nbdserver
[nbd-checker-bin]
recipe = slapos.recipe.template:jinja2
template = inline:#!/bin/sh
[ ! -f ${onetimeupload-instance:image-path} ] ||
${buildout:executable} -c 'import socket ; socket.create_connection(("${nbd-instance:ip}","${nbd-instance:port}")).close()'
rendered = ${rootdirectory:bin}/check-nbd-running.sh
[nbd-promise]
<= monitor-promise-base
module = check_command_execute
name = nbd_promise.py
config-command = ${nbd-checker-bin:rendered}
[gen-passwd]
recipe = slapos.cookbook:generate.password
storage-path = ${rootdirectory:srv}/passwd
bytes = 24
[onetimeupload-instance]
recipe = slapos.cookbook:onetimeupload
ip = ${slap-network-information:global-ipv6}
port = {{ slapparameter_dict.get('otu-port', 8080) }}
image-path = ${rootdirectory:srv}/cdrom.iso
log-path = ${rootdirectory:log}/onetimeupload.log
shell-path = {{ dash_executable_location }}
onetimeupload-path = {{ onetimeupload_executable_location }}
path = ${basedirectory:watched-services}/onetimeupload
key = ${gen-passwd:passwd}
[onetimeupload-promise]
<= monitor-promise-base
module = check_port_listening
name = onetimeupload_promise.py
config-hostname = ${onetimeupload-instance:ip}
config-port = ${onetimeupload-instance:port}
[publish-connection-information]
recipe = slapos.cookbook:publish
nbd_hostname = ${nbd-instance:ip}
nbd_port = ${nbd-instance:port}
upload_url = http://[${onetimeupload-instance:ip}]:${onetimeupload-instance:port}
upload_key = ${onetimeupload-instance:key}
status_message = ${detect-if-cdrom-present:status}
[detect-if-cdrom-present]
recipe = collective.recipe.shelloutput
commands =
status = [ -f ${onetimeupload-instance:image-path} ] && echo "image already uploaded, you can't upload it again" || echo "WARNING: no image yet, the NBD server doesn't work"
software/kvm/instance.cfg.in
View file @
24adc453
...
...
@@ -12,7 +12,7 @@ recipe = slapos.cookbook:softwaretype
default = $${:kvm}
kvm-cluster = $${dynamic-template-kvm-cluster:rendered}
kvm = $${dynamic-template-kvm:rendered}
nbd = $
{template-nbd:output
}
nbd = $
${dynamic-template-nbd:rendered
}
kvm-resilient = $${dynamic-template-kvm-resilient:rendered}
kvm-import = $${dynamic-template-kvm-import:rendered}
...
...
@@ -149,3 +149,16 @@ context =
raw gzip_binary ${gzip:location}/bin/gzip
mode = 0644
[dynamic-template-nbd]
<= jinja2-template-base
template = ${template-nbd:location}/instance-nbd.cfg.jinja2
filename = template-nbd.cfg
context =
section slap_configuration slap-configuration
key slapparameter_dict slap-configuration:configuration
key eggs_directory buildout:eggs-directory
key develop_eggs_directory buildout:develop-eggs-directory
raw qemu_nbd_executable_location ${kvm:location}/bin/qemu-nbd
raw dash_executable_location ${dash:location}/bin/dash
raw onetimeupload_executable_location ${buildout:bin-directory}/onetimeupload
raw template_monitor ${monitor2-template:rendered}
software/kvm/software.cfg
View file @
24adc453
...
...
@@ -144,8 +144,8 @@ filename = kvm-export.sh.jinja2
mode = 0755
[template-nbd]
<=
template
-file-base
o
utput = ${buildout:directory}/template-nbd.cfg
<=
download
-file-base
o
n-update = true
[template-ansible-promise]
<= download-template-base
...
...
software/kvm/template/template-kvm-run.in
View file @
24adc453
...
...
@@ -44,6 +44,7 @@ tap_interface = '{{ parameter_dict.get("tap-interface") }}'
listen_ip = '{{ parameter_dict.get("ipv4") }}'
mac_address = '{{ parameter_dict.get("mac-address") }}'
tap_mac_address = '{{ parameter_dict.get("tap-mac-address") }}'
tap_ipv6_addr = '{{ parameter_dict.get("tap-ipv6-addr") }}'
numa_list = '{{ parameter_dict.get("numa", "") }}'.split()
ram_size = {{ parameter_dict.get("ram-size") }}
ram_max_size = '{{ parameter_dict.get("ram-max-size") }}'
...
...
@@ -278,6 +279,8 @@ if use_nat == 'true':
cluster_doc_host, cluster_doc_port)
if set_nat_restrict == 'true':
rules += ',restrict=on'
if use_tap == 'true' and tap_ipv6_addr != '':
rules += ',ipv6=off'
nat_network_parameter = ['-netdev', rules,
'-device', 'virtio-net-pci,netdev=lan%s,mac=%s' % (number, mac_address)]
if use_tap == 'true':
...
...
software/kvm/test/test.py
View file @
24adc453
...
...
@@ -308,3 +308,63 @@ class TestInstanceResilient(InstanceTestCase):
'takeover-kvm-1-password'
,
'takeover-kvm-1-url'
,
'url'
]))
@
unittest
.
skipIf
(
not
sanityCheck
(),
'missing kvm_intel module'
)
class
TestAccessResilientAdditional
(
InstanceTestCase
):
__partition_reference__
=
'ara'
expected_partition_with_monitor_base_url_count
=
1
@
classmethod
def
getInstanceSoftwareType
(
cls
):
return
'kvm-resilient'
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'frontend-additional-instance-guid'
:
'SOMETHING'
}
def
test
(
self
):
connection_parameter_dict
=
self
.
computer_partition
\
.
getConnectionParameterDict
()
result
=
requests
.
get
(
connection_parameter_dict
[
'url'
],
verify
=
False
)
self
.
assertEqual
(
httplib
.
OK
,
result
.
status_code
)
self
.
assertIn
(
'<title>noVNC</title>'
,
result
.
text
)
result
=
requests
.
get
(
connection_parameter_dict
[
'url-additional'
],
verify
=
False
)
self
.
assertEqual
(
httplib
.
OK
,
result
.
status_code
)
self
.
assertIn
(
'<title>noVNC</title>'
,
result
.
text
)
class
TestInstanceNbdServer
(
InstanceTestCase
):
__partition_reference__
=
'ins'
instance_max_retry
=
5
@
classmethod
def
getInstanceSoftwareType
(
cls
):
return
'nbd'
@
classmethod
def
getInstanceParameterDict
(
cls
):
# port 8080 is used by testnode, use another one
return
{
'otu-port'
:
'8090'
}
def
test
(
self
):
connection_parameter_dict
=
self
.
computer_partition
\
.
getConnectionParameterDict
()
result
=
requests
.
get
(
connection_parameter_dict
[
'upload_url'
].
strip
(),
verify
=
False
)
self
.
assertEqual
(
httplib
.
OK
,
result
.
status_code
)
self
.
assertIn
(
'<title>Upload new File</title>'
,
result
.
text
)
self
.
assertIn
(
"WARNING"
,
connection_parameter_dict
[
'status_message'
])
software/nayuos/buildout.hash.cfg
View file @
24adc453
...
...
@@ -14,4 +14,4 @@
# not need these here).
[template-instance]
filename = instance.cfg
md5sum = a
e26da39d6a156a6164782086d6aa00d
md5sum = a
a91245be4b946d0537f6e007f0d72ea
software/nayuos/instance.cfg
View file @
24adc453
...
...
@@ -106,7 +106,7 @@ context =
recipe = slapos.recipe.template:jinja2
template = {{ software_dir }}/scripts/cros_full_build.in
rendered = ${directory:run}/cros_full_build
md5sum =
4086de2b8910a52560b7bdc53ed3af22
md5sum =
f3b3b5408b69f752f2221d3965caf590
mode = 0700
context =
key bash_path bin:bash
...
...
@@ -119,6 +119,7 @@ context =
key ebuilds_dir nayuos-ebuilds:location
raw scripts_dir {{ software_dir }}/scripts
raw logo_dir {{ software_dir }}/logo
raw wallpaper_dir {{ software_dir }}/wallpaper
raw patch_dir {{ software_dir }}/patch
# packages to be copied from our overlay into ChromiuOS' overlay
# those packages will be marked as dependency of root filesystem
...
...
software/nayuos/scripts/cros_full_build.in
View file @
24adc453
...
...
@@ -317,6 +317,7 @@ for board in ${BOARDS} ; do
cros_sdk -- cros_workon_make --board=${board} chromiumos-assets --install
cp {{ logo_dir }}/* {{ cros_location }}/{{ branch }}/src/platform/chromiumos-assets/images_100_percent/
cp {{ logo_dir }}/* {{ cros_location }}/{{ branch }}/src/platform/chromiumos-assets/images_200_percent/
cp -r {{ wallpaper_dir }} {{ cros_location }}/{{ branch }}/src/platform/chromiumos-assets/
NAYU_IMAGE_LOCATION=/tmp/${board}.nayuos.img
...
...
software/nayuos/wallpaper/guest_large.jpg
0 → 100644
View file @
24adc453
161 KB
software/nayuos/wallpaper/guest_small.jpg
0 → 100644
View file @
24adc453
59.1 KB
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