ogre-cli
The quickest way to start using ogre.run
Last updated
The quickest way to start using ogre.run
Last updated
This package is currently outdated and on the track to be deprecated in favor of miniogre.
Ogre CLI is a framework built around Docker that automates the creation of containerized runtime environments for Python code.
It analyzes the source code inside a given folder and automatically creates an environment
No Dockerfile? Ogre takes care of it for you
No requirements file? Ogre generates one for you
This get-started focuses on the simplest form of the Ogre CLI, which can be used offline, without a token. To unlock the full power of the Ogre CLI, create a token and follow the these steps.
IMPORTANT: make sure you have Docker installed. Follow instructions from the Docker website.
Install the Ogre CLI with python-pip
To check if everything was successfully installed, type:
You will be greeted by the ogre menu.
Now let's "ogrerize" your code. As an example, we use nanoGPT, a popular AI GitHub repository. But you are also free to try on any Python code base of your choice.
Clone the nanoGPT repository:
Go inside its folder:
Configure ogre. This generates the ogre.yml
file that contains the specifications for ogre to generate the runtime environment (see details here):
Finally, generate the ogre environment:
IMPORTANT: If you run into problems in this step, please contact us: contact@ogre.run
The environment building starts and you will see something similar to the log below:
Once the build is done, you can check that the environment is deployed and running:
Notice that the ogre environment is allocated to the localhost address 0.0.0.0:8001.
Ogre read your Python source code and created a list of all the dependencies that needed to be installed. It did that without needing a requirements.txt
file.
Ogre also created a Dockerfile based on the public ogre.run linux Docker image. This Dockerfile is used by the Docker engine to build a unique Docker image for that repository, all without the need for the user to manually specify the build parameters.
As the Docker image is built, it uses the ogre-generated requirements.txt
to install all the dependencies in the image.
You can now access the runtime environment, with all the dependencies installed, and start working using either of the following options:
Type ogre --attach
, which will take you inside the container
On a web browser, visit the address returned by the ogre --info
command, in this case 0.0.0.0:8001. You will be greeted by a Jupyter Notebook interface that provides the developer with more options to interact with the code. The default password is ogre123
, but you can define your own by configuring the Ogre CLI parameters.