asciinema / asciinema-server

Platform for hosting and sharing terminal session recordings
https://asciinema.org
Apache License 2.0
2.26k stars 262 forks source link

Streaming unavailable in "latest" Docker? #438

Closed jippi closed 2 months ago

jippi commented 2 months ago

Describe the bug I'm trying to setup and test the new streaming features in the v3 CLI, however, when running the Docker image ghcr.io/asciinema/asciinema-server:latest I do not see the "Stream" option in the UI and running v3 cli yields

$ asciinema-v3 stream --relay
Error: xxx doesn't support streaming

Looking in the logs, it seems the endpoint being hit returns 404.

Is there a flag/setting that need to happen for it to be enabled? I tried poking around in the code, and couldn't find anything conditional that seem to trigger streaming on/off - maybe I'm missing something?

Docker-Compose file:

  app:
    image: ghcr.io/asciinema/asciinema-server:latest
    restart: unless-stopped
    env_file: env.production
    environment:
      UPSTREAM_NAME: asciinema
      VIRTUAL_PORT: 4000
    volumes:
      - ./data/uploads:/opt/app/uploads
    links:
      - db
      - redis
      - smtp
    ports:
      - 4002:4002

Versions:

ku1ik commented 2 months ago

That's because the latest image tag doesn't include the streaming support yet (asciinema.org runs off of a branch based on develop which has it).

I've now merged this new stuff into main (stable) branch and tagged as v20240427. Github workflow which builds docker images for new releases seems to be failing/timing out, so need to figure this out before the new image will be available.

Meanwhile, if you want, you can build the image yourself by checking out the main branch and running docker build -t ghcr.io/asciinema/asciinema-server:latest .

jippi commented 2 months ago

Hi @ku1ik

Thanks for the quick (!) response ❤️

In between posting and just now, I ended up doing pretty much what you suggested, I cloned main into a sub-folder to my docker-compose project changed my file to the follow - and then it worked 🎉

  app:
    image: asciinema:local
    build:
      context: src/
    restart: unless-stopped
    env_file: env.production
    environment:
      UPSTREAM_NAME: asciinema
      VIRTUAL_PORT: 4000
    volumes:
      - ./data/uploads:/opt/app/uploads
    links:
      - db
      - redis
    ports:
      - 4002:4002
jippi commented 2 months ago

Re your CI pipeline issue, it exits with exit code: 137 which is usually "out of memory" issue 😱

You might need to pick up something along the lines of this https://github.com/rust-lang/cargo/issues/10781#issuecomment-1163819998 :)

jippi commented 2 months ago

@ku1ik this should fix your build issue https://github.com/asciinema/asciinema-server/pull/439

ku1ik commented 2 months ago

ghcr.io/asciinema/asciinema-server:latest has been successfully pushed. Enjoy, and thanks again!