Example #1
0
def new_experiment(sender, **kwargs):
    instance = kwargs['instance']
    instance.set_status(ExperimentLifeCycle.CREATED)

    # Clean outputs and logs
    delete_experiment_logs(instance.unique_name)
    delete_experiment_outputs(instance.unique_name)

    # Create logs path
    create_experiment_logs_path(instance.unique_name)
Example #2
0
def new_experiment(sender, **kwargs):
    instance = kwargs['instance']
    created = kwargs.get('created', False)

    # Check if the experiment is newly created and that we can start it independently
    if not created:
        return

    instance.set_status(ExperimentLifeCycle.CREATED)

    # Clean outputs and logs
    delete_experiment_logs(instance.unique_name)
    delete_experiment_outputs(instance.unique_name)

    # Create logs path
    create_experiment_logs_path(instance.unique_name)

    if instance.is_independent:
        # Start building the experiment and then Schedule it to be picked by the spawners
        build_experiment.apply_async((instance.id, ), countdown=1)