Example #1
0
def main():
    parser = argparse.ArgumentParser()
    parser.add_argument('--docs', default='docs')
    args = parser.parse_args()

    with open(os.path.join(args.docs, 'CLI-Reference.md'), 'w') as f:
        print(INTRODUCTION, file=f)
        print(indent(Commands.help_text(verbose=True, markdown=True)), file=f)
Example #2
0
    observer.schedule(event_handler, path, recursive=True)
    observer.start()
    try:
        while True:
            time.sleep(10)
    except KeyboardInterrupt:
        observer.stop()
    observer.join()


@Commands.command(
    'server',
    help='Start an instance of a CodaLab bundle service with a REST API.',
    arguments=(
        Commands.Argument(
            '--watch', help='Restart the server on code changes.',
            action='store_true'),
        Commands.Argument(
            '-p', '--processes',
            help='Number of processes to use. A production deployment should '
                 'use more than 1 process to make the best use of multiple '
                 'CPUs.',
            type=int, default=1),
        Commands.Argument(
            '-t', '--threads',
            help='Number of threads to use. The server will be able to handle '
                 '(--processes) x (--threads) requests at the same time.',
            type=int, default=50),
        Commands.Argument(
            '-d', '--debug', help='Run the development server for debugging.',
            action='store_true'),
Example #3
0
def main():
    with open(os.path.join('docs', 'CLI-Reference.md'), 'w') as f:
        print >> f, INTRODUCTION
        print >> f, indent(Commands.help_text(True))
Example #4
0
    observer = Observer()
    observer.schedule(event_handler, path, recursive=True)
    observer.start()
    try:
        while True:
            time.sleep(10)
    except KeyboardInterrupt:
        observer.stop()
    observer.join()


@Commands.command(
    'server',
    help='Start an instance of the CodaLab bundle service.',
    arguments=(Commands.Argument('--watch',
                                 help='Restart the server on code changes.',
                                 action='store_true'), ),
)
def do_server_command(bundle_cli, args):
    if args.watch:
        run_server_with_watch()
    else:
        from codalab.server.bundle_rpc_server import BundleRPCServer
        rpc_server = BundleRPCServer(bundle_cli.manager)
        rpc_server.serve_forever()


@Commands.command(
    'rest-server',
    help='Start an instance of a CodaLab bundle service with a REST API.',
    arguments=(