resourcefit


Nameresourcefit JSON
Version 0.1.2 PyPI version JSON
download
home_pagehttps://github.com/ojimba01/resourcefit
SummaryCLI tool for analyzing Docker containers and recommending EC2 instances.
upload_time2024-10-17 16:41:23
maintainerNone
docs_urlNone
authorOlayinka Jimba
requires_python>=3.9
licenseMIT
keywords docker ec2 aws cloud
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
# ResourceFit

**ResourceFit** is a command-line tool designed to analyze Docker container resource usage and recommend the most cost-effective Amazon Web Services (AWS) EC2 instances based on the container's memory, CPU, and disk space requirements. It fetches real-time container stats, normalizes the data, and compares them against available EC2 instance options, taking AWS EBS storage and pricing into account.

## Features

- **Host Machine Stats:** Collects and displays CPU, memory, disk, and network information from the host machine.
- **Docker Container Stats:** Analyzes running Docker containers, showing stats like CPU usage, memory consumption, and network I/O.
- **EC2 Recommendations:** Recommends AWS EC2 instances based on the resource needs of the selected Docker container.
- **AWS Pricing Data:** Fetches EC2 and EBS pricing data to make cost-efficient recommendations.
- **Memory and Disk Space Buffers:** Includes customizable memory buffers (50-100%) to ensure recommended instances meet peak resource demands.

## Installation

To install ResourceFit, follow the steps below:

1. Have python (version 3.9 and above) installed on your device, follow the link below to do this:

    ```bash
    https://www.python.org/downloads/
    ```

2. Install ResourceFit:

    ```bash
    pip install resourcefit
    ```

## Usage

Once installed, you can use `resourcefit` from the command line:

```bash
resourcefit
```

The tool will:

1. Display a list of running Docker containers.
2. Allow you to select a container to analyze.
3. Show real-time stats for the selected container (CPU, memory, I/O).
4. Fetch and display AWS EC2 and EBS pricing data.
5. Recommend the top three EC2 instances based on the selected container's resource usage and disk space requirements.

## Example Output

```bash
Select a container to analyze:
1. webapp (ID: 123abc456def) - Image: webapp:latest
2. nginx (ID: 789ghi012jkl) - Image: nginx:latest

Enter the number of the container (default 1) [1]:

Selected Container ID: 123abc456def

Docker Container Stats:
container_id: 123abc456def
name: webapp
cpu_usage: 0.24%
mem_usage: 256.00 MiB / 1.00 GiB
mem_percentage: 25.00%
net_io_rx: 10.00 kB
net_io_tx: 5.00 kB
block_io_read: 0.00 MB
block_io_write: 0.05 MB
pids: 5

Fetching AWS EC2 pricing data...

Top 3 EC2 Instance Recommendations:
    Instance Type  Memory  vCPU             Storage  priceMonthly
191      t4g.nano     0.5     2  EBS only (5.00 GB)         3.466
277      t3a.nano     0.5     2  EBS only (5.00 GB)         3.831
648       t3.nano     0.5     2  EBS only (5.00 GB)         4.196
```

## Dependencies

ResourceFit requires the following Python libraries:

- `psutil`: For host machine stats.
- `docker`: For Docker container stats.
- `pandas`: For data handling.
- `requests`: To fetch AWS pricing data.
- `click`: For the command-line interface.

## How It Works

### Step 1: Host Machine Stats
The tool collects basic host machine stats, including CPU count, memory size, disk I/O, and network I/O.

### Step 2: Docker Container Stats
It lists running Docker containers and provides real-time statistics (CPU, memory, and I/O usage) for the selected container.

### Step 3: AWS Pricing Data
ResourceFit fetches EC2 and EBS pricing data from AWS for both Linux and Windows instances in the specified region.

### Step 4: EC2 Instance Recommendations
Based on the Docker container stats, ResourceFit recommends the top EC2 instances, applying a 50% memory buffer for peak loads. It also factors in disk space requirements for instances with EBS storage.

## Customization

### Memory Buffer Factor
The default memory buffer factor is set to 1.5 (50% more memory). This can be adjusted in the source code based on your needs.

### AWS Region
By default, the AWS region is set to 'US East (N. Virginia)', but this can be modified in the code to support different regions.

## License

This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.

## Contributing

