Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error running custom image #2625

Open
alexkreidler opened this issue Dec 8, 2024 · 3 comments
Open

Error running custom image #2625

alexkreidler opened this issue Dec 8, 2024 · 3 comments

Comments

@alexkreidler
Copy link

alexkreidler commented Dec 8, 2024

I have this code:

import modal
from server import make_server
app = modal.App("marker")

@app.function(
    image=modal.Image.from_registry("alexkreidler/marker-server:1.0.2-modal"),
    gpu=modal.gpu.A10G(count=1),
    container_idle_timeout=20,
    timeout=24 * 60 * 60,
    allow_concurrent_inputs=1000,
)
@modal.asgi_app()
def serve():
    return make_server()

But when I run it I get: Runner failed with exception: container exited successfully but never requested inputs

When I run modal shell --image alexkreidler/marker-server:1.0.2-modal it exits immediately instead of giving me an interactive shell (one time it did print root@modal:/# then exited. I can run it with --cmd 'echo hi' and that works.

My entrypoint is following the example script from the docs:

#!/usr/bin/env bash

exec "$@"

Do I need to add something else? Like CMD ["uvicorn", "src.server:app", "--host", "0.0.0.0", "--port", "8000"]

Shouldn't modal be "passing in" the right command to run, whether for the shell or to run a python function?

My full code with dockerfiles, entrypoint, etc is here

@alexkreidler alexkreidler changed the title Add better docs for custom images Error running custom image Dec 9, 2024
@mwaskom
Copy link
Contributor

mwaskom commented Dec 11, 2024

Hi, what does make_server do? Just naively based on the name, should you be using modal.web_server instead of modal.asgi_app?

@alexkreidler
Copy link
Author

It returns a FastAPI app

@mwaskom
Copy link
Contributor

mwaskom commented Dec 17, 2024

I think you would need

ENTRYPOINT ["/app/modal-entrypoint.sh"]

rather than

ENTRYPOINT "/app/modal-entrypoint.sh"

but since it doesn't look like you're adding any custom logic in your entrypoint script, you can maybe leave that out altogether?

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

No branches or pull requests

2 participants