Skip to content

Integrate custom models with a Git provider

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

GitHub

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:

プロパティ
名前 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's enforced in the current DataRobot installation
Expire user authorization tokens


OFF

Note: it's the new GitHub's Beta feature and isn't 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. 例:

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, 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 

GitLab

Custom Models GitLab integration provides a convenient way to upload model sources from remote repositories hosted on GitLab.

The GitLab integration is done via a GitLab application. See the official documentation: https://docs.gitlab.com/integration/oauth_provider/

GitLab configuration

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

Register a new application

Go to your GitLab instance (for example, https://gitlab.com or your self-hosted GitLab) and register a new application using the configurations from the table below:

プロパティ
名前 Enter arbitrary name. Name must be unique.
Redirect URI http://[APP SERVER FQDN OR IP]/account/gitlab/authz_return

Note: use the "HTTPS" protocol only if it's enforced in the current DataRobot installation
スコープ read_api and read_repository
Confidential ON

Press "Save application" and copy the following properties from the next page: * Application ID * Secret

IMPORTANT: Application ownership must be assigned to a user or group responsible for managing access to the organization's GitLab repositories. Refer to the GitLab documentation for details: https://docs.gitlab.com/integration/oauth_provider/

DataRobot settings

To configure these option, do next steps:

  • The Client ID and Client Secret should be set as corresponding values of the custom-model-gitlab-secret k8s secret:
data:
  CUSTOM_MODEL_GITLAB_OAUTH_CLIENT_ID: <base64 encoded Client Id>
  CUSTOM_MODEL_GITLAB_OAUTH_CLIENT_SECRET: <base64 encoded Client Secret> 
  • Update secret datarobot-secrets by adding new record with base64 encoded schema to properly handle new values:
data:
  custom-model-gitlab.json: ewogICJDVVNUT01fTU9ERUxfR0lUTEFCX09BVVRIX0NMSUVOVF9JRCI6IHsKICAgICJlbnYiOiAiQ1VTVE9NX01PREVMX0dJVExBQl9PQVVUSF9DTElFTlRfSUQiCiAgfSwKICAiQ1VTVE9NX01PREVMX0dJVExBQl9PQVVUSF9DTElFTlRfU0VDUkVUIjogewogICAgImVudiI6ICJDVVNUT01fTU9ERUxfR0lUTEFCX09BVVRIX0NMSUVOVF9TRUNSRVQiCiAgfQp9 

Decoded base64 value:

{
  "CUSTOM_MODEL_GITLAB_OAUTH_CLIENT_ID": {
    "env": "CUSTOM_MODEL_GITLAB_OAUTH_CLIENT_ID"
  },
  "CUSTOM_MODEL_GITLAB_OAUTH_CLIENT_SECRET": {
    "env": "CUSTOM_MODEL_GITLAB_OAUTH_CLIENT_SECRET"
  }
} 

  • Mount the secret to the mmapp-app deployment:
env:
    - name: CUSTOM_MODEL_GITLAB_OAUTH_CLIENT_ID
      valueFrom:
        secretKeyRef:
          key: CUSTOM_MODEL_GITLAB_OAUTH_CLIENT_ID
          name: custom-model-gitlab-secret
    - name: CUSTOM_MODEL_GITLAB_OAUTH_CLIENT_SECRET
      valueFrom:
        secretKeyRef:
          key: CUSTOM_MODEL_GITLAB_OAUTH_CLIENT_SECRET
          name: custom-model-gitlab-secret