Skip to content

Commit

Permalink
Remove environment variable configuration for usage tracking (#3466)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
NishchayKarle authored Jun 3, 2024
1 parent 4934c30 commit 804fb32
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 16 deletions.
3 changes: 1 addition & 2 deletions docs/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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`.

Expand Down
2 changes: 1 addition & 1 deletion docs/userguide/usage_tracking.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
15 changes: 2 additions & 13 deletions parsl/usage_tracking/usage.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import json
import logging
import os
import platform
import socket
import sys
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 804fb32

Please sign in to comment.