Exemple #1
0
def build_app(spec, log_dir, preload=False):
    name = spec["name"]
    app = App.get_app(name)
    if app and app.build_state == App.BuildState.BUILDING:
        print("App {} already building. Wait for build to complete before resubmitting.".format(name))
        return
    new_app = App.create(spec)
    try:
        new_app.build(preload=preload)
    except Exception as e:
        # the "catch-all" clause
        print("Could not build app {}: {}".format(new_app.name, e))
        App.index.update_build_state(App.BuildState.FAILED)
Exemple #2
0
def build_app(spec, log_dir, preload=False):
    name = spec["name"]
    app = App.get_app(name)
    if app and app.build_state == App.BuildState.BUILDING:
        print("App {} already building. Wait for build to complete before resubmitting.".format(name))
        return
    new_app = App.create(spec)
    try:
        new_app.build(preload=preload)
    except Exception as e:
        # the "catch-all" clause
        print("Could not build app {}: {}".format(new_app.name, e))
        App.index.update_build_state(App.BuildState.FAILED)
Exemple #3
0
def build_app(spec, log_dir, preload=False):
    name = spec["name"]
    sys.stdout = open(os.path.join(log_dir, name + "-" + str(os.getpid()) + ".out"), "w", buffering=0)
    sys.stderr = open(os.path.join(log_dir, name + "-" + str(os.getpid()) + ".err"), "w", buffering=0)
    app = App.get_app(name)
    print("In build_app")
    if app and app.build_state == App.BuildState.BUILDING:
        print("App {} already building. Wait for build to complete before resubmitting.".format(name))
        return
    new_app = App.create(spec)
    try:
        new_app.build(preload=preload)
    except Exception as e:
        # the "catch-all" clause
        print("Could not build app {}: {}".format(new_app.name, e))
        App.index.update_build_state(App.BuildState.FAILED)
Exemple #4
0
def build_app(spec, log_dir, preload=False):
    name = spec["name"]
    sys.stdout = open(os.path.join(log_dir,
                                   name + "-" + str(os.getpid()) + ".out"),
                      "w",
                      buffering=0)
    sys.stderr = open(os.path.join(log_dir,
                                   name + "-" + str(os.getpid()) + ".err"),
                      "w",
                      buffering=0)
    app = App.get_app(name)
    print("In build_app")
    if app and app.build_state == App.BuildState.BUILDING:
        print(
            "App {} already building. Wait for build to complete before resubmitting."
            .format(name))
        return
    new_app = App.create(spec)
    try:
        new_app.build(preload=preload)
    except Exception as e:
        # the "catch-all" clause
        print("Could not build app {}: {}".format(new_app.name, e))
        App.index.update_build_state(App.BuildState.FAILED)