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
Navigate to the Admin module.
Under the Configurations section, open Custom Field Settings.
The Custom Field Information window appears.
Provide the following details for the custom field:
Key:
bdbvcstoken
Input Type: Manual
Description:
Git User Token
Mandatory: No
Click Save to save the modified Custom Field Settings.
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
Navigate to the Security module.
Go to the Users list.
Select the user from the list whose Git User Token needs to be updated.
Click the Edit icon to open the Update User page.
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.
Click Save to update the user profile.
A notification message will confirm the user update.
Step 3: Update Git User Token in My Account
Navigation path: My Account > Configuration
Open the User Profile page.
Select My Account.
The My Account details will be displayed.
Open the Configuration section.
The Git User Token will be updated in the Git Token section under Configuration.
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.
Admin-Level Git Configuration for Pulling Utility Files
Navigate to the Admin module in the platform.
Open the Version Control section under Configuration options.
Select the Token Type as Private Token.
Enter the authentication token in the provided field.
Click Test to verify the connection.
A confirmation notification will appear if the authentication is successful.
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
Navigate to the Workspace tab in Data Science Lab.
Select the Repo Sync Project and go to the Utils folder.
Click the Elipsis (three-dot) icon next to the Repo folder.
In the Context Menu, select Import.
In the Import Utility File window, select Pull from Git.
Select the utility file you wish to pull by checking the checkbox next to the file.
Click Save to pull the file from the Git repository.
A confirmation notification will appear, ensuring the selected file has been pulled and saved in the Utils folder.
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
Navigate to the Workspace tab in Data Science Lab.
Open the Utils folder and locate the modified utility file.
Click the Elipsis (three-dot) icon next to the utility file.
In the Context Menu, select Push to Git.
The Push to Git drawer will open.
Provide a commit message describing the changes made.
Click Push to update the Git repository with the latest file version.
A confirmation notification will appear once the file has been successfully pushed to Git.
Copying the Path of a Utility File
Navigation path: Data Science Lab > Project > Workspace > Repo Folder/ Utils Folder > Elipsis > Copy Path
Navigate to the Workspace tab in Data Science Lab.
Open the Utils folder and locate the utility file you want to copy the path for.
Click the Elipsis (three-dot) icon next to the utility file.
From the Context Menu, select Copy Path.
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
Navigate to the Workspace tab in Data Science Lab.
Open the Utils folder and select the utility file you wish to delete.
Click the Elipsis (three-dot) icon next to the file.
From the Context Menu, select Delete.
A Delete Utility File dialog box will appear, confirming the action.
Click Yes to confirm deletion.
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
Navigate to the Workspace tab in Data Science Lab.
Open the Utils folder and select the utility file for which you want to view details.
Click the Elipsis (three-dot) icon next to the file.
From the Context Menu, select Information.
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).