Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
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
Thomas Gambier
slapos.core
Commits
a017583e
Commit
a017583e
authored
Jun 19, 2020
by
Thomas Gambier
🚴🏼
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
grid: launch supervisord with bigger FILENO soft limit
parent
9f406e6e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
3 deletions
+9
-3
setup.py
setup.py
+2
-1
slapos/grid/svcbackend.py
slapos/grid/svcbackend.py
+7
-2
No files found.
setup.py
View file @
a017583e
...
@@ -63,7 +63,7 @@ setup(name=name,
...
@@ -63,7 +63,7 @@ setup(name=name,
'netaddr>=0.7.5'
,
# to play safely with IPv6 prefixes
'netaddr>=0.7.5'
,
# to play safely with IPv6 prefixes
'netifaces'
,
# to fetch information about network devices
'netifaces'
,
# to fetch information about network devices
'setuptools'
,
# namespaces
'setuptools'
,
# namespaces
'supervisor'
,
# slapgrid uses supervisor to manage processes
'supervisor
>=3.3.0
'
,
# slapgrid uses supervisor to manage processes
'psutil>=2.0.0'
,
'psutil>=2.0.0'
,
'xml_marshaller>=0.9.3'
,
# to unmarshall/marshall python objects to/from
'xml_marshaller>=0.9.3'
,
# to unmarshall/marshall python objects to/from
# XML
# XML
...
@@ -75,6 +75,7 @@ setup(name=name,
...
@@ -75,6 +75,7 @@ setup(name=name,
'cachecontrol'
,
'cachecontrol'
,
'lockfile'
,
'lockfile'
,
'uritemplate'
,
# used by hateoas navigator
'uritemplate'
,
# used by hateoas navigator
'resource'
,
'subprocess32; python_version<"3"'
'subprocess32; python_version<"3"'
]
+
additional_install_requires
,
]
+
additional_install_requires
,
extras_require
=
extras_require
,
extras_require
=
extras_require
,
...
...
slapos/grid/svcbackend.py
View file @
a017583e
...
@@ -31,6 +31,7 @@
...
@@ -31,6 +31,7 @@
import
os
import
os
import
pkg_resources
import
pkg_resources
import
socket
as
socketlib
import
socket
as
socketlib
import
resource
import
subprocess
import
subprocess
import
stat
import
stat
import
sys
import
sys
...
@@ -175,7 +176,10 @@ def launchSupervisord(instance_root, logger,
...
@@ -175,7 +176,10 @@ def launchSupervisord(instance_root, logger,
supervisord_argument_list
=
[
'-c'
,
configuration_file
]
supervisord_argument_list
=
[
'-c'
,
configuration_file
]
if
supervisord_additional_argument_list
is
not
None
:
if
supervisord_additional_argument_list
is
not
None
:
supervisord_argument_list
.
extend
(
supervisord_additional_argument_list
)
supervisord_argument_list
.
extend
(
supervisord_additional_argument_list
)
def
preexec_fn
():
cur_limit
=
resource
.
getrlimit
(
resource
.
RLIMIT_NOFILE
)
new_limit
=
(
cur_limit
[
1
],
cur_limit
[
1
])
# set the soft limit to the hard limit
resource
.
setrlimit
(
resource
.
RLIMIT_NOFILE
,
new_limit
)
logger
.
info
(
"Launching supervisord with clean environment."
)
logger
.
info
(
"Launching supervisord with clean environment."
)
# Extract python binary to prevent shebang size limit
# Extract python binary to prevent shebang size limit
invocation_list
=
[
sys
.
executable
,
'-c'
]
invocation_list
=
[
sys
.
executable
,
'-c'
]
...
@@ -188,7 +192,8 @@ def launchSupervisord(instance_root, logger,
...
@@ -188,7 +192,8 @@ def launchSupervisord(instance_root, logger,
env
=
{},
env
=
{},
stdout
=
subprocess
.
PIPE
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
STDOUT
,
stderr
=
subprocess
.
STDOUT
,
logger
=
logger
)
logger
=
logger
,
preexec_fn
=
preexec_fn
)
result
=
supervisord_popen
.
communicate
()[
0
]
result
=
supervisord_popen
.
communicate
()[
0
]
if
supervisord_popen
.
returncode
:
if
supervisord_popen
.
returncode
:
...
...
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