clean up start

This commit is contained in:
Steven Silvester 2021-12-10 15:39:48 -06:00
parent dc0316512f
commit 254036e7d2
2 changed files with 17 additions and 15 deletions

View File

@ -1,13 +0,0 @@
VERSION=`cat VERSION`
PORT=`cat PORT`
MONGODB_BIN=`m bin $VERSION`
mlaunch init --replicaset --name repl0 --nodes 3 --binarypath \
$MONGODB_BIN --port $PORT --hostname localhost --setParameter \
enableTestCommands=1
mongo
VERSION=`cat VERSION`
PORT=`cat PORT`
MONGODB_BIN=`m bin $VERSION`
CMD="$MONGODB_BIN/mongo mongodb://localhost:$PORT/?replicaSet=repl0"
echo "$CMD"
$CMD

View File

@ -2,11 +2,26 @@
import sys
import shutil
import os
import shlex
import subprocess
HERE = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(HERE, 'VERSION')) as fid:
VERSION = fid.read().strip()
with open(os.path.join(HERE, 'PORT')) as fid:
PORT = fid.read().strip()
# Start the local mongodb as a background task
binder_folder = os.path.join(os.getcwd(), 'binder')
subprocess.check_call(['bash', 'init'], shell=True, cwd=binder_folder)
MONGODB_BIN = subprocess.check_output(['m', 'bin', VERSION]).decode('utf-8').strip()
cmd = ['mlaunch', 'init', '--replicaset', '--name', 'repl0', '--nodes', '3', '--binarypath',
MONGODB_BIN, '--port', PORT, '--hostname', 'localhost', '--setParameter',
'enableTestCommands=1']
print(cmd)
subprocess.check_call(cmd, cwd=HERE)
# Launch Jupyter
argv = sys.argv[1:]