Browse Source

3.0.0rc20 now works with prod server

main
Michael Pilosov 3 months ago
parent
commit
1c077cd532
  1. 2
      Dockerfile
  2. 8
      makefile
  3. 3
      noaa_animate.py
  4. 2
      profiles.default.toml
  5. 5
      requirements.txt
  6. 2
      start.sh

2
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

8
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 .

3
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)

2
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

5
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

2
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 &

Loading…
Cancel
Save