Contributions are welcome! Please feel free to submit pull requests or open issues if you encounter any bugs or have feature requests.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/ojimba01/resourcefit",
    "name": "resourcefit",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "docker, EC2, AWS, cloud",
    "author": "Olayinka Jimba",
    "author_email": "\"Olayinka Jimba Jr.\" <ojimba01@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/58/69/4240aaee103b3afa794cfbcbb1015a6574d453ae40e6f7c3623591564f72/resourcefit-0.1.2.tar.gz",
    "platform": null,
    "description": "\n# ResourceFit\n\n**ResourceFit** is a command-line tool designed to analyze Docker container resource usage and recommend the most cost-effective Amazon Web Services (AWS) EC2 instances based on the container's memory, CPU, and disk space requirements. It fetches real-time container stats, normalizes the data, and compares them against available EC2 instance options, taking AWS EBS storage and pricing into account.\n\n## Features\n\n- **Host Machine Stats:** Collects and displays CPU, memory, disk, and network information from the host machine.\n- **Docker Container Stats:** Analyzes running Docker containers, showing stats like CPU usage, memory consumption, and network I/O.\n- **EC2 Recommendations:** Recommends AWS EC2 instances based on the resource needs of the selected Docker container.\n- **AWS Pricing Data:** Fetches EC2 and EBS pricing data to make cost-efficient recommendations.\n- **Memory and Disk Space Buffers:** Includes customizable memory buffers (50-100%) to ensure recommended instances meet peak resource demands.\n\n## Installation\n\nTo install ResourceFit, follow the steps below:\n\n1. Have python (version 3.9 and above) installed on your device, follow the link below to do this:\n\n    ```bash\n    https://www.python.org/downloads/\n    ```\n\n2. Install ResourceFit:\n\n    ```bash\n    pip install resourcefit\n    ```\n\n## Usage\n\nOnce installed, you can use `resourcefit` from the command line:\n\n```bash\nresourcefit\n```\n\nThe tool will:\n\n1. Display a list of running Docker containers.\n2. Allow you to select a container to analyze.\n3. Show real-time stats for the selected container (CPU, memory, I/O).\n4. Fetch and display AWS EC2 and EBS pricing data.\n5. Recommend the top three EC2 instances based on the selected container's resource usage and disk space requirements.\n\n## Example Output\n\n```bash\nSelect a container to analyze:\n1. webapp (ID: 123abc456def) - Image: webapp:latest\n2. nginx (ID: 789ghi012jkl) - Image: nginx:latest\n\nEnter the number of the container (default 1) [1]:\n\nSelected Container ID: 123abc456def\n\nDocker Container Stats:\ncontainer_id: 123abc456def\nname: webapp\ncpu_usage: 0.24%\nmem_usage: 256.00 MiB / 1.00 GiB\nmem_percentage: 25.00%\nnet_io_rx: 10.00 kB\nnet_io_tx: 5.00 kB\nblock_io_read: 0.00 MB\nblock_io_write: 0.05 MB\npids: 5\n\nFetching AWS EC2 pricing data...\n\nTop 3 EC2 Instance Recommendations:\n    Instance Type  Memory  vCPU             Storage  priceMonthly\n191      t4g.nano     0.5     2  EBS only (5.00 GB)         3.466\n277      t3a.nano     0.5     2  EBS only (5.00 GB)         3.831\n648       t3.nano     0.5     2  EBS only (5.00 GB)         4.196\n```\n\n## Dependencies\n\nResourceFit requires the following Python libraries:\n\n- `psutil`: For host machine stats.\n- `docker`: For Docker container stats.\n- `pandas`: For data handling.\n- `requests`: To fetch AWS pricing data.\n- `click`: For the command-line interface.\n\n## How It Works\n\n### Step 1: Host Machine Stats\nThe tool collects basic host machine stats, including CPU count, memory size, disk I/O, and network I/O.\n\n### Step 2: Docker Container Stats\nIt lists running Docker containers and provides real-time statistics (CPU, memory, and I/O usage) for the selected container.\n\n### Step 3: AWS Pricing Data\nResourceFit fetches EC2 and EBS pricing data from AWS for both Linux and Windows instances in the specified region.\n\n### Step 4: EC2 Instance Recommendations\nBased on the Docker container stats, ResourceFit recommends the top EC2 instances, applying a 50% memory buffer for peak loads. It also factors in disk space requirements for instances with EBS storage.\n\n## Customization\n\n### Memory Buffer Factor\nThe default memory buffer factor is set to 1.5 (50% more memory). This can be adjusted in the source code based on your needs.\n\n### AWS Region\nBy default, the AWS region is set to 'US East (N. Virginia)', but this can be modified in the code to support different regions.\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n\n## Contributing\n\nContributions are welcome! Please feel free to submit pull requests or open issues if you encounter any bugs or have feature requests.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "CLI tool for analyzing Docker containers and recommending EC2 instances.",
    "version": "0.1.2",
    "project_urls": {
        "Bug Tracker": "https://github.com/ojimba01/resourcefit/issues",
        "Homepage": "https://github.com/ojimba01/resourcefit",
        "Repository": "https://github.com/ojimba01/resourcefit"
    },
    "split_keywords": [
        "docker",
        " ec2",
        " aws",
        " cloud"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "dd78658dbd8fe51a7766250182b46bfad065a9efe00b7273f77b343cf33be789",
                "md5": "4095287e5b0950f4becc58fb19bfe0d6",
                "sha256": "7e18f0b9a277040021ea34b77bdd99e8d4d06e1a27c2b28d79cf7be5327a8630"
            },
            "downloads": -1,
            "filename": "resourcefit-0.1.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "4095287e5b0950f4becc58fb19bfe0d6",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 9435,
            "upload_time": "2024-10-17T16:41:22",
            "upload_time_iso_8601": "2024-10-17T16:41:22.819733Z",
            "url": "https://files.pythonhosted.org/packages/dd/78/658dbd8fe51a7766250182b46bfad065a9efe00b7273f77b343cf33be789/resourcefit-0.1.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "58694240aaee103b3afa794cfbcbb1015a6574d453ae40e6f7c3623591564f72",
                "md5": "dddedbcb3a5787aa799287794d049688",
                "sha256": "8a8fbc5a1f54b519826ae7dc30031fb4339837b84c3b1062bd2c798262b86a26"
            },
            "downloads": -1,
            "filename": "resourcefit-0.1.2.tar.gz",
            "has_sig": false,
            "md5_digest": "dddedbcb3a5787aa799287794d049688",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 10936,
            "upload_time": "2024-10-17T16:41:23",
            "upload_time_iso_8601": "2024-10-17T16:41:23.872427Z",
            "url": "https://files.pythonhosted.org/packages/58/69/4240aaee103b3afa794cfbcbb1015a6574d453ae40e6f7c3623591564f72/resourcefit-0.1.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-17 16:41:23",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ojimba01",
    "github_project": "resourcefit",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "resourcefit"
}
        
Elapsed time: 0.37088s