Skip to main content

No project description provided

Project description

Bokchoi simplifies running Python batch jobs on AWS spot instances. Bokchoi handles requesting spot instances, deploying your code and ensures the spot requests are cancelled when all jobs are finished.

Getting Started


To install bokchoi:

pip install bokchoi


Say you have a project folder with a single python script:


In your project folder create a settings file named bokchoi_settings.json:

└─ bokchoi_settings.json

This file should contain the following:

  "<projectname>": {
    "EntryPoint": "deep_nn.main",
    "Region": "us-east-1",
    "Platform": 'EC2'
    "Requirements": [
    "EC2": {
      "InstanceCount": 1,
      "SpotPrice": "0.1",
      "LaunchSpecification": {
        "ImageId": "ami-123456",
        "InstanceType": "c4.large",
        "SubnetId": "subnet-123456"


Deploying your job to AWS is now as simple as running:

bokchoi job_name deploy

Bokchoi will package your project and upload it to S3. You can then use the following command to run your job:
bokchoi job_name run

This will issue a spot request for the number of spot instances specified in the settings file. Every spot instance will download the packaged project from S3 and run the main function. Once the job is complete the instance will shut down. When all instances are finished the spot request will automatically be cancelled.


To undeploy your job, removing all resources from your AWS environment:

bokchoi job_name undeploy

This will terminate any spot instances related to your job, cancel all spot requests and remove the packaged project from S3. Any IAM resources, such as policies, roles and instance profiles will also be removed.


Shamelessly inspired by Zappa (

Project details

Download files

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

Files for bokchoi, version 0.2.0.dev1
Filename, size File type Python version Upload date Hashes
Filename, size bokchoi-0.2.0.dev1.tar.gz (9.7 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page