Parrotfish is a tool for optimizing configuration of serverless functions using parametric regression. You can learn more about the architecture and performance of Parrotfish in our recent 2023 ACM Symposium on Cloud Computing (SoCC '23) paper: https://cirrus.ece.ubc.ca/papers/socc23_parrotfish.pdf
- Python >= 3.8
- AWS CLI (Configured with
aws configure
)
- gcloud CLI (Authenticate with your credentials:
gcloud auth application-default login
) - Should enable the Cloud Billing API in your account.
- Create and activate a virtualenv.
python3 -m venv src-env
source src-env/bin/activate
- Download and install the latest Parrotfish release.
pip install ${path to parrotfish-version.whl}
Note: If you want to make changes to the code, you can install Parrotfish as an editable package:
export PACKAGE_VERSION="0.0.0"
pip install -e .
-
Create and optimize your Parrotfish configuration file. Check here to learn more about options and see some examples.
-
Run Parrotfish!
parrotfish --path ${path to the configuration file}
parrotfish --step-function --path ${path to the Step Function configuration file}
Arguments:
-h, --help show this help message and exit
--path PATH, -p PATH Path to the configuration file
--verbose, -v Set the logging level to INFO
--apply Apply optimized configuration
--step-function Optimize for a Step Function
To explore the effects of other objectives and models, you need to modify the src/objective/objective.py
and
src/objective/parametric_function.py
files.
If you need to change the sampling process, e.g. the initial samples, you need to modify the src/sampling/sampler.py
file.
Currently, the --step-function
mode is designed to optimize step functions that utilize Task
, Parallel
, and Map
states. To extend support to additional state types, you'll need to modify two files:
-
src/step_function/states.py
: Add new state types by creating classes that inherit from the baseState
class. -
src/step_function/step_function.py
: Update the_create_state
function to parse the configuration files and create the state types.
GCP Cloud Functions V2 allows decoupled configuration for CPU and memory allocations. Parrotfish can optimize the CPU and memory configuration of the V2 functions. To enable this feature, use GCPv2
as the vendor in the config file.
This work was supported by the Natural Sciences and Engineering Research Council of Canada (NSERC), Mitacs, and The University of British Columbia (UBC). This work was enabled by cloud resources made available to us by the Digital Research Alliance of Canada, Google Cloud, Amazon Web Services, and Oracle Cloud Infrastructure.