Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ycai
simbricks
Commits
07957f98
Commit
07957f98
authored
Jun 17, 2022
by
Jonas Kaufmann
Committed by
Antoine Kaufmann
Jul 08, 2022
Browse files
some fixes for pytype errors
parent
1971c11e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
4 deletions
+18
-4
experiments/simbricks/exectools.py
experiments/simbricks/exectools.py
+4
-0
experiments/simbricks/experiments.py
experiments/simbricks/experiments.py
+6
-4
experiments/simbricks/nodeconfig.py
experiments/simbricks/nodeconfig.py
+2
-0
experiments/simbricks/simulators.py
experiments/simbricks/simulators.py
+6
-0
No files found.
experiments/simbricks/exectools.py
View file @
07957f98
...
...
@@ -21,6 +21,7 @@
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
import
asyncio
from
asyncio.subprocess
import
Process
import
os
import
pathlib
import
re
...
...
@@ -38,6 +39,9 @@ class HostConfig(object):
self
.
other
=
other
.
copy
()
class
Component
(
object
):
proc
:
Process
terminate_future
:
asyncio
.
Task
[
int
]
def
__init__
(
self
,
cmd_parts
,
with_stdin
=
False
):
self
.
is_ready
=
False
self
.
stdout
=
[]
...
...
experiments/simbricks/experiments.py
View file @
07957f98
...
...
@@ -138,8 +138,10 @@ class DistributedExperiment(Experiment):
return
True
class
ExperimentBaseRunner
(
object
):
def
__init__
(
self
,
exp
:
Experiment
,
env
:
ExpEnv
,
verbose
:
bool
):
T
=
tp
.
TypeVar
(
'T'
,
bound
=
Experiment
)
class
ExperimentBaseRunner
(
tp
.
Generic
[
T
]):
def
__init__
(
self
,
exp
:
T
,
env
:
ExpEnv
,
verbose
:
bool
):
self
.
exp
=
exp
self
.
env
=
env
self
.
verbose
=
verbose
...
...
@@ -304,7 +306,7 @@ class ExperimentBaseRunner(object):
return
self
.
out
class
ExperimentSimpleRunner
(
ExperimentBaseRunner
):
class
ExperimentSimpleRunner
(
ExperimentBaseRunner
[
Experiment
]
):
""" Simple experiment runner with just one executor. """
def
__init__
(
self
,
exec
:
Executor
,
*
args
,
**
kwargs
):
self
.
exec
=
exec
...
...
@@ -314,7 +316,7 @@ class ExperimentSimpleRunner(ExperimentBaseRunner):
return
self
.
exec
class
ExperimentDistributedRunner
(
ExperimentBaseRunner
):
class
ExperimentDistributedRunner
(
ExperimentBaseRunner
[
DistributedExperiment
]
):
""" Simple experiment runner with just one executor. """
def
__init__
(
self
,
execs
,
*
args
,
**
kwargs
):
self
.
execs
=
execs
...
...
experiments/simbricks/nodeconfig.py
View file @
07957f98
...
...
@@ -533,6 +533,7 @@ class HTTPD(AppConfig):
threads
=
1
file_size
=
64
mtcp_config
=
'lighttpd.conf'
httpd_dir
:
str
# TODO added because doesn't originally exist
def
prepare_pre_cp
(
self
):
return
[
'mkdir -p /srv/www/htdocs/ /tmp/lighttpd/'
,
...
...
@@ -569,6 +570,7 @@ class HTTPC(AppConfig):
requests
=
10000
threads
=
1
url
=
'/file'
ab_dir
:
str
# TODO added because doesn't originally exist
def
run_cmds
(
self
,
node
):
return
[
'cd %s/support/'
%
(
self
.
ab_dir
),
...
...
experiments/simbricks/simulators.py
View file @
07957f98
...
...
@@ -41,6 +41,10 @@ class Simulator(object):
"""Memory required for this simulator (in MB)."""
return
64
def
full_name
(
self
):
"""Full name of the simulator."""
return
''
def
prep_cmds
(
self
,
env
:
ExpEnv
)
->
tp
.
List
[
str
]:
"""Commands to run to prepare simulator."""
return
[]
...
...
@@ -416,6 +420,8 @@ class MultiSubNIC(NICSim):
return
0
class
I40eMultiNIC
(
Simulator
):
name
=
''
def
__init__
(
self
):
self
.
subnics
=
[]
super
().
__init__
()
...
...
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