Wilson Mar bio photo

Wilson Mar

Hello!

Calendar YouTube Github

LinkedIn

Evaluate the options for real-time feature configuration and impact control, coded in Python and other languages

US (English)   Norsk (Norwegian)   Español (Spanish)   Français (French)   Deutsch (German)   Italiano   Português   Estonian   اَلْعَرَبِيَّةُ (Egypt Arabic)   Napali   中文 (简体) 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.

NOTE: Content here are my personal opinions, and not intended to represent any employer (past or present). “PROTIP:” here highlight information I haven’t seen elsewhere on the internet because it is hard-won, little-know but significant facts based on my personal research and experience.

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:

featureflags-in-jira-931x433.png


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.io offers a Feature Flags utility as part of its CI/CD and Cost Management SaaS offering.

Harness provides free training to pass their free “Harness Certified Expert certification exam (answer 50 questions in 90-minutes).

https://chaoscarnival.io/sessions

But I would be cautious to join them as an employee due to the consistenly bad employee reviews on Glassdoor.

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
  2. Python install on MacOS using Pyenv
  3. Python install on Raspberry Pi for IoT

  4. Python tutorials
  5. Python Examples
  6. Python coding notes
  7. Pulumi controls cloud using Python, etc.
  8. Jupyter Notebooks provide commentary to Python

  9. Python certifications

  10. Test Python using Pytest BDD Selenium framework
  11. Test Python using Robot testing framework
  12. Testing AI uses Python code

  13. Microsoft Azure Machine Learning makes use of Python

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