Managing Utility Files

This page describes the various actions you can apply to utility scripts after you import them.

Utility files in the Data Science Lab (DSLab) module can be pulled from and pushed to a Git repository. Users can also manage utility files by copying paths, deleting files, or viewing file details. This process is essential for managing reusable scripts across different projects and ensuring that the latest version of the file is always available for use.

This section outlines how to pull and push utility files from/to Git, manage the file path, delete, and view file details.

Pre-requisties for Pushing a Utility File to Git Repository

This section outlines the process for configuring a Git User Token within the Admin module and updating it in the Security module. The Git User Token is necessary for authenticating and syncing with Git repositories in the Data Science Lab (DSLab).

Step 1: Configure the Custom Field in Admin Module

Navigation path: Admin module > Configurations > Custom Field Settings

  1. Navigate to the Admin module.

  2. Under the Configurations section, open Custom Field Settings.

  3. The Custom Field Information window appears.

  4. Provide the following details for the custom field:

    • Key: bdbvcstoken

    • Input Type: Manual

    • Description: Git User Token

    • Mandatory: No

  5. Click Save to save the modified Custom Field Settings.

  6. A confirmation notification will appear, confirming that the custom field settings have been updated.

Step 2: Update Git User Token in the Security Module

Navigation path: Security module > Users list > Edit User

  1. Navigate to the Security module.

  2. Go to the Users list.

  3. Select the user from the list whose Git User Token needs to be updated.

  4. Click the Edit icon to open the Update User page.

  5. In the Custom Fields section, validate whether the Git User Token is valid.

    • If invalid, provide the valid Git User Token in the corresponding field.

  6. Click Save to update the user profile.

  7. A notification message will confirm the user update.

Step 3: Update Git User Token in My Account

Navigation path: My Account > Configuration

  1. Open the User Profile page.

  2. Select My Account.

  3. The My Account details will be displayed.

  4. Open the Configuration section.

  5. The Git User Token will be updated in the Git Token section under Configuration.

Notes:

  • User Token Key: The key name has to be bdbvcstoken for the Git User Token.

  • Git User Token is necessary for Git repository access within DSLab.

  • The user branch should have Developers' + maintainers' permission to push the latest code into the Main branch.

  • If Git User Token is updated in the Security module, the same token should be used in the User Profile > Configuration > Git Token section.

Pre-requisites for Pulling a Utility File from Git Repository

Before pulling a utility script or an updated version of the utility script from the Git repository, ensure the following steps are completed:

Admin Configuration:

  • The user must have an authentication token configured for accessing Git repositories (GitHub or GitLab).

  • Project-level Git Configuration: The Git Project and Git Branch must be configured at the project level.

Note:

  • The normal Data Science project with the Git branch configured will support the Pull from Git functionality for utility files.

  • Users can generate the authentication token from their GitLab or GitHub repositories.

Admin-Level Git Configuration for Pulling Utility Files

  1. Navigate to the Admin module in the platform.

  2. Open the Version Control section under Configuration options.

  3. Select the Token Type as Private Token.

  4. Enter the authentication token in the provided field.

  5. Click Test to verify the connection.

  6. A confirmation notification will appear if the authentication is successful.

  7. Click Save to update the configuration.

Pulling a Utility File from Git

Navigation path: Data Science Lab > Workspace > Utils Folder > Elipsis > Import > Pull from Git

  1. Navigate to the Workspace tab in Data Science Lab.

  2. Select the Repo Sync Project and go to the Utils folder.

  3. Click the Elipsis (three-dot) icon next to the Repo folder.

  4. In the Context Menu, select Import.

  5. In the Import Utility File window, select Pull from Git.

  6. Select the utility file you wish to pull by checking the checkbox next to the file.

  7. Click Save to pull the file from the Git repository.

  8. A confirmation notification will appear, ensuring the selected file has been pulled and saved in the Utils folder.

Note: Once pulled, the file is available in the Utils folder for editing, modification, or use within notebooks.

Pushing a Utility File to Git

After modifying a utility file, you can push it back to Git. Ensure that the latest version has been pulled before making changes.

Navigation path: Data Science Lab > Project > Workspace > Repo Folder/Utils Folder > Elipsis > Push to VCS

  1. Navigate to the Workspace tab in Data Science Lab.

  2. Open the Utils folder and locate the modified utility file.

  3. Click the Elipsis (three-dot) icon next to the utility file.

  4. In the Context Menu, select Push to Git.

  5. The Push to Git drawer will open.

  6. Provide a commit message describing the changes made.

  7. Click Push to update the Git repository with the latest file version.

  8. A confirmation notification will appear once the file has been successfully pushed to Git.

Note: If the file does not contain the latest version, an error message will prompt you to pull the latest version before pushing.

Copying the Path of a Utility File

Navigation path: Data Science Lab > Project > Workspace > Repo Folder/ Utils Folder > Elipsis > Copy Path

  1. Navigate to the Workspace tab in Data Science Lab.

  2. Open the Utils folder and locate the utility file you want to copy the path for.

  3. Click the Elipsis (three-dot) icon next to the utility file.

  4. From the Context Menu, select Copy Path.

  5. The path is copied to the clipboard and can be pasted into a notebook or elsewhere as needed.

Deleting a Utility File

Navigation path: Data Science Lab > Project > Workspace > Utils Folder > Elipsis > Delete

  1. Navigate to the Workspace tab in Data Science Lab.

  2. Open the Utils folder and select the utility file you wish to delete.

  3. Click the Elipsis (three-dot) icon next to the file.

  4. From the Context Menu, select Delete.

  5. A Delete Utility File dialog box will appear, confirming the action.

  6. Click Yes to confirm deletion.

  7. A confirmation notification will appear, ensuring that the utility file has been deleted successfully.

Viewing Utility File Information

Navigation path: Data Science Lab > Project > Workspace > Utils Folder > Elipsis > Information

  1. Navigate to the Workspace tab in Data Science Lab.

  2. Open the Utils folder and select the utility file for which you want to view details.

  3. Click the Elipsis (three-dot) icon next to the file.

  4. From the Context Menu, select Information.

  5. The following details will be displayed:

    • Description: User-provided description of the utility file.

    • Last Updated: The date and user who last updated the file (for Git-imported files).