clean up start
This commit is contained in:
parent
dc0316512f
commit
254036e7d2
13
binder/init
13
binder/init
@ -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
|
||||
19
binder/start
19
binder/start
@ -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:]
|
||||
|
||||
Loading…
Reference in New Issue
Block a user