ClinicianFOCUS / FreeScribe

A medical scribe capable of creating SOAP notes running Whisper and Kobold based on conversation with a patient
GNU General Public License v3.0
0 stars 0 forks source link

Docker Status Bar + Docker Settings #14

Closed ItsSimko closed 2 weeks ago

ItsSimko commented 2 weeks ago

Summary by Sourcery

Add a Docker status bar to the application UI to monitor LLM and Whisper containers. Implement a ContainerManager class to manage Docker containers, including starting, stopping, and checking their status. Enhance the application settings with Docker configuration options and update the release workflow to include NSIS script setup.

New Features:

Enhancements:

CI:

socket-security[bot] commented 2 weeks ago

New dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
pypi/docker@2.0.0 environment, eval, filesystem, network 0 698 kB aiordache, ccrone, dev-tooling-team, ...4 more

View full report↗︎

sourcery-ai[bot] commented 2 weeks ago

Reviewer's Guide by Sourcery

This pull request integrates Docker management into the application by adding a ContainerManager class and UI components for managing Docker containers. It enhances the application settings to support Docker configurations and updates the UI to display container statuses and provide start/stop controls. The changes also include the addition of tooltips for better user guidance and an update to the CI workflow to include NSIS script setup.

User journey diagram for Docker container management UI

journey
    title User journey for Docker container management
    section Access Docker Settings
      User opens application: 5: User
      User navigates to Docker settings: 4: User
    section Manage Docker Containers
      User views Docker container statuses: 4: User
      User starts LLM container: 3: User
      User starts Whisper container: 3: User
      User stops LLM container: 3: User
      User stops Whisper container: 3: User
    section Exit Application
      User prompted to close Docker containers: 4: User
      User decides to close or keep containers running: 3: User

Class diagram for ContainerManager and MainWindow

classDiagram
    class ContainerManager {
        +DockerClient client
        +start_container(container_name)
        +stop_container(container_name)
        +check_container_status(container_name)
        +set_status_icon_color(widget, status)
        +check_docker_status_thread(llm_dot, whisper_dot, app_settings)
    }
    class MainWindow {
        +ContainerManager container_manager
        +start_LLM_container(widget_name, app_settings)
        +stop_LLM_container(widget_name, app_settings)
        +start_whisper_container(widget_name, app_settings)
        +stop_whisper_container(widget_name, app_settings)
    }
    MainWindow --> ContainerManager

File-Level Changes

Change Details Files
Implement Docker container management
  • Add ContainerManager class to handle Docker container operations
  • Implement methods to start, stop, and check container status
  • Add error handling for Docker operations
src/FreeScribe.client/ContainerManager.py
Update main application UI to include Docker status and controls
  • Add footer frame to display Docker container statuses
  • Implement start/stop buttons for LLM and Whisper containers
  • Add status indicators (colored dots) for container states
  • Implement tooltips for Docker-related UI elements
src/FreeScribe.client/client.py
Enhance application settings to include Docker configurations
  • Add Docker-specific settings to the editable_settings dictionary
  • Create a new 'Docker Settings' tab in the settings window
  • Implement UI elements for Docker container name configurations
src/FreeScribe.client/ApplicationSettings_client.py
Implement tooltip functionality
  • Create a Tooltip class to handle tooltip creation and display
  • Implement methods for scheduling, showing, and hiding tooltips
src/FreeScribe.client/Tooltip.py
Create MainWindow class for centralized UI management
  • Implement methods to start and stop LLM and Whisper containers
  • Add error handling for container operations
src/FreeScribe.client/UI/MainWindow.py
Update CI workflow
  • Add script file parameter for NSIS setup in GitHub Actions workflow
.github/workflows/release.yml

Tips and commands #### Interacting with Sourcery - **Trigger a new review:** Comment `@sourcery-ai review` on the pull request. - **Continue discussions:** Reply directly to Sourcery's review comments. - **Generate a GitHub issue from a review comment:** Ask Sourcery to create an issue from a review comment by replying to it. - **Generate a pull request title:** Write `@sourcery-ai` anywhere in the pull request title to generate a title at any time. - **Generate a pull request summary:** Write `@sourcery-ai summary` anywhere in the pull request body to generate a PR summary at any time. You can also use this command to specify where the summary should be inserted. #### Customizing Your Experience Access your [dashboard](https://app.sourcery.ai) to: - Enable or disable review features such as the Sourcery-generated pull request summary, the reviewer's guide, and others. - Change the review language. - Add, remove or edit custom review instructions. - Adjust other review settings. #### Getting Help - [Contact our support team](mailto:support@sourcery.ai) for questions or feedback. - Visit our [documentation](https://docs.sourcery.ai) for detailed guides and information. - Keep in touch with the Sourcery team by following us on [X/Twitter](https://x.com/SourceryAI), [LinkedIn](https://www.linkedin.com/company/sourcery-ai/) or [GitHub](https://github.com/sourcery-ai).
ItsSimko commented 2 weeks ago

I would not merge just yet, I need to notify the user if the containers do not exist or if there are errors. I didn't really think of this until i tested this. Need to remove some unused code sections.