Skip to main content

A Python based runner for docker images.

Project description

bisi

Bisi (BuildItShipIt) is a tool to help run workloads locally and in the cloud. Bisi lets you define and run all your containerized resources from one file stored at the root of your project all in python.

Currently supported providers are:

  • Locally with docker
  • AWS Batch

Installation

Prerequisites

Docker is required to use bisi

The awscli and credentials are required to use the AWS Batch features.

pip install awscli
aws configure

Install bisi

Install bisi from pypi

pip install bisi

Quickstart

Getting started with bisi is as simple as creating a Dockerfile and a bisi_resources.py file.

Create a clean directory.

mkdir bisi_example
cd bisi_example

Run the following to create an example Dockerfile.

echo 'FROM python:slim
RUN pip install numpy
ADD . /bisi
WORKDIR /bisi' > Dockerfile

Next define an example workload as a python script.

echo 'import numpy
print(numpy.random.rand())' > workload.py

Finally create a bisi_resources.py file to tell bisi about our Dockerfile and how to run our workload.

echo 'import bisi.resources as bsr

df = bsr.Dockerfile(name="bisi_example", file="Dockerfile")

bsr.Job(name="numpy_example", entrypoint="workload.py", dockerfile=df)' > bisi_resources.py

Now you can use bisi to build your dockerfile and run it.

bisi build
bisi run numpy_example

From here you are free to use bisi to run anything from data processing to deep learning training in docker! Check out the sections below for more detailed usage.

AWS Batch

With AWS Batch you can run your batch workloads in the cloud at any scale and bisi makes that easy for you. To get started follow the AWS Batch Setup Guide to stand up a minimal Batch infrastructure setup running on CPU instances.

Once you have a batch job queue, you can configure bisi to utilize your batch infrastructure to run jobs. Assuming you ran the quickstart guide you can run the following to update your bisi_resources.py file.

echo 'import bisi.resources as bsr
from bisi.resources.config import BatchJobConfig, ECRConfig

df = bsr.Dockerfile(name="bisi_example", file="Dockerfile", ecr_config=ECRConfig("bisi_example"))

bsr.Job(name="numpy_example", entrypoint="workload.py", dockerfile=df, 
        batch_config=BatchJobConfig(jobQueue="bisi-test-jq"))' > bisi_resources.py

This configures bisi to upload your docker image to Amazon ECR and tells bisi where to submit your batch job. Next you can deploy your container and run it in batch.

bisi deploy
bisi run --provider aws numpy_example

At this point you can navigate to https://console.aws.amazon.com/batch/home to see your pending job. From there you can also navigate to the job to see the logs for the job.

Contact

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

bisi-0.0.3.tar.gz (14.2 kB view hashes)

Uploaded Source

Built Distribution

bisi-0.0.3-py3-none-any.whl (19.5 kB view hashes)

Uploaded Python 3

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