Skip to main content

Utility for pseudo-mounting an AWS lambda filesystem locally

Project description

pdm-managed Bugs Maintainability Rating Quality Gate Status

Consolo

Utility for pseudo-mounting an AWS lambda filesystem locally. Supports (as default) hot reloading.

Examples

Start hot syncing

consolo --profile-name dev  --function-name myProject  --path /src/code/myproject

Upload from local to cloud

consolo --profile-name dev  --function-name myProject  --path /src/code/myproject --upload

Download from cloud to local

consolo --profile-name dev  --function-name myProject  --path /src/code/myproject --download

What do I do with my mouth

Pronounced "Con Solo", like "Han Solo".

image

Installation

Single file

curl -s https://raw.githubusercontent.com/ahonnecke/consolo/main/install.sh | bash

Pip install

pip install consolo
ahonnecke@antonym:~/src/consolo$ pip install --upgrade consolo
Requirement already satisfied: consolo in /home/ahonnecke/.pyenv/versions/3.8.13/lib/python3.8/site-packages (0.2.3)
Collecting consolo
  Downloading consolo-0.2.5-py3-none-any.whl (6.6 kB)
Requirement already satisfied: argdantic>=0.3.0 in /home/ahonnecke/.pyenv/versions/3.8.13/lib/python3.8/site-packages (from consolo) (0.3.0)
Requirement already satisfied: requests>=2.28.2 in /home/ahonnecke/.pyenv/versions/3.8.13/lib/python3.8/site-packages (from consolo) (2.28.2)
Requirement already satisfied: watchdog>=2.3.1 in /home/ahonnecke/.pyenv/versions/3.8.13/lib/python3.8/site-packages (from consolo) (2.3.1)
Requirement already satisfied: boto3>=1.26.87 in /home/ahonnecke/.pyenv/versions/3.8.13/lib/python3.8/site-packages (from consolo) (1.26.87)
Requirement already satisfied: pydantic>=1.10.0 in /home/ahonnecke/.pyenv/versions/3.8.13/lib/python3.8/site-packages (from argdantic>=0.3.0->consolo) (1.10.4)
Requirement already satisfied: s3transfer<0.7.0,>=0.6.0 in /home/ahonnecke/.pyenv/versions/3.8.13/lib/python3.8/site-packages (from boto3>=1.26.87->consolo) (0.6.0)
Requirement already satisfied: botocore<1.30.0,>=1.29.87 in /home/ahonnecke/.pyenv/versions/3.8.13/lib/python3.8/site-packages (from boto3>=1.26.87->consolo) (1.29.87)
Requirement already satisfied: jmespath<2.0.0,>=0.7.1 in /home/ahonnecke/.pyenv/versions/3.8.13/lib/python3.8/site-packages (from boto3>=1.26.87->consolo) (1.0.1)
Requirement already satisfied: charset-normalizer<4,>=2 in /home/ahonnecke/.pyenv/versions/3.8.13/lib/python3.8/site-packages (from requests>=2.28.2->consolo) (2.1.1)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /home/ahonnecke/.pyenv/versions/3.8.13/lib/python3.8/site-packages (from requests>=2.28.2->consolo) (1.26.14)
Requirement already satisfied: certifi>=2017.4.17 in /home/ahonnecke/.pyenv/versions/3.8.13/lib/python3.8/site-packages (from requests>=2.28.2->consolo) (2022.12.7)
Requirement already satisfied: idna<4,>=2.5 in /home/ahonnecke/.pyenv/versions/3.8.13/lib/python3.8/site-packages (from requests>=2.28.2->consolo) (3.4)
Requirement already satisfied: python-dateutil<3.0.0,>=2.1 in /home/ahonnecke/.pyenv/versions/3.8.13/lib/python3.8/site-packages (from botocore<1.30.0,>=1.29.87->boto3>=1.26.87->consolo) (2.8.2)
Requirement already satisfied: typing-extensions>=4.2.0 in /home/ahonnecke/.pyenv/versions/3.8.13/lib/python3.8/site-packages (from pydantic>=1.10.0->argdantic>=0.3.0->consolo) (4.4.0)
Requirement already satisfied: six>=1.5 in /home/ahonnecke/.pyenv/versions/3.8.13/lib/python3.8/site-packages (from python-dateutil<3.0.0,>=2.1->botocore<1.30.0,>=1.29.87->boto3>=1.26.87->consolo) (1.16.0)
Installing collected packages: consolo
  Attempting uninstall: consolo
    Found existing installation: consolo 0.2.3
    Uninstalling consolo-0.2.3:
      Successfully uninstalled consolo-0.2.3
Successfully installed consolo-0.2.5
ahonnecke@antonym:~/src/consolo$ consolo --help
usage: consolo [-h] --profile-name TEXT --function-name TEXT --path TEXT [--upload | --no-upload] [--download | --no-download] [--create | --no-create] [--verbose | --no-verbose]

optional arguments:
  -h, --help            show this help message and exit
  --profile-name TEXT   (required)
  --function-name TEXT  (required)
  --path TEXT           (required)
  --upload
  --no-upload
  --download
  --no-download
  --create
  --no-create
  --verbose
  --no-verbose

Known issues (not slated for fix)

  • You must hard reload the console to see changes
  • You must "deploy" from the console for changes to be effected, if changes are made in the console
  • if changes are left in the console, the upload will fail with "ResourceUpdateInProgress", or something

TODO

  • TESTING: Capture and deal with rapid multi-file changes
  • List available functions
  • AST files before upload
  • Unit tests
  • Follow logs while watching

DONE

  • Ignore new files added by pytest

Usage

consolo.py --profile-name dev-power --function-name myLambda --path /home/ahonnecke/src/my_lambda/

examples

ahonnecke@antonym:~/src/v2x-messenger$ consolo.py \
  --profile-name dev-power \
  --function-name v2x-messenger__cipt-status-ingestion \
  --path /home/ahonnecke/src/v2x-messenger/lambdas/cipt_status_ingestion/
  • With the profile
  • dev-power
  • Against the lambda
  • v2x-messenger__cipt-status-ingestion`
  • Mapped on top of the local directory
  • /home/ahonnecke/src/v2x-messenger/lambdas/cipt_status_ingestion/

image

publish

  • Bump version
pdm publish --username $PIP_USERNAME --password $PIP_PW

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

consolo-0.2.6.tar.gz (6.9 kB view hashes)

Uploaded Source

Built Distribution

consolo-0.2.6-py3-none-any.whl (7.6 kB view hashes)

Uploaded Python 3

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