Skip to content

✨ Pull components from repo - #131

Merged
AdrySky merged 1 commit into
masterfrom
fahreza/pull-dirs-from-repo
Mar 29, 2022
Merged

AdrySky merged 1 commit into
masterfrom
fahreza/pull-dirs-from-repo

Conversation

@MFA-X-AI

@MFA-X-AI MFA-X-AI commented Mar 29, 2022 •

Copy link
Copy Markdown
Member

Description

This PR improves the xircuits entry point by allowing users to pull xai_components from the base github repository. The old method assumed that users would use venv to install xircuits, which is fragile and will fail when installing on other venvs like conda.

I've made it so that request_folder.py util is also very extendable, which can be used to pull other things users may need such as examples and their own component libraries.

References

#126

Pull Request Type

  • Xircuits Core (Jupyterlab Related changes)
  • Xircuits Canvas (Custom RD Related changes)
  • Xircuits Component Library
  • Testing Automation
  • Documentation
  • Others (Please Specify)

Type of Change

  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Tests

1. Verify successful xai_component pull from repo

  1. Download the wheel from github action
  2. Install it
  3. start xircuits with xircuits, accept to download xai_components when prompted
  4. Verify that .xircuits and xai_components exist
  5. Verify that xircuits works as expected

Tested on?

  • Windows
  • Linux Ubuntu
  • Centos
  • Mac
  • Others (State here -> xxx )

Notes

There were multiple ways of copying xai_components to user dir that I've considered.

  1. The old way of copying it from the venv installation - This method is the fastest since the operation is just copying, but as mentioned before it's fragile.
  2. Using git clone sparse checkout - Thought it would be cool for the users to be able to update their xai_component folder by git pulling, but it assumes that the user already has git installed.
  3. Getting the zipped repo via download link - wasn't the most elegant solution since it would involve unzipping to a temp folder, moving the folders, then deleting the temp folder and zip.
  4. In the end I settled with PyGithub + raw.githubusercontent, inspired by this repo. It has a nice call repo.get_contents(folder) and we can recursively get the files we need. The performance isn't as good as 1 since it requests multiple times, but it's more solid in terms of implementation.

@MFA-X-AI
MFA-X-AI requested a review from AdrySky March 29, 2022 02:38

@AdrySky AdrySky left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Using git clone sparse checkout - Thought it would be cool for the users to be able to update their xai_component folder by git pulling, but it assumes that the user already has git installed.

Personally, it's a good idea if user can update their /xai_component by fetching from repo.

@AdrySky
AdrySky merged commit a9593bb into master Mar 29, 2022
@AdrySky
AdrySky deleted the fahreza/pull-dirs-from-repo branch March 29, 2022 04:08
@MFA-X-AI MFA-X-AI mentioned this pull request Apr 2, 2025
3 of 15 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants