Skip to content

init instance class #2

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

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open

init instance class #2

wants to merge 9 commits into from

Conversation

Gahnxd
Copy link

@Gahnxd Gahnxd commented Jun 13, 2025

Description

helix/instance.py

Added the Instance class to manage Helix instances with methods for deployment, status checking, starting, stopping, and deletion. The class handles instance lifecycle management and port mapping, with support for both running and non-running states.

helix/client.py

Enhanced the Client class to integrate with the new Instance class for automatic instance management. The client now handles instance deployment and cleanup.

examples/cookbook/instance_demo.py

Created a demonstration script to test the Instance class. The script performs a sequence of operations (deploy, status check, stop, start, delete) on a Helix instance, providing a practical example of how to use the new class.

examples/cookbook/client_demo.py

Created a demonstration script based on the cookbook example in docs to test the Client class.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Performance improvement
  • Code refactoring
  • Other (please describe):

Testing

  • Unit tests added/updated
  • Integration tests added/updated
  • Manual testing performed

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

@lukasnxyz
Copy link
Contributor

Hey @Gahnxd, great to see this pr from you! I'm gonna test it locally and then will merge if all is good later today, thank you again!

@lukasnxyz lukasnxyz self-assigned this Jun 14, 2025
@lukasnxyz
Copy link
Contributor

alright so I've gone ahead and tested this and I have a couple of notes

  • I'm thinking something like an auto deploy and stop as soon as the script runs. so like a scoped instance of helix at the top and once the script finishes running, the helix instance stops as well. maybe something like Instance(scoped=True)
  • i had to install pexpect and from what I'm seeing it's only used in the delete method. can you either a) find a way to do this without having an extra dependency as I want to keep the package dependencies as minimal as possible. if this is not possible, then b) add it as a dependency in the pyproject.toml

everything else looks to good to me

@Gahnxd
Copy link
Author

Gahnxd commented Jun 16, 2025

I've implemented a couple of fixes and also the auto-deploy feature:

  • Instance delete no longer uses pexpect, no changes had to be made to pyproject.ml.

  • Client now uses Instance to auto-deploy to the specified port and stops when the script finishes running.

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