aiscalator {
    // The folder containing various configuration files for
    // the usage of the aiscalator application.
    app_config_home_directory = ${HOME}/.aiscalator/

    // Configuration of the Jupyter sub-commands of Aiscalator
    jupyter {
        // dockerfile_src is a folder where you define and store available
        // dockerfile options to provide to end-users that are writing their
        // aiscalator's step configuration. The content of this folder
        // affects the choice options of docker_image.input_docker_src
        // in a Step configuration file.
        dockerfile_src = ${aiscalator.app_config_home_directory}/docker

        docker_image {
            // Define some permissions to customize docker images
            // in step configuration files.
            allow_apt_packages = True
            allow_requirements = True
            allow_lab_extensions = True
        }
    } // end of jupyter

    // Configuration of the Airflow sub-commands of Aiscalator
    airflow {
        // the file should be located in ${aiscalator.app_config_home_directory}/config/
        // this is the docker-compose configuration to start the airflow services.
        docker_compose_file = docker-compose-CeleryExecutor.yml

        build_docker_image {
            apt_package_path   = apt_packages.txt
            requirements_path  = requirements.txt
            lab_extension_path = lab_extensions.txt
        }

        setup {
            // when running aiscalator airflow setup,
            // the following workspaces are added to the
            // airflow worker mounted volumes:
            workspace_paths = [ ]
        }
    } // end of airflow

    // logging configuration of the application following the documentation:
    // https://docs.python.org/3/library/logging.config.html#logging-config-dictschema
    logging {
        version = 1
        disable_existing_loggers = False

        formatters {
            simple.format: "%(asctime)s-%(threadName)s-%(name)s-%(levelname)s-%(message)s"
        }

        handlers {
            console_debug {
                class = logging.StreamHandler
                level = DEBUG
                formatter = simple
                stream = ext://sys.stderr
            }

            console_info {
                class = logging.StreamHandler
                level = INFO
                formatter = simple
                stream = ext://sys.stdout
            }

            info_file_handler {
                class = logging.handlers.RotatingFileHandler
                level = INFO
                formatter = simple
                filename = ${aiscalator.app_config_home_directory}/logs/info.log
                maxBytes =  10485760 # 10MB
                backupCount = 20
                encoding = utf8
            }

            error_file_handler {
                class = logging.handlers.RotatingFileHandler
                level = ERROR
                formatter = simple
                filename = ${aiscalator.app_config_home_directory}/logs/errors.log
                maxBytes =  10485760 # 10MB
                backupCount = 20
                encoding = utf8
            }
        }

        root {
            level = INFO
            handlers = [info_file_handler, error_file_handler]
        }

        loggers {
            aiscalator {
                level = DEBUG
                handlers: [console_debug, console_info]
                propagate = no
            }
        }
    } // end of logging

    metadata {
        // Aiscalator's version of when this configuration was produced
        // this is to record the schema of the file at that
        // time in case, it needs to be changed and migrated later.
        since_version = 0.1.1
        // date of when this configuration file was generated.
        created_on = generation_date
        user {
            // A 'cookie' ID used for usage tracking of the app.
            id = testUserID
        }
    }

    timezone = Europe/Paris
}
