Skip to content

Custom Models GitLab integration

Custom Models is a feature that allows users to deploy arbitrary user models into DataRobot. 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 is 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, please 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