Wilson Mar bio photo

Wilson Mar

Hello!

Email me Calendar Skype call

LinkedIn Twitter Gitter Instagram Youtube

Github Stackoverflow Pinterest

Evaluate the options for Python for real-time feature configuration and impact control

US (English)   Español (Spanish)   Français (French)   Deutsch (German)   Italiano   Português   Cyrillic Russian   中文 (简体) Chinese (Simplified)   日本語 Japanese   한국어 Korean

Overview

This article describes use of “feature flags” to finely control the “blast radius” of changes, done in order to deliver changes faster while minimizing risk.

Traditionally, new or updated features made available via a software deployment become visible to ALL users at the same time. And to fix a poorly-implemented feature requires an immediately roll back to the prior version, or to create a fix as quickly as possible and roll forward by deploying a new version. That is risky and stressful.

“Upgrade infrastructure safely. Change configurations on the fly. Dynamically control everything in real-time.”

Easier said than done.

Feature flags enable “testing in production”.

Run-time feature flags

BLOG: https://dzone.com/articles/feature-flags-are-the-answer-to-retailers-holiday

Martin Fowler calls Feature Toggles a design pattern:

“Toggles introduce complexity. We can keep that complexity in check by using smart toggle implementation practices and appropriate tools to manage our toggle configuration, but we should also aim to constrain the number of toggles in our system.””

So feature flags are now a central facet of programming templates.

So, different implementations exist for each language.

Many systems already provide services for managing feature flags and reporting/analysis:

Jira has a “Feature Flags” tab:

<a target=”_blank” href=https://user-images.githubusercontent.com/300046/125816357-790f7657-ad40-4f2a-9a8b-26e8b859aa7c.png”> featureflags-in-jira-931x433.png</a>


Python

argparse is a built-in module of Python to enable user-friendly command-line interfaces.

See https://docs.python.org/3/library/argparse.html

The list of utilities at “The Hub for Feature Flag Driven Development” is rather disappointing.

  • https://github.com/trustrachel/Flask-FeatureFlags by @trustrachel Sanders was archived in 2015.

  • https://github.com/disqus/gutter was archived Dec 17, 2015.

  • https://github.com/venmo/feature_ramp by Amanda Schloss and Anthony Yim for “Toggling and ramping features via a lightweight Redis backend.” has not been updated since Aug 21, 2015.

LaunchDarkly

If you can a spare $90/month, https://launchdarkly.com provides a GUI from a server that turn tags on and off.

Your program would query their server real-time to determine what to do.

The server has “Pluggable configuration backends”.

CAUTION: This architecture may not be approapriate if you’re concerned about excess bandwidth usage and possible leak of secret data over the wire.

PROTIP: It’s shiny unique feature is support for default fallback calls.

As with any server, it has logging features. For more money, it integrate with audit logs, and analytics with user segmentation.

For an additional $390/month, you get support for A/B experimentation.

BLAH: Wish they would offer a free edition.

Flagon

https://github.com/ashcrow/flagon was last updated May 20, 2017 by Stephen Milner (@ashcrow), now CoreOS boss at Red Hat.

It’s based on Java’s Togglz and makes use of http://werkzeug.pocoo.org/ WGI, from the same folks.

  1. Look at the configuration file listing the status of each flag:

    https://github.com/ashcrow/flagon/blob/master/example/config.json

  2. The results file:

    https://github.com/ashcrow/flagon/blob/master/example/results.txt

  3. The code making use of the flag:

    https://github.com/ashcrow/flagon/blob/master/example/example.py

Metrikus

Harness

Harness has Feature Flags as part of its CI/CD and Cost Management SaaS offering.

Walkme demo of Harness CD runs a sample deployment in a Kubernetes Cluster within Google Cloud Platform (GKE), available for 1 hour.

https://www.harness.com calls it “progressive delivery” https://harness.io/blog/product-updates/introducing-harness-feature-flags/

https://searchitoperations.techtarget.com/news/252502582/Harness-baits-CI-CD-set-with-feature-flags-cloud-auto-stop

https://webinars.devops.com/confidence-and-experimentation-with-feature-flags-at-metrikus https://www.metrikus.io/

More about Python

This is one of a series about Python:

  1. Python install on MacOS using Pyenv
  2. Python install on MacOS
  3. Python install on Raspberry Pi for IoT

  4. Test Python using Pytest BDD Selenium framework
  5. Test Python using Robot testing framework

  6. Python certifications
  7. Python tutorials
  8. Python coding notes
  9. Jupyter Notebooks provide commentary to Python

  10. Pulumi controls cloud using Python, etc.
  11. Microsoft Azure Machine Learning makes use of Python
  12. Testing AI uses Python code

  13. Python REST API programming using the Flask library
  14. Python coding for AWS Lambda Serverless programming
  15. Streamlit visualization framework powered by Python
  16. Web scraping using Scrapy, powered by Python
  17. Neo4j graph databases accessed from Python