Skip to main content

miniogre: from source code to reproducible environment, in seconds.

Project description

miniogre

miniogre automates the management of software dependencies with AI, to ensure your Python code runs on any computer. It is a command-line application that analyzes a Python codebase to automatically generate a Dockerfile, requirements.txt file, and SBOM files, expediting the process of packaging any Python application. Additionally, it is able to update the README (documentation) file to comply with what really happens in the source code.

miniogre_gif_33

Why miniogre

Developers waste hours per week managing software dependencies. This is particularly true in AI development where many Python packages lack proper documentation and have outdated configuration files. Miniogre empowers developers to automatically identify, update, and install the necessary software dependencies to get code to work. Unlike other tools that need manual setup, miniogre uses AI to quickly handle Python dependencies setup, cutting down "dependency hunting" from hours a week to just minutes.

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.
  • The source code is crawled to obtain a preliminary list of requirements.
  • A large language model (LLM) provider (choices are openai, mistral, groq, octoai) is used to refine the list of requirements and generate the final content for the requirements.txt file.
  • 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 API token of at least one of the following LLM inference providers:
    • openai: type export OPENAI_API_KEY=<YOUR_TOKEN> on the terminal;
    • mistral: type export MISTRAL_API_KEY=<YOUR_TOKEN> on the terminal;
    • groq: type export GROQ_SECRET_ACCESS_KEY=<YOUR_TOKEN> on the terminal;
    • octoai: type export OCTOAI_TOKEN=<YOUR_TOKEN> on the terminal.

OpenAI token in the environment:

Installation

Miniogre can be installed either by using pip or pipx:

  • pip install miniogre
  • pipx install miniogre

You can also build the wheel from the source and then install it on your system. We provide a handy script install.sh to accomplish that.

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.

Commands

  • 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: Analyzes the source code to generate a new README.md file that reflects the actual operations in the source code.
  • eval: Determines the reproducibility score of the repository by evaluating the README quality.
  • spinup: Spins up a container if an image was previously built with the run command.
  • version: Displays the current version of miniogre.

Build Ogre base image

Useful to create a Docker image that can be deployed on Google Cloud Run:

miniogre build-ogre-image --host-platform linux/amd64 --baseimage ogrerun/base:ubuntu22.04-amd64 --verbose --no-cache

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.11.0b1.tar.gz (801.3 kB view details)

Uploaded Source

Built Distribution

miniogre-0.11.0b1-py3-none-any.whl (801.9 kB view details)

Uploaded Python 3

File details

Details for the file miniogre-0.11.0b1.tar.gz.

File metadata

  • Download URL: miniogre-0.11.0b1.tar.gz
  • Upload date:
  • Size: 801.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for miniogre-0.11.0b1.tar.gz
Algorithm Hash digest
SHA256 b28054fcf654fee8efbe182f3f3e15d82e0204023444ed14c36dd27d7805ef0d
MD5 e7fb6e58e2ca15e7d725f193795672b5
BLAKE2b-256 a1e73e49a8d2838a9e9d151b75ca677eeedf53b277c42d0d1b79f4e3738431df

See more details on using hashes here.

File details

Details for the file miniogre-0.11.0b1-py3-none-any.whl.

File metadata

  • Download URL: miniogre-0.11.0b1-py3-none-any.whl
  • Upload date:
  • Size: 801.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for miniogre-0.11.0b1-py3-none-any.whl
Algorithm Hash digest
SHA256 7d2f105621ea41dcd87358b6017096eb155d4dce901d70e261ab1153e6b5477b
MD5 9e3f1b8e40a86c7c54a9c35a667e56f6
BLAKE2b-256 7ee932a994c09e1c0c4a570f3f8145f50abf2bd4d051768a9b35e06097b6c3f1

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