Compare commits

...

4 Commits

Author SHA1 Message Date
Michael Pilosov
cec0ae2481 hypercorn 2024-09-02 02:21:43 +00:00
Michael Pilosov
1c077cd532 3.0.0rc20 now works with prod server 2024-09-02 01:42:58 +00:00
mm
ffe0ef5fa8 Update 'app/app.py' 2024-05-31 21:05:22 +00:00
mm
1bf43ea2d5 Update 'makefile' 2024-05-31 21:05:02 +00:00
8 changed files with 29 additions and 9 deletions

View File

@ -25,8 +25,8 @@ RUN chown -R user:user /home/user
USER user
# Copy the requirements file to /tmp and install Python dependencies with user flag
COPY --chown=user:user requirements.txt /tmp/requirements.txt
RUN python -m pip install --upgrade pip
COPY --chown=user:user requirements.txt /tmp/requirements.txt
RUN pip install --no-cache-dir --user -r /tmp/requirements.txt
# APPLICATION SETUP

View File

@ -10,7 +10,7 @@ from prefect.deployments import run_deployment
PORT = 9021
PROTO = "https"
BARE = True
BARE = False
app = Flask(__name__)

View File

@ -1,5 +1,13 @@
start:
start: hypercorn
gevent:
gunicorn --worker-class gevent --bind 0.0.0.0:9021 app:app
gthread:
gunicorn --worker-class gthread --threads 4 --bind 0.0.0.0:9021 app:app
hypercorn:
hypercorn --bind 0.0.0.0:9021 app:app
dev:
python app.py

View File

@ -1,5 +1,13 @@
# -e PREFECT_API_URL=https://4200-01j6qzz2bqsqmdhxc6gpqhvhg2.cloudspaces.litng.ai/api
run: build
docker run --rm -ti --name noaa -e LIGHTNING_CLOUDSPACE_HOST=noaa.clfx.cc -p 9021:9021 -p 4200:4200 noaa
docker run --rm -ti --name noaa -e HOST_NAME=localhost -p 9021:9021 -p 4200:4200 noaa
serve: build
docker run --rm -ti --name noaa \
-e LIGHTNING_CLOUDSPACE_HOST=$$LIGHTNING_CLOUDSPACE_HOST \
-p 9021:9021 -p 4200:4200 \
noaa
build:
docker build -t noaa .

View File

@ -195,6 +195,7 @@ def animate(
limit: int = 0,
):
urls = get_file_links(url, ext)
urls = list(urls)
if len(urls) == 0:
raise ValueError("No urls scraped")
images = get_images(list(sorted(urls)), limit=limit)
@ -259,6 +260,6 @@ if __name__ == "__main__":
"limit": 0,
}
create_animations.serve(
"noaa-animate", limit=8, schedule=None, parameters=sched_params
"noaa-animate", limit=8, interval=None, parameters=sched_params
)
# make_animation(url)

View File

@ -1,7 +1,7 @@
active = "default"
PREFECT_API_URL = "http://0.0.0.0:4200/api"
[profiles.default]
PREFECT_API_URL = "http://0.0.0.0:4200/api"
PREFECT_TASK_SCHEDULING_MAX_SCHEDULED_QUEUE_SIZE = 4
PREFECT_API_SERVICES_SCHEDULER_DEPLOYMENT_BATCH_SIZE = 100

View File

@ -1,5 +1,5 @@
prefect==2.17.1
#prefect==3.0.0rc1
# prefect==2.20.4
prefect==3.0.0rc20
Flask==3.0.3
gunicorn==22.0.0
gevent==24.2.1
@ -7,4 +7,7 @@ moviepy==1.0.3
pillow==10.3.0
requests==2.32.3
httpx==0.27.0
# uvicorn==0.28.1
hypercorn==0.17.3
# imageio==2.34.1
# griffe>=0.20.0,<1.0.0

View File

@ -1,6 +1,6 @@
#!/bin/bash
# Start the web app
cd app && make &
cd app && make start &
# Start Prefect in the background
prefect server start --host 0.0.0.0 &