From 1c077cd532e972ecb2d22b1eaa8f00c8c744e577 Mon Sep 17 00:00:00 2001 From: Michael Pilosov Date: Mon, 2 Sep 2024 01:41:42 +0000 Subject: [PATCH] 3.0.0rc20 now works with prod server --- Dockerfile | 2 +- makefile | 8 ++++++++ noaa_animate.py | 3 ++- profiles.default.toml | 2 +- requirements.txt | 5 +++-- start.sh | 2 +- 6 files changed, 16 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index f984865..ae83f23 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 diff --git a/makefile b/makefile index 8e42780..ac12697 100644 --- a/makefile +++ b/makefile @@ -1,6 +1,14 @@ +# -e PREFECT_API_URL=https://4200-01j6qzz2bqsqmdhxc6gpqhvhg2.cloudspaces.litng.ai/api + run: build 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 . diff --git a/noaa_animate.py b/noaa_animate.py index d42af54..aea199a 100644 --- a/noaa_animate.py +++ b/noaa_animate.py @@ -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) diff --git a/profiles.default.toml b/profiles.default.toml index be11d79..f920e0f 100644 --- a/profiles.default.toml +++ b/profiles.default.toml @@ -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 diff --git a/requirements.txt b/requirements.txt index 565b02f..738e665 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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 @@ -8,3 +8,4 @@ pillow==10.3.0 requests==2.32.3 httpx==0.27.0 # imageio==2.34.1 +# griffe>=0.20.0,<1.0.0 \ No newline at end of file diff --git a/start.sh b/start.sh index a379cfc..be59810 100755 --- a/start.sh +++ b/start.sh @@ -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 &