Skip to content

Custom Models GitHub integration

Custom Models is a feature that allows users to deploy arbitrary user models into DataRobot. Custom Models GitHub integration provides a convenient way to upload model sources from remote repositories.

The GitHub integration is done via a GitHub application, see https://docs.github.com/en/developers/apps/about-apps.

GitHub Configuration

Configuration to support GitHub happens in two locations, in the customer's GitHub account and then in DataRobot.

Register a new application

Go to https://github.com/settings/apps/new and register a new GitHub application using the configurations from the table below:

Property Value
Name Enter arbitrary name. Name must be unique, up to 34 characters
Homepage URL https://datarobot.com
User authorization callback URL


http://[APP SERVER FQDN OR IP]/account/github/authz_return

Note: use the "HTTPS" protocol only if it is enforced in the current DataRobot installation
Expire user authorization tokens


OFF

Note: it's the new GitHub's Beta feature and is not yet supported by DataRobot
Request user authorization (OAuth) during installation ON
Redirect on update ON
Webhook - “Active”` OFF
Repository Permissions Set to "Read-Only": 1) Contents and 2) Metadata
Where can this GitHub App be installed Any account

Press "Create GitHub App" and copy following properties from the next page: * Client ID * Client secret * Public Link - copy only an application name slug part of a URL. For example:

Public link Application name slug
https://github.com/apps/datarobot-user-models-test datarobot-user-models-test

IMPORTANT: Application ownership must be transferred to a user/organization responsible for managing access to organization's GitHub repositories. Read the documentation: https://docs.github.com/en/developers/apps/transferring-ownership-of-a-github-app




DataRobot settings

To configure these option, please do next steps:

  • The Client ID, Client Secret and App Name Slug should be set as corresponding values of the custom-model-github-secret k8s secret:

data:
  CUSTOM_MODEL_GITHUB_OAUTH_CLIENT_ID: <base64 encoded Client Id>
  CUSTOM_MODEL_GITHUB_OAUTH_CLIENT_SECRET: <base64 encoded Client Secret>
  CUSTOM_MODEL_GITHUB_APP_NAME: <base64 encoded Application name slug>
* Update secret datarobot-secrets by adding new record with base64 encoded schema to properly handle new values:

data:
  custom-model-github.json: ewogICJDVVNUT01fTU9ERUxfR0lUSFVCX09BVVRIX0NMSUVOVF9JRCI6IHsKICAgICJlbnYiOiAiQ1VTVE9NX01PREVMX0dJVEhVQl9PQVVUSF9DTElFTlRfSUQiCiAgfSwKICAiQ1VTVE9NX01PREVMX0dJVEhVQl9PQVVUSF9DTElFTlRfU0VDUkVUIjogewogICAgImVudiI6ICJDVVNUT01fTU9ERUxfR0lUSFVCX09BVVRIX0NMSUVOVF9TRUNSRVQiCiAgfSwKICAgICJDVVNUT01fTU9ERUxfR0lUSFVCX0FQUF9OQU1FIjogewogICAgImVudiI6ICJDVVNUT01fTU9ERUxfR0lUSFVCX0FQUF9OQU1FIgogIH0KfQo=

Decoded base64 value:

{
  "CUSTOM_MODEL_GITHUB_OAUTH_CLIENT_ID": {
    "env": "CUSTOM_MODEL_GITHUB_OAUTH_CLIENT_ID"
  },
  "CUSTOM_MODEL_GITHUB_OAUTH_CLIENT_SECRET": {
    "env": "CUSTOM_MODEL_GITHUB_OAUTH_CLIENT_SECRET"
  },
    "CUSTOM_MODEL_GITHUB_APP_NAME": {
    "env": "CUSTOM_MODEL_GITHUB_APP_NAME"
  }
}

  • Mount the secret to the mmapp-app deployment:
env:
  - name: CUSTOM_MODEL_GITHUB_OAUTH_CLIENT_ID
    valueFrom:
      secretKeyRef:
        key: CUSTOM_MODEL_GITHUB_OAUTH_CLIENT_ID
        name: custom-model-github-secret
  - name: CUSTOM_MODEL_GITHUB_OAUTH_CLIENT_SECRET
    valueFrom:
      secretKeyRef:
        key: CUSTOM_MODEL_GITHUB_OAUTH_CLIENT_SECRET
        name: custom-model-github-secret
  - name: CUSTOM_MODEL_GITHUB_APP_NAME
    valueFrom:
      secretKeyRef:
        key: CUSTOM_MODEL_GITHUB_APP_NAME
        name: custom-model-github-secret