DefangLabs / defang

Defang CLI and sample projects. Defang is a radically simpler way for developers to develop, deploy, and debug cloud applications.
https://defang.io
MIT License
28 stars 6 forks source link

Debug not running on failed first deployment #551

Closed raphaeltm closed 1 month ago

raphaeltm commented 1 month ago

I wanted to test the ai debugging functionality so I wrote this Dockerfile which intentionally includes a line that should break (RUN pipenv install --system --deploy):

FROM node:20-alpine

WORKDIR /app

RUN pipenv install --system --deploy

COPY package*.json ./

RUN npm install

COPY . .

EXPOSE 3000

CMD [ "node", "main.js" ]

Here are the logs from defang compose up:

➜  task-processor git:(failure-case) ✗ defang compose up
 ! service "processor": unsupported compose directive: depends_on
 ! service "processor": missing memory reservation; specify deploy.resources.reservations.memory to avoid out-of-memory errors
 ! service "redisx": missing compose directive: restart; assuming 'unless-stopped' (add 'restart' to silence)
 ! service "redisx": missing memory reservation; specify deploy.resources.reservations.memory to avoid out-of-memory errors
 ! service "api": unsupported compose directive: depends_on
 ! service "api": ingress port without healthcheck defaults to GET / HTTP/1.1
 ! service "api": missing memory reservation; specify deploy.resources.reservations.memory to avoid out-of-memory errors
 * Compressing build context for api at /Users/raphaeltitsworth-morin/dev/defang/vanjs/task-processor
 * Uploading build context for api
 ! service "api": service names were fixed up in environment variable "REDIS_HOST": "raphaeltm-redisx"
 ! Published ports are ignored in ingress mode
 * Compressing build context for processor at /Users/raphaeltitsworth-morin/dev/defang/vanjs/task-processor
 * Uploading build context for processor
 ! service "processor": service names were fixed up in environment variable "REDIS_HOST": "raphaeltm-redisx"
 * Deploying service redisx
 * Deploying service api
 * Deploying service processor
 * Monitor your services' status in the defang portal
   - https://portal.defang.dev/service/redisx
   - https://portal.defang.dev/service/api
   - https://portal.defang.dev/service/processor
 * Tailing logs for deployment ID cresd8xt6760 ; press Ctrl+C to detach:
 * Press V to toggle verbose mode
2024-07-18T13:18:48.876000-07:00 cd Update started for stack raphaeltm-prod1
2024-07-18T13:19:27.266195-07:00 api-image /bin/sh: pipenv: not found
2024-07-18T13:19:27.266420-07:00 api-image error building image: error building stage: failed to execute command: waiting for process to exit: exit status 127
2024-07-18T13:19:29.033274-07:00 processor-image /bin/sh: pipenv: not found
2024-07-18T13:19:29.033444-07:00 processor-image error building image: error building stage: failed to execute command: waiting for process to exit: exit status 127
2024-07-18T13:27:04.931015-07:00 cd Update failed in 8m16.091774678s ; executing forced refresh...
2024-07-18T13:27:07.931259-07:00 cd Refresh completed at 8m19.092082225s
2024-07-18T13:27:12.986296-07:00 cd Update started for stack raphaeltm-prod1
2024-07-18T13:27:47.892887-07:00 processor-image /bin/sh: pipenv: not found
2024-07-18T13:27:47.893104-07:00 processor-image error building image: error building stage: failed to execute command: waiting for process to exit: exit status 127
2024-07-18T13:27:49.410869-07:00 api-image /bin/sh: pipenv: not found
2024-07-18T13:27:49.411055-07:00 api-image error building image: error building stage: failed to execute command: waiting for process to exit: exit status 127
2024-07-18T13:28:01.739664-07:00 cd Update failed in 9m12.900465276s ; executing forced refresh...
2024-07-18T13:28:05.935116-07:00 cd Refresh completed at 9m17.095949562s

It's currently 13:37 and nothing is happening. So the deployment has failed, but the CLI is hanging, and I'm not getting any ai debugging info, which is what I thought was supposed to happen if a deployment failed.

raphaeltm commented 1 month ago

As I understand, the fact that the command isn't terminating might be something you can help out with @nullfunc? @lionello I think the ai debugging integration into the CLI was on your end? Just tagging so y'all can see this so I know what to expect and so we can hopefully get this running before the demo next week.

nullfunc commented 1 month ago

@raphaeltm

2024-07-18T13:28:01.739664-07:00 cd Update failed in 9m12.900465276s ; executing forced refresh... Shows a deployment error. We're still missing detection of cd failures.

lionello commented 1 month ago

Fixed