Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/add Syftbox install comand #25

Merged
merged 22 commits into from
Oct 11, 2024
Merged

Conversation

IonesioJunior
Copy link
Member

@IonesioJunior IonesioJunior commented Oct 3, 2024

Creates a syftbox app install command.

Acceptance Criteria:

Features:

  • Must install and run a new app with its settings.
  • Handle gracefully if git isn't installed.
  • Handle gracefully if repository doesn't exist.
  • Handle gracefully if config.json doesn't exist.
  • Handle gracefully if config.json version isn't compatible.
  • Handle gracefully if pre-install returns an error.
  • Handle gracefully if post install returns an error.
  • Handle gracefully if run returns an error.
  • Update ~/.syftbox/apps.json.

Tests:

  • Test Handling gracefully if git isn't installed.
  • Test Handling gracefully if config.json version isn't compatible.
  • Test Handling gracefully if repository doesn't exist.
  • Test Handling gracefully if config.json doesn't exist.
  • Test Handling gracefully if pre-install returns an error.
  • Test Handling gracefully if post install returns an error.
  • Test Handling gracefully if run returns an error.

CODE QUALITY GUIDELINES:

  • NO unecessary print statements.
  • Documented code.

Adds a submodule to perform syftbox install <app repository>
syftbox CLI will use app_manager to install app repositories
@iamtrask
Copy link
Member

iamtrask commented Oct 3, 2024

watched the video - compelling idea

IonesioJunior and others added 20 commits October 8, 2024 10:17
app command will be responsible for installing and managing new syftbox apps
Add a utils.py source file to share common variables/functions in the module
Handle when SYFT_CLIENT_CONFIG_PATH exception when the env var isn't set
…constant, move shared function to utils.py

The base_path constant isn't required anymore, instead we must use the get_config_path
…app installation workflow

This app.json will be responsible to keep track of which apps are installed and up to date
…wn interval schedule defined by their app.json config file

Most of apps will have different requirements in terms of refresh rate. To achieve that, we must empower the app config to tell the system how often they must run.
… them properly

Cover use cases where the given repository path doesn't exist / app.json is invalid or isn't found
…unction

During development process i turned off this function to track app installation.
- added support for full github urls
- added version command
- added debug command
- added just app
- added just install


def test_clone_invalid_repository():
path = "InvalidUser/InvalidRepo"
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this is printing that you need to enter a github user because its not a valid url? Maybe it thinks its private?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Screenshot 2024-10-11 at 12 28 15 pm



def test_load_app_config():
valid_json_config = {
Copy link
Collaborator

Choose a reason for hiding this comment

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

iv made this optional for now and i think we can continue to iterate on how it would work

@madhavajay madhavajay marked this pull request as ready for review October 11, 2024 02:29
@madhavajay madhavajay self-requested a review October 11, 2024 02:29
Copy link
Collaborator

@madhavajay madhavajay left a comment

Choose a reason for hiding this comment

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

This is great work. Iv made some changes and tested it so we can use it to remove the default app copier from syftbox for now.

We can continue to iterate on it as we go.

@madhavajay madhavajay merged commit d30fd73 into main Oct 11, 2024
1 of 7 checks passed
@yashgorana yashgorana deleted the feature/add_syftbox_install branch October 11, 2024 06:59
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.

4 participants