From 804fb32c5db5c42e8b8cc6674fedd78f5c8791ad Mon Sep 17 00:00:00 2001 From: Nishchay Karle <45297081+NishchayKarle@users.noreply.github.com> Date: Mon, 3 Jun 2024 15:06:00 -0500 Subject: [PATCH] Remove environment variable configuration for usage tracking (#3466) This PR removes the use of $PARSL_TRACKING env variable to setup usage tracking configuration. Parsl will now only take usage tracking configuration from the config Anyone using only the env variable PARSL_TRACKING to enable usage tracking will need to set usage_tracking = True within the config to enable usage tracking. --- docs/quickstart.rst | 3 +-- docs/userguide/usage_tracking.rst | 2 +- parsl/usage_tracking/usage.py | 15 ++------------- 3 files changed, 4 insertions(+), 16 deletions(-) diff --git a/docs/quickstart.rst b/docs/quickstart.rst index 0790a98893..f1de3d1f94 100644 --- a/docs/quickstart.rst +++ b/docs/quickstart.rst @@ -236,8 +236,7 @@ for reporting purposes. As an NSF-funded project, our ability to track usage metrics is important for continued funding. -You can opt-in by setting ``PARSL_TRACKING=true`` in your environment or by -setting ``usage_tracking=True`` in the configuration object (`parsl.config.Config`). +You can opt-in by setting ``usage_tracking=True`` in the configuration object (`parsl.config.Config`). To read more about what information is collected and how it is used see :ref:`label-usage-tracking`. diff --git a/docs/userguide/usage_tracking.rst b/docs/userguide/usage_tracking.rst index 988f9d8fe7..777e8003b2 100644 --- a/docs/userguide/usage_tracking.rst +++ b/docs/userguide/usage_tracking.rst @@ -32,7 +32,7 @@ will choose to send us this information. The reason is that we need this data - By opting-in, and allowing these statistics to be reported back, you are explicitly supporting the further development of Parsl. -If you wish to opt in to usage reporting, set ``PARSL_TRACKING=true`` in your environment or set ``usage_tracking=True`` in the configuration object (`parsl.config.Config`). +If you wish to opt in to usage reporting, set ``usage_tracking=True`` in the configuration object (`parsl.config.Config`). .. _what-is-sent: diff --git a/parsl/usage_tracking/usage.py b/parsl/usage_tracking/usage.py index 0aafd98d21..10acbd8e89 100644 --- a/parsl/usage_tracking/usage.py +++ b/parsl/usage_tracking/usage.py @@ -1,6 +1,5 @@ import json import logging -import os import platform import socket import sys @@ -117,22 +116,12 @@ def __init__(self, dfk, port=50077, def check_tracking_enabled(self): """Check if tracking is enabled. - Tracking will be enabled unless either of these is true: + Tracking will be enabled unless the following is true: 1. dfk.config.usage_tracking is set to False - 2. Environment variable PARSL_TRACKING is set to false (case insensitive) """ - track = True - - if not self.config.usage_tracking: - track = False - - envvar = str(os.environ.get("PARSL_TRACKING", True)).lower() - if envvar == "false": - track = False - - return track + return self.config.usage_tracking def construct_start_message(self) -> bytes: """Collect preliminary run info at the start of the DFK.