Commit 07957f98 authored by Jonas Kaufmann's avatar Jonas Kaufmann Committed by Antoine Kaufmann
Browse files

some fixes for pytype errors

parent 1971c11e
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
import asyncio import asyncio
from asyncio.subprocess import Process
import os import os
import pathlib import pathlib
import re import re
...@@ -38,6 +39,9 @@ class HostConfig(object): ...@@ -38,6 +39,9 @@ class HostConfig(object):
self.other = other.copy() self.other = other.copy()
class Component(object): class Component(object):
proc: Process
terminate_future: asyncio.Task[int]
def __init__(self, cmd_parts, with_stdin=False): def __init__(self, cmd_parts, with_stdin=False):
self.is_ready = False self.is_ready = False
self.stdout = [] self.stdout = []
......
...@@ -138,8 +138,10 @@ class DistributedExperiment(Experiment): ...@@ -138,8 +138,10 @@ class DistributedExperiment(Experiment):
return True return True
class ExperimentBaseRunner(object): T = tp.TypeVar('T', bound=Experiment)
def __init__(self, exp: Experiment, env: ExpEnv, verbose: bool):
class ExperimentBaseRunner(tp.Generic[T]):
def __init__(self, exp: T, env: ExpEnv, verbose: bool):
self.exp = exp self.exp = exp
self.env = env self.env = env
self.verbose = verbose self.verbose = verbose
...@@ -304,7 +306,7 @@ class ExperimentBaseRunner(object): ...@@ -304,7 +306,7 @@ class ExperimentBaseRunner(object):
return self.out return self.out
class ExperimentSimpleRunner(ExperimentBaseRunner): class ExperimentSimpleRunner(ExperimentBaseRunner[Experiment]):
""" Simple experiment runner with just one executor. """ """ Simple experiment runner with just one executor. """
def __init__(self, exec: Executor, *args, **kwargs): def __init__(self, exec: Executor, *args, **kwargs):
self.exec = exec self.exec = exec
...@@ -314,7 +316,7 @@ class ExperimentSimpleRunner(ExperimentBaseRunner): ...@@ -314,7 +316,7 @@ class ExperimentSimpleRunner(ExperimentBaseRunner):
return self.exec return self.exec
class ExperimentDistributedRunner(ExperimentBaseRunner): class ExperimentDistributedRunner(ExperimentBaseRunner[DistributedExperiment]):
""" Simple experiment runner with just one executor. """ """ Simple experiment runner with just one executor. """
def __init__(self, execs, *args, **kwargs): def __init__(self, execs, *args, **kwargs):
self.execs = execs self.execs = execs
......
...@@ -533,6 +533,7 @@ class HTTPD(AppConfig): ...@@ -533,6 +533,7 @@ class HTTPD(AppConfig):
threads = 1 threads = 1
file_size = 64 file_size = 64
mtcp_config = 'lighttpd.conf' mtcp_config = 'lighttpd.conf'
httpd_dir: str # TODO added because doesn't originally exist
def prepare_pre_cp(self): def prepare_pre_cp(self):
return ['mkdir -p /srv/www/htdocs/ /tmp/lighttpd/', return ['mkdir -p /srv/www/htdocs/ /tmp/lighttpd/',
...@@ -569,6 +570,7 @@ class HTTPC(AppConfig): ...@@ -569,6 +570,7 @@ class HTTPC(AppConfig):
requests = 10000 requests = 10000
threads = 1 threads = 1
url = '/file' url = '/file'
ab_dir: str # TODO added because doesn't originally exist
def run_cmds(self, node): def run_cmds(self, node):
return ['cd %s/support/' % (self.ab_dir), return ['cd %s/support/' % (self.ab_dir),
......
...@@ -41,6 +41,10 @@ class Simulator(object): ...@@ -41,6 +41,10 @@ class Simulator(object):
"""Memory required for this simulator (in MB).""" """Memory required for this simulator (in MB)."""
return 64 return 64
def full_name(self):
"""Full name of the simulator."""
return ''
def prep_cmds(self, env: ExpEnv) -> tp.List[str]: def prep_cmds(self, env: ExpEnv) -> tp.List[str]:
"""Commands to run to prepare simulator.""" """Commands to run to prepare simulator."""
return [] return []
...@@ -416,6 +420,8 @@ class MultiSubNIC(NICSim): ...@@ -416,6 +420,8 @@ class MultiSubNIC(NICSim):
return 0 return 0
class I40eMultiNIC(Simulator): class I40eMultiNIC(Simulator):
name = ''
def __init__(self): def __init__(self):
self.subnics = [] self.subnics = []
super().__init__() super().__init__()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment