Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Internet connection alert #227

Merged
merged 5 commits into from
Jun 23, 2022
Merged

Internet connection alert #227

merged 5 commits into from
Jun 23, 2022

Conversation

lawhead
Copy link
Collaborator

@lawhead lawhead commented Jun 16, 2022

Overview

Added an alert when the user's computer has an active internet connection.

Ticket

https://www.pivotaltracker.com/story/show/182200897

Contributions

  • New system utility for checking for an internet connection
  • Factored out the functionality for generating the confirmation dialog so multiple conditions could be checked.
  • Alert the user when an active internet connection is detected.
  • Added GPU logging to the system_info.

Test

  • Ran a session with the internet turned on to confirm a new alert. Ran again with the internet off to test that the alert did not appear. Inspected the log files for the new system_info.
  • I was unable to fully test the GPU logging since this is not supported by PyTorch on my computer.

@lawhead lawhead requested a review from tab-cmd June 16, 2022 23:44
REMOTE_SERVER = "https://github.com/CAMBI-tech/BciPy/"


def is_connected(hostname: str = "one.one.one.one", port=80) -> bool:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

REMOTE_SERVER could be the default here

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Turns out this doesn't work if I'm on OHSU's VPN and it thought I was not on the internet. I updated this to use the "1.1.1.1" DNS resolver and it works both on and off VPN.

bcipy/main.py Outdated
@@ -22,6 +22,31 @@
log = logging.getLogger(__name__)


def preconditions_ok(parameters) -> bool:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think of moving this to helpers/validate.py. We use a similar pattern for validating experiments. Another option for the method name: validate_bcipy_session or similar to be more explicit

@lawhead lawhead merged commit 01a50ff into 2.0.0rc2 Jun 23, 2022
@lawhead lawhead deleted the more-system-info branch June 23, 2022 23:32
@tab-cmd tab-cmd mentioned this pull request Sep 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants