Repository: Lightning-Universe/lightning-flash

Issue:
Docs build lottery
## 🐛 Bug

@ehofesmann We still seem to be getting this issue:
```
intersphinx inventory 'https://voxel51.com/docs/fiftyone/objects.inv' not fetchable due to <class 'requests.exceptions.ConnectionError'>: HTTPSConnectionPool(host='voxel51.com', port=443): Max retries exceeded with url: /docs/fiftyone/objects.inv (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f5fbc2d56d0>: Failed to establish a new connection: [Errno 110] Connection timed out'))
```
Example here: https://github.com/PyTorchLightning/lightning-flash/pull/426/checks?check_run_id=2860706755

Is it because we have multiple CI trying to get it at once?

I think for now we can probably try to just ignore that warning, but would be interested to know the root cause. @Borda any idea how we can ignore just a specific warning in sphinx build? Or any idea what might be causing the issue?

(Just to provide some context, we typically get the error then I re-trigger the build and it's fine)


Discussion:
is it pulling voxel51 docs or some dataset?
@Borda It's getting the fiftyone intersphinx inv thing that seems to be the issue. So the URL configured here: https://github.com/PyTorchLightning/lightning-flash/blob/17e4a2241942cab492c95f8959cec08c1d889f21/docs/source/conf.py#L101
We have noticed this still occurring as well and are still looking into it. It seems to be an issue with our website hosting provider that we are trying to resolve. In the meantime, handling the error when building the docs would likely the best way to avoid requiring to re-trigger the build.
@ehofesmann Awesome, thanks for looking into it, I'll try to find a way to suppress the warning :smiley:

Resolving patch:
diff --git a/docs/source/conf.py b/docs/source/conf.py
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -98,7 +98,7 @@ def _load_py_module(fname, pkg="flash"):
     "PIL": ("https://pillow.readthedocs.io/en/stable/", None),
     "pytorchvideo": ("https://pytorchvideo.readthedocs.io/en/latest/", None),
     "pytorch_lightning": ("https://pytorch-lightning.readthedocs.io/en/stable/", None),
-    "fiftyone": ("https://voxel51.com/docs/fiftyone/", None),
+    "fiftyone": ("https://voxel51.com/docs/fiftyone/", "fiftyone_objects.inv"),
 }
 
 # -- Options for HTML output -------------------------------------------------
diff --git a/flash/core/utilities/imports.py b/flash/core/utilities/imports.py
--- a/flash/core/utilities/imports.py
+++ b/flash/core/utilities/imports.py
@@ -91,6 +91,13 @@ def _compare_version(package: str, op, version) -> bool:
 _TEXT_AVAILABLE = _TRANSFORMERS_AVAILABLE
 _TABULAR_AVAILABLE = _TABNET_AVAILABLE and _PANDAS_AVAILABLE
 _VIDEO_AVAILABLE = _PYTORCHVIDEO_AVAILABLE
-_IMAGE_AVAILABLE = _TORCHVISION_AVAILABLE and _TIMM_AVAILABLE and _PIL_AVAILABLE and _KORNIA_AVAILABLE and\
-    _MATPLOTLIB_AVAILABLE and _COCO_AVAILABLE and _FIFTYONE_AVAILABLE
+_IMAGE_AVAILABLE = all([
+    _TORCHVISION_AVAILABLE,
+    _TIMM_AVAILABLE,
+    _PIL_AVAILABLE,
+    _KORNIA_AVAILABLE,
+    _MATPLOTLIB_AVAILABLE,
+    _COCO_AVAILABLE,
+    _FIFTYONE_AVAILABLE,
+])
 _SERVE_AVAILABLE = _FASTAPI_AVAILABLE and _PYDANTIC_AVAILABLE and _CYTOOLZ_AVAILABLE and _UVICORN_AVAILABLE


Test patch: