Skip to main content

miniogre: generate Dockerfile, requirements.txt, and SBOM from project directory

Project description

Miniogre

Miniogre is a command-line application that analyzes a Python project codebase and README file to automatically generate a Dockerfile, requirements.txt file, and SBOM files. This tool expedites the process of dockerizing any Python application.

miniogre_gif_33

How it Works

Upon running the application, it carries out the following steps:

  • The project directory is scrutinized to identify the primary code language.
  • The README file is located and read.
  • GPT-4 language model is used to predict the application dependencies and generate content for the requirements.txt file based on the README contents.
  • The requirements.txt, Dockerfile, and sbom.json files are created.
  • A Docker image of the application is built.
  • An ogre container is spun up.

Two main commands can be run, with the miniogre/main.py file serving as the entry point.

  • run: Executes a series of actions, including configuring directories and files (bashrc, Dockerfile), generating requirements, building a Docker image, and spinning up a container.
  • readme: Constructs a new README.md file that mirrors the operations observed within the source code.

For more in-depth execution details, refer to miniogre/main.py,miniogre/actions.py, and miniogre/config.py.

Requirements

To use miniogre effectively, ensure the following are installed:

  • Python 3: Miniogre is developed in Python. If it's not already installed, get Python here.
  • Docker: Docker is a platform used to eliminate "works on my machine" problems when collaborating on code with co-workers. If it's not already installed, get Docker here.
  • pip or pipx: These are python package installers used to install miniogre. If they are not already installed, get pipx here or pip here.
  • An OpenAI token in the environment: export OPENAI_API_KEY=<YOUR_TOKEN>

Usage

After installation, go inside the project folder and run:

miniogre run

This will analyze the project, generate ogre_dir/Dockerfile, ogre_dir/requirements.txt, and ogre_dir/sbom.json and build a Docker image.

There are other commands:

  • readme: Analyzes the source code to generate a new README.md file that is compatible with what actually happens in the source code.

Installation

Miniogre can be installed either by using pip or pipx:

  • pip install miniogre
  • pipx install miniogre

Contributing

Contributions to improve this resource are more than welcome. For inquiries, contact the maintainers at contact@ogre.run.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

miniogre-0.2.0.tar.gz (14.2 kB view details)

Uploaded Source

Built Distribution

miniogre-0.2.0-py3-none-any.whl (15.4 kB view details)

Uploaded Python 3

File details

Details for the file miniogre-0.2.0.tar.gz.

File metadata

  • Download URL: miniogre-0.2.0.tar.gz
  • Upload date:
  • Size: 14.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.18

File hashes

Hashes for miniogre-0.2.0.tar.gz
Algorithm Hash digest
SHA256 bc1edb1ebfd6f798f4f3df32b3c49288e682cb227dfd25b6e0346a54734306ba
MD5 60d30d84f27da360c59ad83c7f986b0d
BLAKE2b-256 1e55defd24f8ab8e70b030d63e1bd217adceff3df8b2225455b5d5a42ba0daa1

See more details on using hashes here.

File details

Details for the file miniogre-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: miniogre-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 15.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.18

File hashes

Hashes for miniogre-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 57196f1228c5026601923a9f63f5ce73c106392f79730595d25fcfc0c1897c7e
MD5 7df53e0ea56beaea161b1d5ba7e5cc62
BLAKE2b-256 5caf81cd441f0440ce164ea6ed53a2c2d617aa0c48cae8594cde1bc78055b2e2

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page