Deployement fails
remigere
PROOP

2 years ago

not sure how to fix my deployement

logs:

You reached the start of the range → Apr 18, 2024 12:02 PM

[Region: us-west1]

==============

Using Nixpacks

==============

context: 1b972124f47c222980fa7f0457a7f7a1

Nixpacks build failed

Nixpacks was unable to generate a build plan for this app.

Please check the documentation for supported languages: https://nixpacks.com

The contents of the app directory are:

caddy/

docker-compose-development.yml

CHANGELOG.md

README.md

docker-compose.yml

.gitignore

backend/

.pre-commit-config.yaml

docker-compose-demo_backup.yml

.env.example

static/

ls

frontend/

Debug: Attach to FastAPI Docker

docker-compose-demo.yml

Chinook.db

docs/

LICENSE

pre-commit/

.vscode/

launch_backup.json

CODEOWNERS

scripts/

CONTRIBUTING.md

.github/

Makefile

View Deploy details

ⓘ Deployment information is only viewable by Project members and Railway admins.

4 Replies

2 years ago

Are you able to share your repo?


remigere
PROOP

2 years ago

https://github.com/BCG-X-Official/agentkit

the structure is like that

./backend ./frontend ./docker-compose.yml

i deployed the frontend in vercel

I forgot to put the backend folder as root.

./backend/Dockerfile ./backend/app

./backend/app/pyproject.toml .backend/app/poetry.toml

.backend/app/app/main.py

Now i get this

Deployment logs:

ModuleNotFoundError: No module named 'main'

[2024-04-18 19:16:29 +0000] [8] [INFO] Worker exiting (pid: 8)

[2024-04-18 19:16:29 +0000] [7] [INFO] Shutting down: Master

[2024-04-18 19:16:29 +0000] [7] [INFO] Reason: Worker failed to boot.
File "/usr/local/lib/python3.10/site-packages/gunicorn/app/wsgiapp.py", line 48, in load_wsgiapp

return util.importapp(self.appuri)

Dockerfile:

FROM tiangolo/uvicorn-gunicorn-fastapi:python3.10-slim-2022-11-25
ENV PYTHONUNBUFFERED=1

WORKDIR /code

Install Poetry

RUN apt clean && apt update && apt install curl -y
RUN curl -sSL https://install.python-poetry.org | POETRY_HOME=/opt/poetry python && \
cd /usr/local/bin && \
ln -s /opt/poetry/bin/poetry && \
poetry config virtualenvs.create false

Copy poetry.lock* in case it doesn't exist in the repo
COPY app/pyproject.toml app/poetry.lock* /code/

Allow installing dev dependencies to run tests
ARG INSTALLDEV=false RUN bash -c "if [ $INSTALLDEV == 'true' ] ; then poetry install --with dev --no-root ; else poetry install --no-root --no-dev ; fi"

ENV PYTHONPATH=/code
EXPOSE 9090


2 years ago

They are hardcoding a bunch of stuff, e.g. this broker URL is hardcoded to not have a username or password -

https://github.com/BCG-X-Official/agentkit/blob/main/backend/app/app/core/celery.py#L11

Not a good coding practice in the slightest, they are also (semi) hardcoding other stuff like hostnames in the caddy proxy, and I'm sure there's plenty more that I have yet to find, but this project in its current condition would only be suitable for fragile docker-compose deployments, and those are rarely ever production-ready.

So I'm sorry to say this but it would not be possible to reliably deploy that on Railway without it following some better practices first.


remigere
PROOP

2 years ago

thanks a lot for pointing that out


Loading...