Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nrm
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
16
Issues
16
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
argo
nrm
Commits
c8ea2ffd
Commit
c8ea2ffd
authored
Nov 28, 2018
by
Valentin Reis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Integrated process-mgt branch properly.
parent
b83309be
Pipeline
#4381
passed with stages
in 2 minutes and 14 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
21 additions
and
8 deletions
+21
-8
bin/argo-perf-wrapper
bin/argo-perf-wrapper
+10
-2
bin/daemon
bin/daemon
+3
-1
nrm/applications.py
nrm/applications.py
+1
-0
nrm/daemon.py
nrm/daemon.py
+6
-5
nrm/subprograms.py
nrm/subprograms.py
+1
-0
No files found.
bin/argo-perf-wrapper
View file @
c8ea2ffd
...
...
@@ -12,7 +12,6 @@ import uuid
logger
=
logging
.
getLogger
(
'perf-wrapper'
)
class
PerfWrapper
(
object
):
"""Implements middleware between the Linux perf and
...
...
@@ -49,6 +48,8 @@ class PerfWrapper(object):
# retrieve our container uuid
self
.
container_uuid
=
os
.
environ
.
get
(
'ARGO_CONTAINER_UUID'
)
# logger.error("container uuid:",str(self.container_uuid))
# logger.error("environ:",dict(os.environ))
if
self
.
container_uuid
is
None
:
logger
.
error
(
"missing container uuid"
)
exit
(
1
)
...
...
@@ -73,6 +74,9 @@ class PerfWrapper(object):
parser
.
add_argument
(
"-f"
,
"--frequency"
,
help
=
"sampling frequency in ms"
,
type
=
int
,
default
=
1000
)
parser
.
add_argument
(
"-l"
,
"--logfile"
,
help
=
"perf-wrapper log file"
,
type
=
str
,
default
=
"/tmp/argo-perf-wrapper.log"
)
parser
.
add_argument
(
"cmd"
,
help
=
"command and arguments"
,
nargs
=
argparse
.
REMAINDER
)
args
=
parser
.
parse_args
()
...
...
@@ -80,6 +84,10 @@ class PerfWrapper(object):
if
args
.
verbose
:
logger
.
setLevel
(
logging
.
DEBUG
)
if
args
.
logfile
:
logger
.
setLevel
(
logging
.
DEBUG
)
logger
.
addHandler
(
logging
.
FileHandler
(
args
.
logfile
))
logger
.
info
(
"cmd: %r"
,
args
.
cmd
)
self
.
setup
()
...
...
@@ -141,6 +149,6 @@ class PerfWrapper(object):
if
__name__
==
"__main__"
:
logging
.
basicConfig
(
level
=
logging
.
WARNING
)
# logging.basicConfig(level=logging.INFO
)
wrapper
=
PerfWrapper
()
wrapper
.
main
()
bin/daemon
View file @
c8ea2ffd
...
...
@@ -25,7 +25,8 @@ def main(argv=None):
args
,
remaining_argv
=
conf_parser
.
parse_known_args
()
defaults
=
{
"log"
:
"/tmp/argo_daemon.log"
,
"log_power"
:
"/tmp/argo_daemon_power.log"
}
,
"log_power"
:
"/tmp/argo_daemon_power.log"
,
"powerstrategy"
:
"0"
}
if
args
.
print_defaults
:
print
defaults
...
...
@@ -38,6 +39,7 @@ def main(argv=None):
parser
.
set_defaults
(
**
defaults
)
parser
.
add_argument
(
"--log"
,
help
=
"Main log file."
,
metavar
=
"FILE"
)
parser
.
add_argument
(
"--log_power"
,
help
=
"Power data log file (High throughput)."
,
metavar
=
"FILE"
)
parser
.
add_argument
(
"--powerstrategy"
,
help
=
"Power management strategy."
,
metavar
=
"STRATEGY"
)
args
=
parser
.
parse_args
(
remaining_argv
)
nrm
.
daemon
.
runner
(
config
=
args
)
return
(
0
)
...
...
nrm/applications.py
View file @
c8ea2ffd
...
...
@@ -58,6 +58,7 @@ class Application(object):
def
update_progress
(
self
,
msg
):
"""Update the progress tracking."""
assert
self
.
progress
logger
.
info
(
"received progress message: "
+
str
(
msg
))
def
update_phase_context
(
self
,
msg
):
"""Update the phase contextual information."""
...
...
nrm/daemon.py
View file @
c8ea2ffd
...
...
@@ -20,7 +20,7 @@ RPC_MSG = MSGTYPES['up_rpc_rep']
PUB_MSG
=
MSGTYPES
[
'up_pub'
]
logger
=
logging
.
getLogger
(
'nrm'
)
logger_power
=
logging
.
getLogger
(
'power'
)
class
Daemon
(
object
):
...
...
@@ -169,6 +169,7 @@ class Daemon(object):
def
do_control
(
self
):
plan
=
self
.
controller
.
planify
(
self
.
target
,
self
.
machine_info
)
logger
.
info
(
"Controller chose plan "
+
str
(
plan
))
action
,
actuator
=
plan
if
action
:
self
.
controller
.
execute
(
action
,
actuator
)
...
...
@@ -321,15 +322,15 @@ class Daemon(object):
def
runner
(
config
):
ioloop
.
install
()
logger
.
setLevel
(
logging
.
DEBUG
)
logger_power
.
setLevel
(
logging
.
DEBUG
)
if
config
.
log
:
print
(
"Logging to %s"
%
config
.
log
)
print
(
"Logging nrm to %s"
%
config
.
log
)
logger
.
setLevel
(
logging
.
DEBUG
)
logger
.
addHandler
(
logging
.
FileHandler
(
config
.
log
))
if
config
.
log_power
:
print
(
"Logging power data to %s"
%
config
.
log_power
)
logger_power
=
logging
.
getLogger
(
'power'
)
logger_power
.
setLevel
(
logging
.
DEBUG
)
formatter
=
logging
.
Formatter
(
'%(message)s'
)
handler
=
logging
.
FileHandler
(
config
.
log_power
)
handler
.
setFormatter
(
formatter
)
...
...
nrm/subprograms.py
View file @
c8ea2ffd
...
...
@@ -118,6 +118,7 @@ class NodeOSClient(object):
for envname, envval in environ.items()]
cmd += " env:'"+"
".join(env)+"'"
args.append(cmd)
logger.debug(args)
return process.Subprocess(args, stdin=process.Subprocess.STREAM,
stdout=process.Subprocess.STREAM,
stderr=process.Subprocess.STREAM)
...
...
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