Skip to content

docs: add verified steps to run training backend locally without AWS - #12

Merged
alessiopagliarulo merged 4 commits into
nextjsfrom
6-intro-run-the-backend-locally-without-the-aws-account
Oct 29, 2026
Merged

alessiopagliarulo merged 4 commits into
nextjsfrom
6-intro-run-the-backend-locally-without-the-aws-account

Conversation

@Comment-XD

@Comment-XD Comment-XD commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

#6 Run the training backend locally without AWS

Github Issue Number Here: #6

What user problem are we solving?

New contributors can't bring the training backend up on a fresh checkout without an AWS account, and the setup steps aren't written down. On top of that, two issues block a clean local run:

  • Unpinned pytorch/torchvision in environment.yml resolve to a build incompatible with Python 3.9 — import torch fails with ImportError: cannot import name 'TypeIs'.
  • The training Dockerfiles run poetry install before README.md is present, so the build fails.

What solution does this PR provide?

  • Documents a verified local run of the Django + Celery + Redis training backend with no AWS credentials.
  • Pins pytorch=2.5.1 / torchvision=0.20.1 in training/environment.yml so the environment resolves against Python 3.9.
  • Fixes the training Dockerfiles (training/Dockerfile and training/training/core/celery/Dockerfile) so README.md is copied in before poetry install.

Testing Methodology

How did you test your changes and verify that existing functionality is not broken

Brought the backend up locally (Django + Celery + Redis, no AWS) and verified:

  • GET /api/test → 200
  • Redis ping → PONG
  • pytest → 17 passed / 1 failed. The single failure (CALIFORNIA_HOUSING) is an environment permission gap in the local setup, not a regression in the pipeline.

Any other considerations

The CALIFORNIA_HOUSING test failure is a local environment permission issue rather than a code bug; flagging it so reviewers don't treat it as a regression.


Note

Low Risk
Documentation and local Docker/conda build fixes; PyTorch pin narrows dependency resolution but targets known Python 3.9 compatibility.

Overview
Adds a verified no-AWS path for bringing up Django, Celery, and Redis via docker compose up --build, including curl/Redis/pytest checks and notes that full POST /api/tabular still needs AWS for Firebase and S3.

Fixes two blockers called out in the docs: pytorch=2.5.1 / torchvision=0.20.1 in environment.yml so conda resolves a Python 3.9–compatible stack (unpinned builds broke on TypeIs), and both training Dockerfiles now copy README.md before poetry install (required by pyproject.toml) and use poetry install --no-root in the development target.

Reviewed by Cursor Bugbot for commit 155695b. Bugbot is set up for automated code reviews on this repo. Configure here.

Document a verified local run of the Django + Celery + Redis training backend
without AWS credentials, plus the two fixes needed on a fresh checkout:

- Pin pytorch=2.5.1 / torchvision=0.20.1 in environment.yml (unpinned deps
  resolve to a build incompatible with Python 3.9: import torch -> ImportError
  'TypeIs').
- Fix training Dockerfiles so README.md is available before poetry install.

Tested: /api/test -> 200, redis ping -> PONG, pytest 17 passed / 1 failed
(CALIFORNIA_HOUSING failure is an environment permission gap, not a pipeline bug).
@Comment-XD Comment-XD linked an issue Oct 27, 2026 that may be closed by this pull request
Comment thread training/environment.yml
- poetry
- pytorch
- torchvision No newline at end of file
- pytorch=2.5.1

@karkir0003 karkir0003 Oct 27, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thought for a followup issue (might not be the most urgent thing):

when i originally created DLP, I used an environment.yml setup to make compatible for mamba, but now that uv has been around for a while and the package manager is faster + simpler to use, have we considered taking a followup to use uv for the environment config

https://docs.astral.sh/uv/ @Comment-XD

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry for the late response. Yes, this is something we can implement to make package installation faster.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds good. @Comment-XD can you create a followup issue for that

alessiopagliarulo and others added 2 commits October 29, 2026 14:37
…kend-locally-without-the-aws-account

# Conflicts:
#	.github/Architecture.md

@alessiopagliarulo alessiopagliarulo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Branden! Verified: all checks pass after updating with the latest nextjs (including the backend tests with your pytorch 2.5.1 pin). Merging.

@alessiopagliarulo
alessiopagliarulo merged commit cf18b85 into nextjs Oct 29, 2026
8 checks passed
@alessiopagliarulo
alessiopagliarulo deleted the 6-intro-run-the-backend-locally-without-the-aws-account branch October 29, 2026 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Intro: run the backend locally without the AWS account

3 participants