WIP runner

This commit is contained in:
Quentin 2021-12-07 17:29:16 +01:00
parent eacb73340c
commit c016ccdffa
Signed by: quentin
GPG key ID: A98E9B769E4FF428
3 changed files with 28 additions and 11 deletions

View file

@ -2,6 +2,7 @@
import yaml, os, sys, time, pathlib, unshare, socket, shutil import yaml, os, sys, time, pathlib, unshare, socket, shutil
STORAGE_PATH = os.path.join(os.getcwd(), '.minio-testnet') STORAGE_PATH = os.path.join(os.getcwd(), '.minio-testnet')
#STORAGE_PATH = os.path.join('/mnt/windows', '.minio-testnet')
MINIO_PATH = '/srv' MINIO_PATH = '/srv'
HOSTS_PATH = os.path.join(STORAGE_PATH, 'hosts.txt') HOSTS_PATH = os.path.join(STORAGE_PATH, 'hosts.txt')
UNIX_SOCK = os.path.join(STORAGE_PATH, 'deploy.sock') UNIX_SOCK = os.path.join(STORAGE_PATH, 'deploy.sock')
@ -31,11 +32,8 @@ def leader():
gen_hosts(ips) gen_hosts(ips)
[ co.send(f"{n_serv}\n".encode()) for co in fl ] [ co.send(f"{n_serv}\n".encode()) for co in fl ]
os.system(f"mount --bind {HOSTS_PATH} /etc/hosts") mount_hosts()
mount_disk()
data_path = DATA_PATH(os.environ['ID'])
os.makedirs(data_path)
os.system(f"mount --bind {data_path} {MINIO_PATH}")
run_minio(n_serv) run_minio(n_serv)
@ -53,16 +51,18 @@ def follower():
sock.send(f"{os.environ['IP']}\n".encode()) sock.send(f"{os.environ['IP']}\n".encode())
n_serv = int(co.readline()) n_serv = int(co.readline())
os.system(f"mount --bind {HOSTS_PATH} /etc/hosts") mount_hosts()
mount_disk()
data_path = DATA_PATH(os.environ['ID'])
os.makedirs(data_path)
run_minio(n_serv) run_minio(n_serv)
def run_minio(count): def run_minio(count):
#print("minio server --console-address ':9001' --address [" + os.environ['IP'] + "]:9000 http://minio{1.."+str(count)+"}"+MINIO_PATH+" > "+ STORAGE_PATH + "/minio."+ os.environ['ID'] +".log 2>&1") cmd = f"minio server --console-address ':9001' --address [{os.environ['IP']}]:9000"
os.system("minio server --console-address ':9001' --address [" + os.environ['IP'] + "]:9000 http://minio{1.."+str(count)+"}"+MINIO_PATH+" > "+ STORAGE_PATH + "/minio."+ os.environ['ID'] +".log 2>&1") for i in range(1,count+1):
cmd += f" http://minio{i}:9000{DATA_PATH(i)}"
cmd += f" > {os.path.join(STORAGE_PATH, 'minio'+os.environ['ID']+'.log')} 2>&1"
os.system(cmd)
print("done: ", cmd)
def gen_hosts(ips): def gen_hosts(ips):
with open(HOSTS_PATH, 'w') as f: with open(HOSTS_PATH, 'w') as f:
@ -75,4 +75,11 @@ def n_servers():
n_servers = len(netw['servers']) n_servers = len(netw['servers'])
return n_servers return n_servers
def mount_disk():
data_path = DATA_PATH(os.environ['ID'])
os.makedirs(data_path)
def mount_hosts():
os.system(f"mount --bind {HOSTS_PATH} /etc/hosts")
__name__ == '__main__' and main() __name__ == '__main__' and main()

7
instrumented/minio-runner.sh Executable file
View file

@ -0,0 +1,7 @@
#!/bin/bash
export ENDPOINT=[fc00:9a7a:9e::1]:9000
export AWS_ACCESS_KEY_ID=minioadmin
export AWS_SECRET_ACCESS_KEY=minioadmin
/home/quentin/go/bin/s3lat | tee 50ms.minio.csv

View file

@ -8,6 +8,9 @@ cert=/tmp/garage.pem" tcp4-connect:localhost:3900 &
sleep 1 sleep 1
export SSL=1
export SSL_INSECURE=1
export REGION=garage
export ENDPOINT=localhost:4443 export ENDPOINT=localhost:4443
export AWS_ACCESS_KEY_ID=GK4ea45d2f25091883071e0b73 export AWS_ACCESS_KEY_ID=GK4ea45d2f25091883071e0b73
export AWS_SECRET_ACCESS_KEY=334f7b0ef233571c67b302c5197e6b8c7150da1907e4e530caa82e041d725ecf export AWS_SECRET_ACCESS_KEY=334f7b0ef233571c67b302c5197e6b8c7150da1907e4e530caa82e041d725ecf