FAQ
How do I override one of ConsoleMe's web routes, or add new routes just for my internal implementation of ConsoleMe?
You can add new routes or override existing routes in your implementation of ConsoleMe through the use of an internal plugin. ConsoleMe provides a set of default plugins that serve as an example of how you should implement your internal plugins.
Included in the default_plugins set is a list of internal routes and an example web handler. The routes defined here will take precedence over ConsoleMe's default routes.
How can I generate an AMI for ConsoleMe so I can deploy it to EC2?
We provide an example flow to generating an AMI based on ConsoleMe's default configuration. This should serve as a reference for you to create your own AMI. Here are the general steps you'd need to follow to get this running today. We are looking for contributions to make this process smoother:
Install Packer with the guidance here.
Retrieve AWS credentials locally (Place them in your ~/.aws/credentials file under the default profile, or set them as environment variables)
Place your custom configuration in a file called
consoleme.yaml
in your ConsoleMe directoryRun
make create_ami
from your ConsoleMe directory. This process will compress the current directory and create an Ubuntu AMI for ConsoleMe
How do I generate models from the Swagger specification?
We use datamodel-code-generator to generate Pydantic models for ConsoleMe.
If you make changes to ConsoleMe's Swagger specification, you'll need to re-generate the Pydantic Models file with the following command:
How do I debug the unit tests?
To run tests in PyCharm, the clearly superior Python development environment, you need to update your Debug configuration to include the following environment variables to assist with debugging:
CONFIG_LOCATION=example_config/example_config_test.yaml
(Required)ASYNC_TEST_TIMEOUT=3600
(Optional for debugging the RESTful code without having to worry about timeouts)
Run make test
or make testhtml
to run unit tests
How do I release a new version of ConsoleMe
ConsoleMe uses setupmeta for versioning, utilizing the devcommit
strategy. This project adheres to SemVer standards for major, minor, and patch versions. setupmeta
diverges from SemVer slightly for development versions.
When you're ready to release patch changes on master
:
When you're ready to release minor changes on master
:
When you're ready to release major changes on master
(rare, reserved for breaking changes):
How do I update ConsoleMe's Python dependencies?
To update Python dependencies, run this command:
If you're using Python 3.8 and trying to run this command on Mac, you may need to run
PKG_CONFIG_PATH="/usr/local/opt/libxml2/lib/pkgconfig" make up-reqs
which forces pkgconfig to use brew's xmlsec instead of the MacOS xmlsec (Details: https://github.com/mehcode/python-xmlsec/issues/111)
If an updated package causes an incompatibility issue, please identify the issue, pin the older version in ConsoleMe's requirements.in file, and add a comment identifying the issue you encountered.
How can I run and debug my local DynamoDB container?
Running docker-compose -f docker-compose-dependencies.yaml up
in the root directory will enable local dynamodb and local Redis.
To install a web interface to assist with managing local dynamodb, install dynamodb-admin with the following command, then visit http://localhost:8001 to view the contents of your local DynamoDB.
Last updated