Skip to main content
Archived

This project has been archived by its maintainers, and is no longer receiving any updates.

MyCloud

Leverage small clusters of machines to increase your productivity.

MyCloud requires no prior setup; if you can SSH to your machines, then it will work out of the box. MyCloud currently exports a simple mapreduce API with several common input formats; adding support for your own is easy as well.

Usage

Starting your cluster:

import mycloud

cluster = mycloud.Cluster(['machine1', 'machine2'])

# or use defaults from ~/.config/mycloud
# cluster = mycloud.Cluster()

Map over a list:

result = cluster.map(compute_factors, range(1000))

ClientFS makes accessing local files seamless!

def my_worker(filename):
  do_work(mycloud.fs.FS.open(filename, 'r'))

cluster.map(['client:///my/local/file'], my_worker)

Use the MapReduce interface to easily handle processing of larger datasets:

from mycloud.mapreduce import MapReduce, group
from mycloud.resource import CSV
input_desc = [CSV('client:///path/to/my_input_%d.csv') % i for i in range(100)]
output_desc = [CSV('client:///path/to/my_output_file.csv')]

def map_identity(kv_iter, output):
  for k, v in kv_iter:
    output(k, int(v[0]))

def reduce_sum(kv_iter, output):
  for k, values in group(kv_iter):
    output(k, sum(values))

mr = MapReduce(cluster, map_identity, reduce_sum, input_desc, output_desc)

result = mr.run()

for k, v in result[0].reader():
  print k, v

Performance

It is, keep in mind, written entirely in Python.

Some simple operations I’ve used it for (6 machines, 96 cores):

  • Sorting a billion numbers: ~5m

  • Preprocessing 1.3 million images (resizing and SIFT feature extraction): ~1 hour

Input formats

Mycloud has builtin support for processing the following file types:

  • LevelDB

  • CSV

  • Text (lines)

  • Zip

Adding support for your own is simple - just write a resource class describing how to get a reader and writer. (see resource.py for details).

Why?!?

Sometimes you’re developing something in Python (because that’s what you do), and you decide you’d like it to be parallelized. Our current options are multiprocessing (limiting us to a single machine) and Hadoop streaming (limiting us to strings and Hadoop’s input formats).

Also, because I could.

Credits

MyCloud builds on the phenomonally useful cloud serialization, SSH/Paramiko, and LevelDB libraries.

Metadata

Release files for mycloud 0.51

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mycloud 0.51
File Size Uploaded
mycloud-0.51.tar.gz 12.0 kB Details

Release files / mycloud-0.51.tar.gz

Download URL mycloud-0.51.tar.gz
Size 12.0 kB
Tags Source
SHA-256 checksum
How to use checksums
397326a15bef6b4f80d689939c44018eb0444807ee9b95cf46b48a01100d5f25
BLAKE2b-256 checksum
How to use checksums
9b74101e9410700f5c252e0c21ec28ae9fa65fabdf2dd8722f1cf0acc508a0a5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.51 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page