Пример #1
0
 def setup(self):
     LinuxContainer.setup(self)
     LinuxContainer.copy_folder(self, 'XcontainerBolt')
     util.tmux_command(self.tmux_name,
                       'lxc-attach --name {0:s}'.format(self.name))
     time.sleep(2)
     BenchmarkContainer.setup(self)
Пример #2
0
 def start(self):
     BenchmarkContainer.start(self)
     time.sleep(10)
     print('starting docker container', self.name)
     #    util.tmux_command(self.tmux_name, "service docker restart")
     util.tmux_command(
         self.tmux_name,
         'docker run --name {0:s} {1:s} -d -i ubuntu /bin/bash'.format(
             self.name, self.cpuset()))
Пример #3
0
 def setup(self):
     util.shell_call('docker stop {0:s}'.format(self.name))
     time.sleep(1)
     self.create_xconfig()
     util.tmux_command(self.tmux_name,
                       'cd /root/experiments/native/compute06/docker')
     util.tmux_command(
         self.tmux_name,
         'python run.py --id {0:s} --ip {1:s} --hvm --name {2:s} --cpu=1'.
         format(DockerContainer.id(self), self.ip(), self.name))
     time.sleep(10)
Пример #4
0
 def benchmark(self):
     args = ''
     if self.metric.startswith('mem') or self.metric.startswith('l3'):
         args = '{0:d} {1:d}'.format(self.duration, self.intensity)
     elif self.metric.startswith('cpu'):
         args = '{0:d}'.format(self.duration)
     else:
         raise Exception('benchmark - not implemented')
     for i in range(self.num_interferences):
         print("Starting 1 interfere", i)
         util.tmux_command(
             self.tmux_name,
             '/home/XcontainerBolt/uBench/src/{0:s} {1:s} &'.format(
                 self.metric, args))
Пример #5
0
 def setup_config(self):
     util.tmux_command(self.docker_tmux_name,
                       'docker exec -it {0:s} /bin/bash'.format(self.name))
     util.tmux_command(self.docker_tmux_name,
                       'truncate -s0 etc/nginx/nginx.conf')
     for line in get_nginx_configuration().split('\n'):
         util.tmux_command(
             self.docker_tmux_name,
             "echo '{0:s}' >> etc/nginx/nginx.conf".format(line))
     util.tmux_command(self.docker_tmux_name, 'exit')
Пример #6
0
 def setup(self):
     LinuxContainer.setup(self)
     LinuxContainer.execute_command(self, 'apt-get install -y memcached')
     util.tmux_command(self.tmux_name,
                       'lxc-attach -n {0:s}'.format(self.name))
     time.sleep(1)
     util.tmux_command(self.tmux_name,
                       Memcached.start_command(self, self.ip()))
     time.sleep(1)
     util.shell_call("lxc-cgroup -n {0:s} cpuset.cpus {1:d}".format(
         self.name, self.processor))
     if self.sameContainer:
         LinuxContainer.copy_folder(self, 'XcontainerBolt')
         self.setup_benchmark()
     ApplicationContainer.setup_port_forwarding(self, self.machine_ip(),
                                                self.port, self.ip(),
                                                self.port, self.bridge_ip())
     ApplicationContainer.benchmark_message(self)
Пример #7
0
 def setup(self):
     NginxDockerContainer.setup_config(self)
     #    if self.sameContainer:
     #      util.shell_call('docker cp XcontainerBolt {0:s}:/home/XcontainerBolt'.format(self.name), True)
     #      NginxDockerContainer.setup_benchmark(self, True)
     util.shell_call("service docker restart")
     XContainer.setup(self)
     NginxDockerContainer.setup_port_forwarding(self, self.machine_ip(),
                                                self.port, self.ip(),
                                                self.port, self.bridge_ip())
     NginxDockerContainer.benchmark_message(self)
     util.tmux_command(
         self.tmux_name,
         "echo 'nameserver 8.8.8.8' | tee /etc/resolv.conf > /dev/null")
     util.tmux_command(self.tmux_name, 'apt-get update')
     time.sleep(20)
     util.tmux_command(self.tmux_name, 'apt-get install -y curl')
     time.sleep(30)
     util.tmux_command(self.tmux_name, "nginx")
     if self.sameContainer:
         BenchmarkContainer.setup(self, False)
         BenchmarkContainer.benchmark(self)
Пример #8
0
 def setup_benchmark(self):
     util.tmux_command(self.tmux_name,
                       'lxc-attach --name {0:s}'.format(self.name))
     BenchmarkContainer.setup(self, False)
Пример #9
0
 def setup_benchmark(self):
     util.tmux_command(
         self.tmux_name,
         'docker exec --user root -it {0:s} /bin/bash'.format(self.name))
     BenchmarkContainer.setup(self, False)
Пример #10
0
 def setup_benchmark(self, useYum=False):
     util.tmux_command(self.tmux_name,
                       'docker exec -it {0:s} /bin/bash'.format(self.name))
     BenchmarkContainer.setup(self, True)
Пример #11
0
    def setup(self, useYum=False):
        command = 'apt-get'
        install = 'apt-get install -y'
        if useYum:
            command = 'yum'
            install = 'yum -y install'
        util.tmux_command(
            self.tmux_name,
            "echo 'nameserver 8.8.8.8' | tee /etc/resolv.conf > /dev/null")
        time.sleep(1)
        util.tmux_command(self.tmux_name, '{0:s} update'.format(command))
        time.sleep(5)
        util.tmux_command(self.tmux_name, '{0:s} git'.format(install))
        time.sleep(40)
        util.tmux_command(self.tmux_name, '{0:s} make'.format(install))
        time.sleep(5)
        util.tmux_command(self.tmux_name,
                          '{0:s} ca-certificates'.format(install))
        time.sleep(8)
        util.tmux_command(self.tmux_name, '{0:s} g++'.format(install))
        time.sleep(100)
        util.tmux_command(
            self.tmux_name,
            'cd /home; git clone https://sj677:d057c5e8f966db42a6f467c6029da686fdcf4bb4@github.coecis.cornell.edu/SAIL/XcontainerBolt.git'
        )
        time.sleep(8)
        util.tmux_command(
            self.tmux_name,
            'cd /home/XcontainerBolt/uBench; truncate -s0 Makefile')
        for line in self.benchmark_makefile().split('\n'):
            util.tmux_command(self.tmux_name,
                              "echo -e '{0:s}' >> Makefile".format(line))
        if False:
            util.tmux_command(
                self.tmux_name,
                'yum -y install libmpc-devel mpfr-devel gmp-devel')
            time.sleep(10)
            util.tmux_command(
                self.tmux_name,
                'curl ftp://ftp.mirrorservice.org/sites/sourceware.org/pub/gcc/releases/gcc-4.9.2/gcc-4.9.2.tar.bz2 -O'
            )
            time.sleep(60)
            util.tmux_command(self.tmux_name, 'tar xvfj gcc-4.9.2.tar.bz2')
            time.sleep(2)
            util.tmux_command(self.tmux_name, 'cd gcc-4.9.2')
            util.tmux_command(
                self.tmux_name,
                './configure --disable-multilib --enable-languages=c,c++')
            time.sleep(5)
            util.tmux_command(self.tmux_name, 'make -j4')
            time.sleep(5)
            util.tmux_command(self.tmux_name, 'make install')
            time.sleep(600)


#    print("making uBench")
        util.tmux_command(self.tmux_name,
                          'cd /home/XcontainerBolt/uBench; make')
        print("sleeping...")
        time.sleep(10)
        print("setting up benchmark")