Pull from Git (Utility)

Pulling form Git

Pre-requisite:

  • The user needs to do Admin configuration with an authentication token.

  • The user also needs to do Project level- configuration of Git Project and Git branch.

Please Note: the user can generate an authentication token from their Git Lab or Git Hub repositories.

Admin Level Configuration

Check out the given illustration to understand the Admin configuration part with authentication token under the platform.

  • Navigate to the Admin module.

  • Open the Version Control from the Configuration options.

  • Select the Token type as private token.

  • Provide the authentication token in the given space.

  • Click the Test option.

  • A notification message appears to inform the user that authentication has been established.

  • Click the Save option.

  • A notification message appears to inform that the version control has been updated.

Pulling Git file in Utility

Projects and Branches created in GitLab/GitHub can be accessed using the access token inside the DS Lab and the files (.ipynb) can be pulled using the Pull from Git functionality.

Once the initial pull (import) has happened, user can pull the latest version of the Python file from Git using Pull from VCS functionality available in the Notebook List.

A Pulled utility file can be imported in the Data Science Notebooks.

Please Note: Only .py files will be supported.

Check out the given illustration about pulling a utility file from Git repository.

Steps to pull a latest Utility file from Git

  • Navigate to the Project list.

  • Select an activated project.

  • Click the project to open it.

  • Navigate to the Utility tab for the selected Project.

  • Click the Add Script option.

  • Select the Pull from Git option.

  • All the available files will list.

  • Select a file using the check box.

  • Click the Save option.

  • The selected file gets pulled.

  • The same is notified by a message.

  • Click the Edit icon for the pulled file.

  • The utility script content opens.

  • Navigate back to the Utility list page.

  • Click the Pull from VCS icon.

  • The Pull from Git dialog box appears.

  • Click the Yes option.

  • A notification message appears to inform the user that the latest version has been pulled.

  • Navigate to the Git repository.

  • Access the same utility file from the repository.

  • Click the Edit option.

  • The script opens in the Editable format. Modify the script.

  • Click the Commit changes option.

  • A notification message appears to ensure that your changes are successfully committed.

  • Navigate to the Utility tab and click the Pull from VCS icon for the same utility file.

  • The Pull from Git dialog box opens.

  • Click the Yes option.

  • A notification message appears to ensure that the latest version is pulled.

  • The utility script content will reflect the committed changes done in the Git repository.

  • Click the Validate option.

  • The Logs section will notify whether the script is valid.

  • The Update option gets enabled, click it.

  • A notification message appears to inform the user that the script is updated.

Pushing to Git

Push Pre-requisites

Pre-requisites:

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

  2. The User token has to be set in the user profile using Custom Fields setting available in the Admin level.

  3. The user token key name has to be 'bdbvcstoken'.

  • Navigate to the Admin module.

  • Open the Custom Field Settings under the configurations option.

  • The Custom Field Information appears.

  • Provide the following information for custom field:

    • Key- bdbvcstoken

    • Input type - Manual

    • Description - Git User Token

    • Mandatory - No

  • Click the Save option to save the modified Custom Field Settings.

  • A notification message appears to inform the user that the custom field settings are updated.

  • Navigate to the Security module.

  • Go to the Users list.

  • Select the user from the list.

  • Click the Edit icon.

  • The Update User page opens.

  • Check out the Custom Fields section.

  • Validate whether the Git User Token is valid or not. If not provide the valid Git User Token.

  • Click the Save option.

  • A notification message appears to inform that the user is updated successfully.

  • Open the User Profile.

  • Select the My Account option.

  • The My Account details get displayed.

  • Open the Configuration option.

  • The same token gets updated under the Git Token section which was provided under the Configuration section.

Pushing a Utility File to Git

A user can make the changes in the pulled Python file and Push it into Git using the user token set in the user profile.

Please Note: Before using the Push a utility file to Git functionality make sure that the following requirements are fulfilled:

  1. The latest file is pulled into DS Lab before modifying and pushing back to the Git branch.

  2. The user should have access to the Git branch for pushing a change.

  • Open an activated Project.

  • Navigate to the Utility tab.

  • Select a Utility script from the displayed list.

  • Click the Edit icon.

  • The Utility Script Content opens.

  • Modify the Utility script content.

  • Click the Validate option.

  • The Logs will confirm the validity of the script.

  • The Update option gets enabled, click it.

  • A notification message appears to ensure that the utility script is updated.

  • Click the Push into Git icon for the updated utility script.

  • The Push into Git dialog box appears.

  • Provide the Commit Message.

  • Click the Push option.

  • A notification message appears to confirm that the latest file version is pushed to the Git.

  • Navigate to the Git Repository.

  • A message appears to assure that your changes are successfully committed.

  • Open the latest version of the file. In this case, it is V2.

  • You can see the latest committed changes in the script.

  • Click the Edit option.

  • The script opens in the Edit file mode.

  • Edit the script content.

  • Click the Commit changes option.

  • A notification message appears to ensure that the changes are successfully committed.

  • Navigate to the Utility list and click the Push icon for the same utility file.

  • A warning message appears to inform that the file does not contain the latest updates, so the user needs to pull the latest version from the Git.

Please Note: Refer the Data Science Lab Quick Start Flow page to get an overview of the Data Science Lab module in nutshell.

Last updated