Skip to content

Project Ideas

Ivan Ogasawara edited this page Feb 11, 2025 · 6 revisions

Sugar


Project Idea 1: Create TUI for Sugar Using Textual

Abstract

The goal of this project is to develop a Terminal User Interface (TUI) for Sugar, a tool that simplifies container management. This TUI will provide a visual and interactive way to access all functionalities of Sugar directly from the terminal, akin to the user experience offered by k9s for Kubernetes.

The Sugar TUI aims to enhance the user experience by providing a graphical interface within the terminal, allowing users to interact with Sugar's features more intuitively. The interface will be accessible via the command sugar tui and will be developed using the Textual library in Python, known for its capabilities in building modern, interactive TUIs.

Key Features:

  1. Group Selection: Users can select which group of services they want to interact with.
  2. Service Management: Functionalities to start, restart, and stop services within the chosen group.
  3. Logs and Stats Viewing: Capability to view logs and check statistics for individual services.
  4. Service Details: Display detailed information about services, such as IP addresses, volumes, and configuration settings.

Technical Approach:

  • Utilize the Textual library to create a rich, interactive TUI. Textual's modern design and integration capabilities make it an ideal choice for developing a user-friendly interface.
  • Design the interface to reflect the hierarchical structure of Sugar's configuration, allowing users to navigate between different groups and services effortlessly.
  • Implement command handling in the TUI to perform actions such as starting, stopping, and restarting services.
  • Fetch and display real-time data from Sugar, such as service logs, stats, and configuration details.

Development Plan:

  1. Initial Setup: Setting up the project structure and integrating the Textual library.
  2. Interface Design: Designing the layout and navigation of the TUI, including menus and panels.
  3. Feature Implementation: Developing the core functionalities - group selection, service management, log viewing, and displaying service details.
  4. Testing and Refinement: Testing of the TUI for usability, performance, and compatibility with existing Sugar functionalities.
  5. Documentation and Examples: Creating comprehensive documentation and usage examples to assist users in leveraging the new TUI.

Current State

Sugar is already published on pypi and conda-forge, and currently works on top of docker compose v2.

Tasks

Expected Outcomes

  • Sugar TUI working from the CLI sugar tui
  • Documentation should be updated in order to include this new feature
  • The creation of a blog post that explains this new implementation
  • Add tests on CI for TUI (as much as possible)

Details

  • Prerequisites:
    • Hard Skills:
      • Python (intermediate to advanced level)
      • Docker (basic level)
      • Command-line interface development (basic level)
      • JSON schema understanding
    • Soft Skills:
      • Problem-solving
      • Code documentation
      • Collaboration through GitHub
  • Duration: 350 hours
  • Complexity: Medium
  • Potential Mentor(s): Ivan Ogasawara, Luis Casas, Sandro Loch, Felipe Paes

References


Project Idea 2: Add Docker Swarm Support to Sugar

Abstract

The goal of this project is to extend the Sugar library with Docker Swarm support. This enhancement will enable Sugar users to manage Docker Swarm clusters directly through Sugar’s command-line interface (CLI). By adding commands for initializing, joining, creating, scaling, updating, and inspecting Swarm services, the project aims to streamline container orchestration workflows for developers.

Current State

  • Sugar currently provides functionalities for Docker Compose, but it lacks support for Docker Swarm. The CLI is modular, making it a good foundation for adding Swarm-specific commands. The existing compose_ext.py module can serve as a reference for implementing the new Swarm extension.

Tasks

Expected Outcomes

  • Implementation of new Sugar commands for Docker Swarm:
    • sugar swarm init - Initialize a swarm
    • sugar swarm join - Join a swarm as a node and/or manager
    • sugar swarm create - Create a new service
    • sugar swarm inspect - Display detailed information on one or more services
    • sugar swarm logs - Fetch logs of a service or task
    • sugar swarm ls - List services
    • sugar swarm ps - List the tasks of one or more services
    • sugar swarm rm - Remove one or more services
    • sugar swarm rollback - Revert changes to a service's configuration
    • sugar swarm scale - Scale one or multiple replicated services
    • sugar swarm update - Update a service
  • Updates to the following files:
    • src/sugar/cli.py
    • src/sugar/schema.json
    • src/sugar/core.py
  • Creation of a new extension file:
    • src/sugar/extensions/swarm.py
  • Comprehensive documentation and tests for all new commands.

Details

  • Prerequisites:
    • Hard Skills:
      • Python (intermediate to advanced level)
      • Docker and Docker Swarm (basic level)
      • Command-line interface development (basic level)
      • JSON schema understanding
    • Soft Skills:
      • Problem-solving
      • Code documentation
      • Collaboration through GitHub
  • Duration: 350 hours
  • Complexity: Medium
  • Potential Mentor(s): Ivan Ogasawara, Luis Casas, Sandro Loch, Felipe Paes

References