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

web API status #36

Merged
merged 26 commits into from
Nov 11, 2020
Merged

web API status #36

merged 26 commits into from
Nov 11, 2020

Conversation

gmaze
Copy link
Member

@gmaze gmaze commented Jul 1, 2020

Following discussion in #35

Play with web API status (for erddap and argovis)

Add badges for API status

@gmaze gmaze linked an issue Jul 1, 2020 that may be closed by this pull request
@gmaze gmaze added the enhancement New feature or request label Jul 1, 2020
@gmaze gmaze marked this pull request as draft July 1, 2020 14:12
@gmaze
Copy link
Member Author

gmaze commented Sep 28, 2020

Hi all,
I propose here a simple new function available of the package level as: argopy.status()

In a notebook, this function will insert badges indicating the current status (availability) of web API like this:

Screenshot 2020-09-28 at 18 38 47

and if not in a notebook, it will print something like:

erddap: up
argovis: up

@gmaze
Copy link
Member Author

gmaze commented Sep 28, 2020

As a complement I also created the new repo https://github.com/euroargodev/argopy-status that is dedicated to create online monitoring tools of what we need in argopy.

You can also check and subscribe to monitoring results at https://argopy.statuspage.io

@gmaze
Copy link
Member Author

gmaze commented Sep 28, 2020

I propose here a simple new function available of the package level as: argopy.status()

What would be great, would be to have an asynchronous check of the status that would run in the background once the function is called. So that the status could be replaced and update in the same cell.

But I don't know how to do this

@gmaze gmaze marked this pull request as ready for review September 28, 2020 18:48
@gmaze gmaze requested a review from quai20 September 28, 2020 18:50
Display, and refresh regularly, the status of data sources
Now include status of local ftp
@gmaze
Copy link
Member Author

gmaze commented Sep 28, 2020

But I don't know how to do this

I tried to be a quick learner on this one !

So I implemented a new version of argopy.status() that will refresh automatically.
It has a default refresh rate of 1 sec, this can be tuned with the option argopy.status(refresh=10)

I also included a status check for the local ftp data source, in case the ftp folder would be "unplugged" after the option was set.

Example of output:

All online:
Screenshot 2020-09-29 at 00 33 29

After going offline:
Screenshot 2020-09-29 at 00 33 10

If your're online but unplug or unmount the disk with localftp, the status will change to:
Screenshot 2020-10-06 at 11 48 39

@gmaze
Copy link
Member Author

gmaze commented Sep 28, 2020

Note that this is not yet very robust wrt to environment, i.e. running in a notebook cell or ipython/python terminal

@quai20
Copy link
Member

quai20 commented Oct 6, 2020

Strange behaviour in my jupyter-lab, not rendering the argopy.status() but does render ipywidgets examples.

Capture du 2020-10-06 11-30-19

@gmaze
Copy link
Member Author

gmaze commented Oct 6, 2020

for some unknown reasons I had the same issue, no rendering of the html out of argopy.status(),

I changed the output of the status function to remove the [] around the HTML widget, and it worked

@gmaze
Copy link
Member Author

gmaze commented Oct 13, 2020

test

@gmaze
Copy link
Member Author

gmaze commented Oct 15, 2020

@quai20 did you identified what was going on with the status rendering in your notebooks ?

@quai20
Copy link
Member

quai20 commented Oct 16, 2020

@quai20 did you identified what was going on with the status rendering in your notebooks ?

After a clean reinstall of ipywidgets and the modification you did in
ef99ed1
, it works well in my environment (both lab & notebooks).

@gmaze gmaze merged commit e16c432 into master Nov 11, 2020
@gmaze gmaze deleted the api-status branch November 11, 2020 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

User experience when a webAPI is not alive ?
2 participants