Giter Site home page Giter Site logo

Readonly-friendly rootfs support about cog HOT 11 CLOSED

igalia avatar igalia commented on July 22, 2024
Readonly-friendly rootfs support

from cog.

Comments (11)

gil0109 avatar gil0109 commented on July 22, 2024

@philn thank you. Also, if not disabled, then redirected to a tmpfs directory

from cog.

aperezdc avatar aperezdc commented on July 22, 2024

Some of the features which cause writes to disk can be disabled using some of the command line options listed with --help-websettings, for example:

cog --enable-offline-web-application-cache=false \
    --enable-page-cache=false \
    ...

That being said, writable disk access for temporary files may still be needed. You can use the XDG_CACHE_HOME, XDG_DATA_HOME, XDG_RUNTIME_DIR, and so on as defined in the XDG Base Directory Specification, which Cog honors.

Please let us know if doing any of the above (or a combination of both) solves the issue for you.

from cog.

gil0109 avatar gil0109 commented on July 22, 2024

@aperezdc Thank you for the information. I will try the XDG variables.

Please note that my version of Cog doesn't have the --help-websettings
$cog --version
0.1.0
$cog --help-websettings
Unknown option --help-websettings

from cog.

aperezdc avatar aperezdc commented on July 22, 2024

@gil0109 You're welcome! The XDG variables should be enough to make Cog write temporary files and caches in whichever path you may prefer. For the --help-websettings you will need a version of Cog newer than commit 1c63839 so I suppose your build is from some older commit — you may need to update your build recipes to pick a more recent revision from the Cog repository.

from cog.

gil0109 avatar gil0109 commented on July 22, 2024

@aperezdc

I upgrade to the latest cog (thank you).

I am viewing a 600mb mp4 file.

I am getting the following memory error. Is there something I can do to fix this? If I run the same thing using chromium and raspbian stretch using overlayfs, I don't have this issue. So I am hoping, there's something we can do with cog and webkit.

root@raspberrypi3:~# /usr/sbin/start_cog.sh
Starting Digital Signage
[LibinputServer] Initialization of linux input system succeeded.
Cannot create EGL surfaceless context: missing EGL_KHR_surfaceless_{context,opengl} extension.
Cannot create EGL WPE context: EGL_SUCCESS
Cog-Message: https://sbc-qsystem-prod.pathfinder.gov.bc.ca/sbc.mp4 Load started.
Cog-Message: https://sbc-qsystem-prod.pathfinder.gov.bc.ca/sbc.mp4 Loading...
Cog-Message: https://sbc-qsystem-prod.pathfinder.gov.bc.ca/sbc.mp4 Loaded successfully.
Memory pressure relief: Total: res = 25817088/24981504/-835584, res+swap = 23851008/23187456/-663552

from cog.

gil0109 avatar gil0109 commented on July 22, 2024

One more thing, running the video using streamer does not seem tohave this issue:
gst-play-1.0 https://sbc-qsystem-dev.pathfinder.gov.bc.ca/sbc.mp4
Now playing https://sbc-qsystem-dev.pathfinder.gov.bc.ca/sbc.mp4
Prerolling...
Buffering... 100%
0:01:01.9 / 0:22:36.5

from cog.

philn avatar philn commented on July 22, 2024

Chromium doesn't display errors but likely also uses a lot of memory :) The memory pressure message you see is not critical but it would be good to do further investigation anyway.

May I suggest you to subscribe to the WPE mailing list? See https://lists.webkit.org/mailman/listinfo/webkit-wpe

This specific issue you observe is not related with this Cog issue we're discussing in.

from cog.

aperezdc avatar aperezdc commented on July 22, 2024

As mentioned by @philn, the memory pressure handler message is normal, and means that WebKit is trying to return some unused memory back to the system — that's good!

@gil0109 I understand that you have been able to use Cog on your system with read-only rootfs, using the XDG_* variables. Can you confirm whether that approach worked for you? Thanks!

from cog.

gil0109 avatar gil0109 commented on July 22, 2024

@aperezdc Absolutely will let you know. Turning on read-only broke a few other items like DHCP so I am working on getting that fixed before I can test and report.

As for the message, as soon as that happens, the video either hangs or the image is flattened to a cm thick. I was hoping to post it on Igalia_WebKit but I will take @philn advice and try to figure out how to use the mailing list to post the issue there. Learning a lot of new things.

from cog.

gil0109 avatar gil0109 commented on July 22, 2024

Great news... COG is running successfully with the variables set on a read-only-rootfs.

Thank you for your help!!

export XDG_CACHE_HOME=/tmp
export XDG_DATA_HOME=/tmp
export XDG_CONFIG_HOME=/tmp
export XDG_RUNTIME_DIR=/tmp
export XDG_DATA_DIRS=/tmp
export XDG_RUNTIME_DIR=/tmp
exec /usr/bin/cog ${URL}

from cog.

aperezdc avatar aperezdc commented on July 22, 2024

@gil0109 Thanks for confirming that you got it working 👍

I think we can now close this issue.

from cog.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.