Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion requirements/app/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,3 @@ beautifulsoup4>=4.8.0, <4.11.2
inquirer>=2.10.0
psutil<5.9.4
click<=8.1.3
aiohttp>=3.8.0, <=3.8.3
1 change: 1 addition & 0 deletions requirements/app/components.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# deps required by components in the lightning app repository (src/lightning_app/components)
lightning_api_access>=0.0.3
aiohttp>=3.8.0, <=3.8.3
2 changes: 2 additions & 0 deletions src/lightning_app/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).

- Apps without UIs no longer activate the "Open App" button when running in the cloud ([#15875](https://github.com/Lightning-AI/lightning/pull/15875))

- Remove the `AutoScaler` dependency `aiohttp` from the base requirements ([#15971](https://github.com/Lightning-AI/lightning/pull/15971))


### Deprecated

Expand Down
8 changes: 6 additions & 2 deletions src/lightning_app/components/auto_scaler.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
from itertools import cycle
from typing import Any, Dict, List, Tuple, Type

import aiohttp
import aiohttp.client_exceptions
import requests
import uvicorn
from fastapi import Depends, FastAPI, HTTPException, Request
Expand All @@ -22,8 +20,13 @@
from lightning_app.core.flow import LightningFlow
from lightning_app.core.work import LightningWork
from lightning_app.utilities.app_helpers import Logger
from lightning_app.utilities.imports import _is_aiohttp_available, requires
from lightning_app.utilities.packaging.cloud_compute import CloudCompute

if _is_aiohttp_available():
import aiohttp
import aiohttp.client_exceptions

logger = Logger(__name__)


Expand Down Expand Up @@ -114,6 +117,7 @@ class _LoadBalancer(LightningWork):
\**kwargs: Arguments passed to :func:`LightningWork.init` like ``CloudCompute``, ``BuildConfig``, etc.
"""

@requires(["aiohttp"])
def __init__(
self,
input_type: BaseModel,
Expand Down
4 changes: 4 additions & 0 deletions src/lightning_app/utilities/imports.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,4 +141,8 @@ def _is_sqlmodel_available() -> bool:
return module_available("sqlmodel")


def _is_aiohttp_available() -> bool:
return module_available("aiohttp")


_CLOUD_TEST_RUN = bool(os.getenv("CLOUD", False))