33 Git Integration (Preview)

You can connect your Oracle AI Data Platform instance to ingest, read, and write data to and from external Git repositories.

Git integration in AI Data Platform works by providing login credentials for Git accounts and creating folders that connect to Git repositories with those credentials to ingest data. You can store multiple sets of credentials to connect to different Git repositories or manage different levels of access to the same repositories. Administrators can select a set of credentials as the default profile for users and delete credentials when they're no longer needed.

You can manage your Git files entirely from within AI Data Platform, with utilities that allow you to push, pull, commit, and merge files as well as manage any merge conflicts that arise without having to leave the platform.

AI Data Platform also enables you to branch code from your Git repository as well as switch, merge, compare, and delete branches.

Note:

AI Data Platform currently supports Git repositories hosted on public Git providers such as GitHub, GitLab, Bitbucket, and Oracle Cloud Infrastructure DevOps. Support for Git hosted on customer private networks will be available in a future update.

Git Folders in Oracle AI Data Platform (Preview)

Git folders in Oracle AI Data Platform allow you to interact with data hosted in a Git repository without leaving the platform.

Git folders are created in your Master Catalog using credentials you set up in your AI Data Platform settings. You connect your folder to a Git repository and use the AI Data Platform UI to push, pull, merge, rebase, and reset files in your repository.

You can manage RBAC permissions for your Git folder to control who can see the folder and what Git operations they are able to perform. For more information, see Git Folder Permissions (Preview).

Cone Pattern Rules (Preview)

Sparse checkouts of Git content in Oracle AI Data Platform support Cone mode.

The sparse-checkout command in Git is used to create sparse checkouts, which change the working tree to track a subset of all tracked files. In AI Data Platform, you must use Cone mode when providing directories with the sparse-checkout command. Patterns must represent repository-root-relative folder paths.

Values Allowed by sparse-checkout Cone Pattern

Cone mode allows the following values in patterns when using sparse-checkout:
  • Empty values. Entering an empty value means non-cone mode. The entire repository is cloned.
  • Folder paths relative to repository root:
    • project-a
    • project-a/src
    • notebooks/jobs/
  • Folder names that do no contain any restricted characters (see below)

Values Not Allowed by sparse-checkout Cone Pattern

The following values are not accepted in patterns when using Cone mode for sparse-checkout:
Value Not Allowed Example
Exclusion patterns !src
Non-cone glob syntax *.py, src/[abc], src?
Absolute/rooted path /src, /
Backslashes src\main
Repository root marker ., ./
Leading ./ ./src
Empty path segments src//main
Parent traversal ../src, src/../main
Leading dash -src
Control characters e.g. new lines, carriage returns, null characters

Cone Mode Limits

The following limits apply when using Cone mode for sparse-checkout:

Component Limit
Number of patterns 100 patterns
Length of patterns 1000 characters
Empty patterns Allowed

Git Folder Paths

Git folder paths are validated as a relative path. Each path segment may contain only:
  • Letters: a-z, A-Z
  • Numbers: 0-9
  • Underscore: _
  • Hyphen: -
  • Dot: .
  • Space
  • At sign: @
Valid paths look like this:
  • repo
  • repo.name_test-1@dev
  • folder name
  • jobs/git_provider/TASK1
The following are not allowed for Git paths used with sparse-checkout:
  • Absolute paths
  • Parent traversal
  • Special characters: !, #, $, %, *, ?, [, ], \, :

Create a Git Folder (Preview)

You can create a folder in your Oracle AI Data Platform workspace connected to an external Git repository.

  1. On the home page, navigate to your workspace.
  2. Click Create catalog icon Create then click Git folder. You can also click Add in the top right and click Git folder.
  3. From the Select Git credentials drop-down list, select the Git credentials required to access the Git repository.
  4. Provide the Git repository URL. For example: example.git.path.
  5. Provide a name for the Git folder in your workspace.
  6. Provide the branch from the Git repository to connect to your folder.
  7. Provide sparse checkout cone patterns for the folders you want to clone. Leave this field blank clones the entire repository.
  8. Click Create.

Create a Git Folder for an OCI DevOps Repository (Preview)

You can create a Git folder in Oracle AI Data Platform for a DevOps repository created in Oracle Cloud Infrastructure.

You must have already created the DevOps repository in OCI. For more information, see Creating a Repository.
You must have already created the credentials to access your DevOps project in AI Data Platform. For more information, see Create Credentials (Preview).

Note:

When creating credentials for your DevOps project, your user name should exclude the @tenancyname normally included for DevOps projects. For example, if your DevOps project user name is Acme/oracleidentitycloudservice/alice.jones@acme.com, you user name for your AI Data Platform credentials is Acme/oracleidentitycloudservice/alice.jones.
  1. On the home page, navigate to your workspace.
  2. Click Create catalog icon Create then click Git folder. You can also click Add in the top right and click Git folder.
  3. From the Select Git credentials drop-down list, select the Git credentials required to access the DevOps repository.
  4. Provide the DevOps repository URL. For example, https://<region>.devops.oci.oraclecloud.com/namespaces/<tenancy>/projects/<project>/repositories/<repo>.git.
  5. Provide a name for the DevOps folder in your workspace.
  6. Provide the branch from the DevOps repository to connect to your folder.
  7. Click Create.

Edit Git Folder (Preview)

You can change the name and description for a Git folder in your workspace.

  1. On the home page, navigate to your workspace.
  2. Next to the Git folder want to modify, click Actions three dot icon Actions then click Edit.
  3. Modify the name and description for the folder.
  4. Update the sparse checkout cone pattern rules.
  5. Click Save.

Delete Git Folder (Preview)

You can delete Git folders your own from your workspace.

Deleting a Git folder deletes the folder and any changes that have not been committed and pushed to the repository.
  1. On the home page, navigate to your workspace.
  2. Next to the Git folder want to modify, click Actions three dot icon Actions then click Delete.
  3. Click Delete.

Modify Git Folder Settings (Preview)

You can modify the credentials and repository URL used by a Git folder in your workspace.

  1. On the home page, navigate to your workspace.
  2. Click the Git folder you want to modify settings for.
  3. Click the Settings tab.
  4. From the drop-down list, select the new credentials for the Git folder.
  5. Enter the new Git repository URL.
  6. Click Save.

View Git Folder History (Preview)

You can view the history of commits to your Git folder from the History tab.

  1. Navigate to your Git folder and click the Git tab.
  2. Click the History tab.
  3. Click the Git button to view the history of commits on the Git site.

Create Git Branch (Preview)

You can create new Git branches from existing branches from Git folders in your workspace.

  1. Navigate to your Git folder and click the Git tab.
  2. From the Current branch drop-down list, select the branch you want to base your new branch on.
  3. Click Create Branch.
  4. Provide a name for your new branch,
  5. Click Create.

Delete Git Branch (Preview)

You can delete Git branches from your Git repository from inside your Oracle AI Data Platform workspace.

  1. Navigate to your Git folder and click the Git tab.
  2. From the Current branch drop-down list, select the branch you want to delete.
  3. Click Delete branch.
  4. Select all branches you want to delete.
  5. Optional: Select Force delete regardless of merge status to ignore warnings for any branches that have not been merged.
  6. Click Delete.

Git Pull (Preview)

You can select a branch a perform a Git pull from inside a Git folder in your workspace.

  1. Navigate to your Git folder and click the Git tab.
  2. Click the Pull tab.
  3. From the drop-down list, select the branch you want to pull from.
  4. Click Pull.
  5. Resolve any conflicts.
    • Click Keep local to overwrite with the local version.
    • Click Keep remote to overwrite with the remote version.
    • You can also make your own changes to resolve, then click Mark as resolved.
    • Click Abort pull to cancel the pull request.
  6. Enter a commit message and, optionally, a description for the pull.
  7. Click Commit pull.

Git Push (Preview)

You can select a branch a perform a Git push from inside a Git folder in your workspace.

  1. Navigate to your Git folder and click the Git tab.
  2. Click the Push tab.
  3. Select the files you want to push to the Git repository. Click a file to see the changes in the code window.
  4. Enter a commit message and, optionally, a description for the push.
  5. Click Commit push.

Merge Git Branches into Main (Preview)

You can merge branches back in the main trunk from inside a Git folder in your workspace.

  1. Navigate to your Git folder and click the Git tab.
  2. Click the Merge tab.
  3. From the drop-down list, select the branch you want to merge with the main.
  4. Click Merge.
  5. Resolve any conflicts.
    • Click Keep local to overwrite with the local version.
    • Click Keep remote to overwrite with the remote version.
    • You can also make your own changes to resolve, then click Mark as resolved.
    • Click Abort merge to cancel the merge request.
  6. Enter a commit message and, optionally, a description for the merge.
  7. Click Commit merge.

Git Rebase (Preview)

You can rebase a branch in your Git folder to apply changes from that Git branch to another branch.

Note:

Rebasing a branch requires a force push. Force pushing alters the history on the remote repository and can cause versioning issues for collaborators working on the same repository.
  1. Navigate to your Git folder and click the Git tab.
  2. Click the Rebase tab.
  3. From the Current branch drop-down list, select the branch to rebase.
  4. From the Rebase to branch drop-down list, select the branch to rebase the current branch to.
  5. Select Confirm rebase.
  6. Click Rebase.

Git Reset (Preview)

You can reset a branch in your Git folder to revert the content of that branch to a previous state.

Note:

Resetting a branch requires a force push. Force pushing alters the history on the current branch both locally in your workspace and the remote repository. The history of the branch is deleted and reset to the history of the remote reset branch.
  1. Navigate to your Git folder and click the Git tab.
  2. Click the Reset tab.
  3. From the Current branch drop-down list, select the branch to reset.
  4. From the Choose the remote branch you want the current branch "main" to be reset to drop-down list, select the branch in the remote Git repository to reset the current branch to.
  5. Select Confirm hard reset.
  6. Click Reset.