Skip to content

Commit a9c20f0

Browse files
committed
fix(deploy): CPU-only torch to fit Fly 8GB image limit; longer wait; no dup volumes
- CUDA torch wheels made the image exceed Fly's 8GB uncompressed rootfs limit ('Not enough space to unpack image'); install CPU wheels instead - --wait-timeout 600 for the 3.5GB image pull on first boot - only create the volume if none exists (previous runs created duplicates)
1 parent dd48f7c commit a9c20f0

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,16 @@ jobs:
3434
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
3535
run: |
3636
flyctl apps create climatevision-green || echo "App already exists (or create skipped)."
37-
flyctl volumes create climatevision_data --app climatevision-green \
38-
--region lhr --size 1 --yes || echo "Volume already exists (or create skipped)."
37+
if ! flyctl volumes list --app climatevision-green | grep -q climatevision_data; then
38+
flyctl volumes create climatevision_data --app climatevision-green --region lhr --size 1 --yes
39+
else
40+
echo "Volume already exists."
41+
fi
3942
4043
- name: Deploy to Fly.io
4144
env:
4245
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
43-
run: flyctl deploy --remote-only --ha=false
46+
run: flyctl deploy --remote-only --ha=false --wait-timeout 600
4447

4548
- name: Show status
4649
env:

Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
4040

4141
# Install Python dependencies
4242
COPY requirements.txt ./
43+
# Install CPU-only PyTorch first: the default CUDA wheels unpack to >8GB,
44+
# exceeding Fly.io's maximum uncompressed image size. The Fly VM has no GPU.
45+
RUN pip install --no-cache-dir torch torchvision --index-url https://download.pytorch.org/whl/cpu
4346
RUN pip install --no-cache-dir -r requirements.txt
4447

4548
# Install the ClimateVision package

0 commit comments

Comments
 (0)