Skip to main content

No project description provided

Project description

Mycelium Runtime Library

What is Mycelium?

Mycelium is a framework that helps you easily write highly scalable (microservice) applications.

Mycelium automatically generates Terraform from your code, and handles load balancing for you.

The goal is to write your code without thinking about the infrastructure as if it was a simple monolithic application, and then have Mycelium decide on how to split your app into components, handle load balancing, communication between components, etc...

How to use this library?

Import this library into your app and use it to annotate your code with service hints/constraints.

The more this framework evolves, the less help you will have to give in the form annotations.

Finally, invoke the CLI (myc command) and watch it automatically generate Terraform for you (and optionally deploy it for you).

Example Usage

Create an empty Poetry application with myc (runtime) as dependency and myccli (compiler) as a development dependency.

Add some package (e.g. test_app) to your project with __init__.py containing:

from myc import Mycelium

app = Mycelium()
foo_service = app.create_service("foo")
bar_service = app.create_service("bar")

@foo_service.fastapi.get("/")
def foo():
    return f'The answer is: {bar()}'

@bar_service.fastapi.get("/")
def bar():
    return 42

Then run myc compile test_app:app to generate Terraform, followed by myc deploy to deploy your app!

What will happen:

  • A Dockerfile will be generated for each service
  • Docker images will be built and pushed to a private ECR repository
    • Temporary caveat: The framework expects you to have a repository called mycelium in your AWS region of choice (an update will come soon to have this repo created automatically)
  • Two ECS services will be created in a new cluster for foo and bar services.
  • The call to bar() in foo function will be transformed to an HTTP get request!

Limitations

This project is in its earliest stages, and feature count is limited at the moment. The framework (currently) assumes projects to use Poetry as a package manager

Currently supported features:

  • AWS as a cloud provider
  • ECS as a platform in AWS (Lambda support will come very soon)
  • Poetry as the package manager

More will come soon!

Upcoming Features

  • Dynamic and static load measurements to determine optimal load balancing strategy
  • Support more cloud providers: Google Cloud, Azure, etc...
  • Support more service platforms: AWS Lambda, EC2, etc...
  • Support more package managers other than Poetry
  • Flexible serialization/deserialization strategies
  • Command to launch dashboard to watch:
    • Service topology
    • Aggregated logs
    • Load balancing metrics

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

myc-0.1.2.tar.gz (10.9 kB view details)

Uploaded Source

Built Distribution

myc-0.1.2-py3-none-any.whl (12.3 kB view details)

Uploaded Python 3

File details

Details for the file myc-0.1.2.tar.gz.

File metadata

  • Download URL: myc-0.1.2.tar.gz
  • Upload date:
  • Size: 10.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.0 CPython/3.10.4 Linux/5.15.0-25-generic

File hashes

Hashes for myc-0.1.2.tar.gz
Algorithm Hash digest
SHA256 e9e0e5fae92cf127c8fbfffc763e19234c757599d4ce7dc4f2d131c7963916bf
MD5 c53f9bdab36167e07b7cae96c731ea63
BLAKE2b-256 3acb007a8541eb0f5340b13ebf205772e9c68e79ce31afbe325b669b6fa6dd1f

See more details on using hashes here.

File details

Details for the file myc-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: myc-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 12.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.0 CPython/3.10.4 Linux/5.15.0-25-generic

File hashes

Hashes for myc-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 78f0fa5fc669d33a3d72d27a64b361e3e79f1f5585a952e6f37c73d0a13abc26
MD5 0a342b5892be72fe0a2634f5651b940b
BLAKE2b-256 8580d196da6bb1ad1eb135e544858437769e29a4439080531050adf4eb53439b

See more details on using hashes here.

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