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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file consolo-0.2.6.tar.gz.

File metadata

  • Download URL: consolo-0.2.6.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.4.8 CPython/3.8.13

File hashes

Hashes for consolo-0.2.6.tar.gz
Algorithm Hash digest
SHA256 cfa1fd04665aa8439d92a138b9b02db81a4b5e2f8f5fcd4e8f3d8b1b3c5ac681
MD5 125d39c6b2b4ee5377c8e070973e7517
BLAKE2b-256 19f6df219401af6352cf5ea7dc0cd1b78e59e6dc6241606cfe1ac45bb3a7b38b

See more details on using hashes here.

File details

Details for the file consolo-0.2.6-py3-none-any.whl.

File metadata

  • Download URL: consolo-0.2.6-py3-none-any.whl
  • Upload date:
  • Size: 7.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.4.8 CPython/3.8.13

File hashes

Hashes for consolo-0.2.6-py3-none-any.whl
Algorithm Hash digest
SHA256 c7fb1fe04b350318f267b0a0df1f70a86716ac69b52322f9dc9945b932622a14
MD5 16c29d421222c7ca4edb6ce7c3c05b70
BLAKE2b-256 4417c83747f8ac81213104a2504d8f10d3322afd76fd8a4dd00ebd03ad8b87de

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