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
Joanne Hugé
slapos
Commits
52ac5e0b
Commit
52ac5e0b
authored
Mar 31, 2021
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Plain Diff
Update Release Candidate
parents
f35e6966
b2096c96
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
31 additions
and
24 deletions
+31
-24
component/cloudooo/buildout.cfg
component/cloudooo/buildout.cfg
+1
-1
setup.py
setup.py
+1
-1
software/cloudooo/buildout.hash.cfg
software/cloudooo/buildout.hash.cfg
+1
-1
software/cloudooo/instance.cfg.in
software/cloudooo/instance.cfg.in
+7
-15
software/erp5/test/test/test_balancer.py
software/erp5/test/test/test_balancer.py
+19
-3
stack/erp5/buildout.hash.cfg
stack/erp5/buildout.hash.cfg
+1
-1
stack/erp5/rsyslogd.cfg.in
stack/erp5/rsyslogd.cfg.in
+1
-2
No files found.
component/cloudooo/buildout.cfg
View file @
52ac5e0b
...
...
@@ -14,7 +14,7 @@ recipe = slapos.recipe.build:gitclone
repository = https://lab.nexedi.com/nexedi/cloudooo.git
branch = master
git-executable = ${git:location}/bin/git
revision = b
f99e5dea3ecf45c59083085540316c48cfa5488
revision = b
e6c35c0156e028f31da3ccb205afc6f95728d97
[cloudooo]
recipe = zc.recipe.egg
...
...
setup.py
View file @
52ac5e0b
...
...
@@ -28,7 +28,7 @@ from setuptools import setup, find_packages
import
glob
import
os
version
=
'1.0.1
71
'
version
=
'1.0.1
84
'
name
=
'slapos.cookbook'
long_description
=
open
(
"README.rst"
).
read
()
...
...
software/cloudooo/buildout.hash.cfg
View file @
52ac5e0b
...
...
@@ -14,7 +14,7 @@
# not need these here).
[template-cloudooo]
filename = instance.cfg.in
md5sum =
6e4431cf4b0a0d034402604b1e2844c0
md5sum =
e986de01a57161b32425f1cd3ccac924
[template-cloudooo-instance]
filename = instance-cloudooo.cfg.in
...
...
software/cloudooo/instance.cfg.in
View file @
52ac5e0b
...
...
@@ -6,7 +6,7 @@ eggs-directory = {{ eggs_directory }}
develop-eggs-directory = {{ develop_eggs_directory }}
offline = true
[slap-
parameters
]
[slap-
configuration
]
recipe = slapos.cookbook:slapconfiguration
computer = ${slap-connection:computer-id}
partition = ${slap-connection:partition-id}
...
...
@@ -19,10 +19,10 @@ recipe = slapos.recipe.template:jinja2
rendered = ${buildout:parts-directory}/${:_buildout_section_name_}/${:filename}
extra-context =
context =
key ipv6_set slap-
parameters
:ipv6
key ipv6_set slap-
configuration
:ipv6
key eggs_directory buildout:eggs-directory
key develop_eggs_directory buildout:develop-eggs-directory
key slapparameter_dict slap-
parameters
:configuration
key slapparameter_dict slap-
configuration
:configuration
${:extra-context}
[cloudooo-dynamic-template-parameter-dict]
...
...
@@ -38,18 +38,10 @@ filename = instance-cloudooo.cfg
extensions = jinja2.ext.do
extra-context =
section parameter_dict cloudooo-dynamic-template-parameter-dict
key ipv4_set slap-
parameters
:ipv4
key ipv4_set slap-
configuration
:ipv4
import itertools itertools
[switch-softwaretype]
recipe = slapos.cookbook:softwaretype
default = ${cloudooo-dynamic-template:rendered}
[slap-connection]
# part to migrate to new - separated words
computer-id = ${slap_connection:computer_id}
partition-id = ${slap_connection:partition_id}
server-url = ${slap_connection:server_url}
software-release-url = ${slap_connection:software_release_url}
key-file = ${slap_connection:key_file}
cert-file = ${slap_connection:cert_file}
recipe = slapos.cookbook:switch-softwaretype
default = cloudooo-dynamic-template:rendered
RootSoftwareInstance = ${:default}
software/erp5/test/test/test_balancer.py
View file @
52ac5e0b
...
...
@@ -197,14 +197,14 @@ class SlowHTTPServer(ManagedHTTPServer):
log_message
=
logging
.
getLogger
(
__name__
+
'.SlowHandler'
).
info
class
Test
Access
Log
(
BalancerTestCase
,
CrontabMixin
):
"""Check
access
logs emitted by balancer
class
TestLog
(
BalancerTestCase
,
CrontabMixin
):
"""Check logs emitted by balancer
"""
__partition_reference__
=
'l'
@
classmethod
def
_getInstanceParameterDict
(
cls
):
# type: () -> Dict
parameter_dict
=
super
(
Test
Access
Log
,
cls
).
_getInstanceParameterDict
()
parameter_dict
=
super
(
TestLog
,
cls
).
_getInstanceParameterDict
()
# use a slow server instead
parameter_dict
[
'dummy_http_server'
]
=
[[
cls
.
getManagedResource
(
"slow_web_server"
,
SlowHTTPServer
).
netloc
,
1
,
False
]]
return
parameter_dict
...
...
@@ -284,6 +284,22 @@ class TestAccessLog(BalancerTestCase, CrontabMixin):
self.assertTrue(os.path.exists(rotated_log_file + '
.
xz
'))
self.assertFalse(os.path.exists(rotated_log_file))
def test_error_log(self):
# stop backend server
backend_server = self.getManagedResource("slow_web_server", SlowHTTPServer)
self.addCleanup(backend_server.open)
backend_server.close()
# after a while, balancer should detect and log this event in error log
time.sleep(5)
self.assertEqual(
requests.get(self.default_balancer_url, verify=False).status_code,
requests.codes.service_unavailable)
with open(os.path.join(self.computer_partition_root_path, '
var
', '
log
', '
apache
-
error
.
log
')) as error_log_file:
error_line = error_log_file.read().splitlines()[-1]
self.assertIn('
proxy
family_default
has
no
server
available
!
', error_line)
# this log also include a timestamp
self.assertRegexpMatches(error_line, r'
\
d
{
4
}
-
\
d
{
2
}
-
\
d
{
2
}
T
\
d
{
2
}:
\
d
{
2
}:
\
d
{
2
}
')
class BalancerCookieHTTPServer(ManagedHTTPServer):
"""An HTTP Server which can set balancer cookie.
...
...
stack/erp5/buildout.hash.cfg
View file @
52ac5e0b
...
...
@@ -94,4 +94,4 @@ md5sum = 3f4f7e49c504cbf610fc5dc462713dfc
[template-rsyslogd-cfg]
filename = rsyslogd.cfg.in
md5sum =
7030e42b50e03f24e036b7785bd6159f
md5sum =
c34a9ee48b875148ea3f0d82cf853810
stack/erp5/rsyslogd.cfg.in
View file @
52ac5e0b
...
...
@@ -7,7 +7,6 @@ module(
# Also cut out first empty space in msg, which is related to rsyslogd
# internal and end up cutting on 8k, as it's default of $MaxMessageSize
template(name="rawoutput" type="string" string="%msg:2:8192%\n")
$ActionFileDefaultTemplate rawoutput
$FileCreateMode 0600
$DirCreateMode 0700
...
...
@@ -15,5 +14,5 @@ $Umask 0022
$WorkDirectory {{ parameter_dict['spool-directory'] }}
local0.=info {{ parameter_dict['access-log-file'] }}
local0.=info {{ parameter_dict['access-log-file'] }}
;rawoutput
local0.warning {{ parameter_dict['error-log-file'] }}
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