Skip to content

Repository files navigation

cluster-pack

cluster-pack is a library on top of either pex to make your Python code easily available on a cluster.

Its goal is to make your prod/dev Python code & libraries easiliy available on any cluster. cluster-pack supports HDFS/S3 as a distributed storage.

The first examples use Skein (a simple library for deploying applications on Apache YARN) and PySpark with HDFS storage. We intend to add more examples for other applications (like Dask, Ray) and S3 storage.

An introducing blog post can be found here.

cluster-pack

Installation

Install with Pip

$ pip install cluster-pack

Install from source

$ git clone https://github.com/criteo/cluster-pack
$ cd cluster-pack
$ pip install .

Prerequisites

cluster-pack supports Python ≥3.9.

Feature flags

  • C_PACK_USER: override the current user for HDFS path generation and Skein impersonation
    • When set, this value is used instead of the system user (from getpass.getuser())
    • Useful for running jobs as a different user or in environments where the system user doesn't match the HDFS user
    • If not set or empty, falls back to the current system user

Features

  • Ships a package with all the dependencies from your current virtual environment

  • Stores metadata for an environment

  • Supports "under development" mode by taking advantage of pip's editable installs mode, all editable requirements will be uploaded all the time, making local changes directly visible on the cluster

  • Interactive (Jupyter notebook) mode

  • Provides config helpers to directly use the uploaded zip file inside your application

  • Launching jobs from jobs by propagating all artifacts

Basic examples with skein

  1. Interactive mode

  2. Self shipping project

Basic examples with PySpark

  1. PySpark with HDFS on Yarn

  2. Docker with PySpark on S3

Info

Conda is no longer supported

About

A library on top of either pex or conda-pack to make your Python code easily available on a cluster

Topics

Resources

Stars

47 stars

Watchers

9 watching

Forks

Releases

Packages

Used by

Contributors

Languages