Isabl Settings

Each component of Isabl can be configured in multiple ways. Generally, settings are strings, numbers, objects, and many other types.

Import Strings point to an importable object, whether its a class, a function, etc. (e.g.isabl_cli.data.DataImporter)

Database Managed Settings

Some Isabl API, Isabl Web, and Isabl CLI and be configured from the admin site! To do so, go to /admin/isabl_api/client/ and update the clients called default-backend-settings for Isabl API, and default-frontend-settings for Isabl Web. You may want to create your own client for Isabl CLI (see Writing Applications).

Isabl API Settings

Here is a detailed list of available configurations for Isabl API. To configure Isabl API, add a dictionary called ISABL_SETTINGS to your Django configuration.

Learn more about production deployment:

Loading results from a AWS S3 bucket

If your Isabl CLI BASE_STORAGE_DIRECTORY is located in a S3 bucket, you can enable rendering results through the website using the S3_BASE_STORAGE_DIRECTORIES setting:

"S3_BASE_STORAGE_DIRECTORIES": {
    "/base/path/in/output-file": {
        "bucket": "an-S3-bucket-name",
        "access_key": "The AWS Access Key",
        "access_key": "The AWS Access Key",
        "base_directory": "/base/path/in/s3/object",
        "prefer_original": false
    }
}

For example if an analysis output path is /mnt/data/analyses/01/01/1/head_job.log and and the s3 path to it is s3://my-bucket/data/analyses/01/01/1/head_job.log you should use this setting:

"S3_BASE_STORAGE_DIRECTORIES": {
    "/mnt/data/": {
        "bucket": "my-bucket",
        "base_directory": "/data/",
        ...
    }
}

if prefer_original is set to True (False by default), it will try to retrieve the original path first if exists (i.e. /mnt/data/analyses/01/01/1/head_job.log) , if not it will try to resolve for the file in S3 (i.e. s3://my-bucket/data/analyses/01/01/1/head_job.log)

Integrating with Jira

Isabl provides a simple integration to Jira, as it's a widely used management tool used for development and analyses. The module creates a Jira Epic for each Isabl project, and allows to create a simple list of tasks (Jira issues) from the web.

To enable, you need to add the following settings in the web and in the api.

In the Web Settings:

index.html
window.$isabl = {
    ...
    jira: true
}

In the Api Settings:

In Jira for Epic and Issues we can create custom fields. You need to create 2 custom fields where the Project ID and the Project Link will be stored, and use their ids in the settings.

"JIRA_SETTINGS": {
    "active": True,
    "default": {
        "URL": "https://my-jira-instance",
        "AUTH": ("jira-username", "secret-jira-password"),
        "PROJECT_KEY": "ISABL",
        "URL_FIELD": "customfield_id_1",
        "PROJECT_FIELD": "customfield_id_2",
    }
},

Pro Tip: Jira Epics are created under Jira Projects. You can create different Jira Projects for each Isabl Project Group, by adding extra dictionaries that map to isabl group acronyms.

i.e. If a group in Isabl is called (name: Pathology, acronym: PATH), you can set up your settings like the example below. And all Isabl Projects that belong to the PATHOLOGY group, will have their own separate Jira Project under https://my-jira-instance/projects/PATH/issues/

"JIRA_SETTINGS": {
    "active": True,
    "default": {
        "URL": "https://my-jira-instance",
        "AUTH": ("jira-username", "secret-jira-password"),
        "PROJECT_KEY": "ISABL",
        "URL_FIELD": "customfield_id_1",
        "PROJECT_FIELD": "customfield_id_2",
    },
    "PATH": {
        "URL": "https://my-jira-instance",
        "AUTH": ("jira-username", "secret-jira-password"),
        "PROJECT_KEY": "PATH",
        "URL_FIELD": "customfield_id_1",
        "PROJECT_FIELD": "customfield_id_2",
    }
},

Isabl CLI Settings

Before anything, you must set the following environment variables:

# you need to let Isabl CLI where the API is being hosted
export ISABL_API_URL='your-isabl-instance.org/api/v1/'

# you can create a client object in from the django admin
export ISABL_CLIENT_ID=<insert-client-primary-key-or-slug>

Once this is set, you can configure your client object settings with the following configurations (see isabl_cli.settings to check default settings):

Isabl Web Settings

Customization of the User Interface can be achieved by defining a global $isabl settings dictionary in the main index.html.

<script>
    window.$isabl = { }
</script>

You can configure the window.$isabl with the following parameters:

Example of a custom UI configuration

<script>
    const customFields = {
        // overwrite 2 of the fields of the analysis panel
        analysisFields: {
            // Add a new formatter for status
            status: {
                section: 'Analysis Details',
                verboseName: 'Status',
                field: 'status',
                formatter: value => {
                    if (value === 'SUCEEDED') {
                        return 'DONE!'
                    } else if (value === 'FAILED') {
                        return 'OOPS...'
                    } else {
                        return value
                    }
                }
            },
            // Make notes not editable
            notes: {
                section: 'Analysis Details',
                verboseName: 'Notes',
                field: 'notes',
                editable: false
            }
        },
        // display a new custom field for project that exist in the db.
        // Use http://<api-host>/admin/ to create custom fields.
        projectFields: {
            // custom field
            irbConstent: {
              section: 'Project Details',
              verboseName: 'IRB Consent',
              field: 'custom_fields.irb_consent',
              editable: true,
              apiPermission: 'change_project'
            }
          }
        }
    }

    window.$isabl = {
        apiHost: "http://my.isabl.api.host",
        name: "My Cool App",
        logo: "/path/to/my/awesome/logo",
        customFields,
        restartButton: true,
        jira: true,
        oncoTree: true,
        darkTheme: {
          primary: '#1dc5a7',
          background: '#1a202c',
          surface: '#3a4556',
          accent: '#4a5568'
        },
        modelIcons: {
          project: 'insert_chart',
          analysis: 'bubble_chart',
          individual: 'person',
          sample: 'gesture',
          experiment: 'flash_on',
          search: 'search',
          submission: 'assignment'
        },
    }
</script>

Important: In case you're running your frontend instance in a different host that the backend, you should add this ENV variable to your django project where the isabl-api is running:

export FRONTEND_URL="http://your-frontend-host.com"

If you want to consume isabl-web and serve your own html, outside of isabl-api. You can consume the frontend just as:

index.html
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport" content="width=device-width,initial-scale=1">
        <meta charset="UTF-8">
        <link href='https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Material+Icons' rel="stylesheet" type="text/css">
        <link rel="icon" href="favicon.ico">
        <title>My Awesome App</title>
    </head>
    <body>

 <div id="isabl-web"></div>
        <script src="https://cdn.jsdelivr.net/npm/vue"></script>
        <script src="https://cdn.jsdelivr.net/npm/isabl-web"></script>
        <script>
            window.$isabl = {
                apiHost: "http://my.isabl.api.host",
                //... other settings
            }
        </script>
    </body>
</html>

Last updated