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

Enable kolibri-explore-plugin #26

Closed
dbnicholson opened this issue Sep 5, 2023 · 5 comments · Fixed by #37
Closed

Enable kolibri-explore-plugin #26

dbnicholson opened this issue Sep 5, 2023 · 5 comments · Fixed by #37
Assignees

Comments

@dbnicholson
Copy link
Member

Currently the app shows the default Kolibri interface with the learn plugin, but the differentiator for Endless Key is kolibri-explore-plugin. A few things are needed to get that going:

  • Kolibri needs to be updated to the 0.16 series (Add Kolibri 0.16.0b5 #9)
  • The explore plugin needs to be enabled and any relevant options set
  • We need to handle the welcome screen. Either we need to load the welcome screen before Kolibri and provide a Javascript interface in Webkit that let's the welcome screen code set the initial content pack (like is done in the Android and Windows apps), or we need to update the welcome screen code so it does this all from within Kolibri (Move welcome-screen to the core plugin code kolibri-explore-plugin#748). My preference is to fix the welcome screen code so that the Flatpak only needs to run Kolibri, but we might want a parallel effort in case that takes a bit to land.
@dbnicholson
Copy link
Member Author

Another thing that's needed is shipping the apps and collections bundles. However, one thing that will fall over is our practice of just taking the github artifact or tarball from the latest release or HEAD commit. flatpak-builder needs stable URLs and checksums. That's going to be a bit painful with our kolibri-explore-plugin release cadence.

@dbnicholson
Copy link
Member Author

I opened endlessm/endless-key-collections#31 so that you can at least get a released collections bundle without all of the tar filtering.

@dylanmccall dylanmccall self-assigned this Sep 8, 2023
@dylanmccall
Copy link
Contributor

For some reason, unzip inside flatpak-builder doesn't want to deal with that welcome-screen.zip archive. It very quietly fails like this:

Building module python3-kolibri-explore-plugin in /var/home/dylan/Code/endlessm/endless-key-flatpak/.flatpak-builder/build/python3-kolibri-explore-plugin-16
========================================================================
FB: Running: unzip -q /var/home/dylan/Code/endlessm/endless-key-flatpak/.flatpak-builder/downloads/0b0a7b417e1fbd07b9326a744bf41a12f5b3d29bfbe0cc3b9a96f22dbcdca63a/apps-bundle.zip
FB: Running: unzip -q /var/home/dylan/Code/endlessm/endless-key-flatpak/.flatpak-builder/downloads/bc01eb9ec8101f3333f0d03bba651ffddac059062a847bcc376d93f119708778/welcome-screen.zip
Error: module python3-kolibri-explore-plugin: Child process exited with code 81
FB: Unmounting read-only fs: fusermount -uz /var/home/dylan/Code/endlessm/endless-key-flatpak/.flatpak-builder/rofiles/rofiles-7YTJC5

According to the man page, error code 81 means:

testing or extraction of one or more files failed due to unsupported compression methods or unsupported decryption.

If I run unzip without -q, I get this output:

unzip /var/home/dylan/Code/endlessm/endless-key-flatpak/.flatpak-builder/downloads/bc01eb9ec8101f3333f0d03bba651ffddac059062a847bcc376d93f119708778/welcome-screen.zip
Archive:  /var/home/dylan/Code/endlessm/endless-key-flatpak/.flatpak-builder/downloads/bc01eb9ec8101f3333f0d03bba651ffddac059062a847bcc376d93f119708778/welcome-screen.zip
   skipping: favicon.ico             need PK compat. v6.3 (can do v4.6)
   skipping: index.html              need PK compat. v6.3 (can do v4.6)
   skipping: img/video.7a3fe8b2.png  need PK compat. v6.3 (can do v4.6)
   skipping: img/app.7bf7e9b0.png    need PK compat. v6.3 (can do v4.6)
   skipping: img/kolibri-logo.86b86b20.svg  need PK compat. v6.3 (can do v4.6)
   skipping: img/pack.a7996392.png   need PK compat. v6.3 (can do v4.6)
   skipping: img/audio.7081f096.png  need PK compat. v6.3 (can do v4.6)
   skipping: img/topic.05b84db7.png  need PK compat. v6.3 (can do v4.6)
   skipping: img/welcome-bg-bottom-left.72868caf.png  need PK compat. v6.3 (can do v4.6)
   skipping: img/EndlessLogo.2a211f31.svg  need PK compat. v6.3 (can do v4.6)
   skipping: img/usb-connect.75d0acc5.jpg  need PK compat. v6.3 (can do v4.6)
   skipping: img/document.94d8ca42.png  need PK compat. v6.3 (can do v4.6)
   skipping: img/scientist.87942048.jpg  need PK compat. v6.3 (can do v4.6)
   skipping: img/bundle.6f0a57f4.png  need PK compat. v6.3 (can do v4.6)
   skipping: img/inventor.a3be4906.jpg  need PK compat. v6.3 (can do v4.6)
   skipping: img/loading-animation.0776934b.gif  need PK compat. v6.3 (can do v4.6)
   skipping: img/exercise.d751f913.png  need PK compat. v6.3 (can do v4.6)
   skipping: img/artist.65564940.jpg  need PK compat. v6.3 (can do v4.6)
   skipping: img/usb-connected.60c24749.jpg  need PK compat. v6.3 (can do v4.6)
   skipping: img/welcome-bg-top-right.6fcd4aa1.png  need PK compat. v6.3 (can do v4.6)
   skipping: img/athlete.da26ad19.jpg  need PK compat. v6.3 (can do v4.6)
   skipping: img/curious.2b263842.jpg  need PK compat. v6.3 (can do v4.6)
   skipping: img/explorer.3f94f3fd.jpg  need PK compat. v6.3 (can do v4.6)
   skipping: fonts/poppins-devanagari-400-normal.790d0c8d.woff2  need PK compat. v6.3 (can do v4.6)
   skipping: fonts/poppins-latin-ext-400-normal.0ed299a4.woff2  need PK compat. v6.3 (can do v4.6)
   skipping: fonts/poppins-latin-400-normal.9212f6f9.woff2  need PK compat. v6.3 (can do v4.6)
   skipping: fonts/lato-latin-400-normal.e1b3b590.woff2  need PK compat. v6.3 (can do v4.6)
   skipping: fonts/poppins-all-400-normal.bbae9378.woff  need PK compat. v6.3 (can do v4.6)
   skipping: fonts/lato-all-400-normal.a82dcb33.woff  need PK compat. v6.3 (can do v4.6)
   skipping: fonts/lato-latin-ext-400-normal.4bde07f9.woff2  need PK compat. v6.3 (can do v4.6)
   skipping: js/app.9123969a.js      need PK compat. v6.3 (can do v4.6)
   skipping: js/chunk-vendors.dab0ce91.js  need PK compat. v6.3 (can do v4.6)
   skipping: css/app.3b68b24a.css    need PK compat. v6.3 (can do v4.6)
   skipping: css/chunk-vendors.cfbbb898.css  need PK compat. v6.3 (can do v4.6)

No such problem with apps-bundle.zip. Different zip implementations between them, I guess?

dylanmccall added a commit that referenced this issue Sep 9, 2023
This also includes apps-bundle.zip, which is released separately.

#26
dylanmccall added a commit that referenced this issue Sep 9, 2023
This is required for the onboarding system in kolibri-explore-plugin.

#26
@dbnicholson
Copy link
Member Author

No such problem with apps-bundle.zip. Different zip implementations between them, I guess?

That's unfortunate. It's because welcome-screen.zip and the channel zips within apps-bundle.zip are created with LZMA compression while the outer apps-bundle.zip is created with no compression. I ran into the same problem in a different way with chaquopy.

There's no reason welcome-screen.zip needs the full LZMA treatment. That zip is only used for initial delivery and will be expanded within all apps. Probably not the channel zips either, but there the zip files are used directly by Kolibri so you could make the argument that it helps.

Anyways, I'll put together a PR to tweak the welcome-screen.zip construction.

dbnicholson added a commit to endlessm/kolibri-explore-plugin that referenced this issue Sep 9, 2023
Having `bundle_zip` default to LZMA compression meant it also applied to
`welcome-screen-zip`. That's problematic since `unzip` can't handle that
compression scheme. It's also unnecessary as `welcome-screen.zip` is
only intended for releases. All of our apps will expand it into some
location in their package, so the compression used is irrelevant.

Instead, make the default zlib deflate compression and explicitly
request LZMA compression just for the channel templates. Note that the
outer `apps-bundle.zip` is actually created with no compression, which
is fine since it's entirely for distributing the already compressed
channel templates.

See endlessm/endless-key-flatpak#26.
dbnicholson added a commit to endlessm/kolibri-explore-plugin that referenced this issue Sep 9, 2023
Having `bundle_zip` default to LZMA compression meant it also applied to
`welcome-screen.zip`. That's problematic since `unzip` can't handle that
compression scheme. It's also unnecessary as `welcome-screen.zip` is
only intended for releases. All of our apps will expand it into some
location in their package, so the compression used is irrelevant.

Instead, make the default zlib deflate compression and explicitly
request LZMA compression just for the channel templates. Note that the
outer `apps-bundle.zip` is actually created with no compression, which
is fine since it's entirely for distributing the already compressed
channel templates.

See endlessm/endless-key-flatpak#26.
@dbnicholson
Copy link
Member Author

The change to only compress welcome-screen.zip with zlib was merged and released in 6.44.0. I think you should be able to carry on:

$ unzip -d welcomeScreen welcome-screen.zip 
Archive:  welcome-screen.zip
   creating: welcomeScreen/img/
   creating: welcomeScreen/fonts/
   creating: welcomeScreen/js/
  inflating: welcomeScreen/favicon.ico  
  inflating: welcomeScreen/index.html  
   creating: welcomeScreen/css/
  inflating: welcomeScreen/img/video.7a3fe8b2.png  
  inflating: welcomeScreen/img/app.7bf7e9b0.png  
  inflating: welcomeScreen/img/kolibri-logo.86b86b20.svg  
  inflating: welcomeScreen/img/pack.a7996392.png  
  inflating: welcomeScreen/img/audio.7081f096.png  
  inflating: welcomeScreen/img/topic.05b84db7.png  
  inflating: welcomeScreen/img/welcome-bg-bottom-left.72868caf.png  
  inflating: welcomeScreen/img/EndlessLogo.2a211f31.svg  
  inflating: welcomeScreen/img/usb-connect.75d0acc5.jpg  
  inflating: welcomeScreen/img/document.94d8ca42.png  
  inflating: welcomeScreen/img/scientist.87942048.jpg  
  inflating: welcomeScreen/img/bundle.6f0a57f4.png  
  inflating: welcomeScreen/img/inventor.a3be4906.jpg  
  inflating: welcomeScreen/img/loading-animation.0776934b.gif  
  inflating: welcomeScreen/img/exercise.d751f913.png  
  inflating: welcomeScreen/img/artist.65564940.jpg  
  inflating: welcomeScreen/img/usb-connected.60c24749.jpg  
  inflating: welcomeScreen/img/welcome-bg-top-right.6fcd4aa1.png  
  inflating: welcomeScreen/img/athlete.da26ad19.jpg  
  inflating: welcomeScreen/img/curious.2b263842.jpg  
  inflating: welcomeScreen/img/explorer.3f94f3fd.jpg  
  inflating: welcomeScreen/fonts/poppins-devanagari-400-normal.790d0c8d.woff2  
  inflating: welcomeScreen/fonts/poppins-latin-ext-400-normal.0ed299a4.woff2  
  inflating: welcomeScreen/fonts/poppins-latin-400-normal.9212f6f9.woff2  
  inflating: welcomeScreen/fonts/lato-latin-400-normal.e1b3b590.woff2  
  inflating: welcomeScreen/fonts/poppins-all-400-normal.bbae9378.woff  
  inflating: welcomeScreen/fonts/lato-all-400-normal.a82dcb33.woff  
  inflating: welcomeScreen/fonts/lato-latin-ext-400-normal.4bde07f9.woff2  
  inflating: welcomeScreen/js/app.9123969a.js  
  inflating: welcomeScreen/js/chunk-vendors.dab0ce91.js  
  inflating: welcomeScreen/css/app.3b68b24a.css  
  inflating: welcomeScreen/css/chunk-vendors.cfbbb898.css  

Since unzip hasn't changed in like 8 years, I'm pretty sure the version on Endless and the version in the runtime are roughly identical.

dylanmccall added a commit to endlessm/kolibri-explore-plugin that referenced this issue Sep 11, 2023
This makes it possible for a user to navigate back to the Discovery UI
from other parts of Kolibri.

Helps endlessm/endless-key-flatpak#26
dylanmccall added a commit to endlessm/kolibri-explore-plugin that referenced this issue Sep 11, 2023
This makes it possible for a user to navigate back to the Discovery UI
from other parts of Kolibri.

Helps: endlessm/endless-key-flatpak#26
dylanmccall added a commit to endlessm/kolibri-explore-plugin that referenced this issue Sep 11, 2023
When the default landing page is set to "Learn", Kolibri should redirect
to Explore for all users, including superusers. This is different from
the behaviour of the default Learn plugin.

Helps: endlessm/endless-key-flatpak#26
dylanmccall added a commit to endlessm/kolibri-explore-plugin that referenced this issue Sep 11, 2023
When the default landing page is set to "Learn", Kolibri should redirect
to Explore for all users, including superusers. This is different from
the behaviour of the default Learn plugin.

Helps: endlessm/endless-key-flatpak#26
dylanmccall added a commit that referenced this issue Sep 11, 2023
In order for kolibri_explore_plugin to redirect cleanly from Kolibri's
landing page, we disable the learn plugin as well.

#26
dylanmccall added a commit that referenced this issue Sep 11, 2023
We need to set some environment variables for kolibri_explore_plugin to
load apps bundles and content collections from the correct locations.

#26
dylanmccall added a commit that referenced this issue Sep 11, 2023
This also includes apps-bundle.zip, which is released separately.

#26
dylanmccall added a commit that referenced this issue Sep 11, 2023
This is required for the onboarding system in kolibri-explore-plugin.

#26
dylanmccall added a commit that referenced this issue Sep 11, 2023
In order for kolibri_explore_plugin to redirect cleanly from Kolibri's
landing page, we disable the learn plugin as well.

#26
dylanmccall added a commit that referenced this issue Sep 11, 2023
We need to set some environment variables for kolibri_explore_plugin to
load apps bundles and content collections from the correct locations.

#26
GeorgesStavracas pushed a commit that referenced this issue Sep 12, 2023
This also includes apps-bundle.zip, which is released separately.

#26
GeorgesStavracas pushed a commit that referenced this issue Sep 12, 2023
This is required for the onboarding system in kolibri-explore-plugin.

#26
GeorgesStavracas pushed a commit that referenced this issue Sep 12, 2023
In order for kolibri_explore_plugin to redirect cleanly from Kolibri's
landing page, we disable the learn plugin as well.

#26
GeorgesStavracas pushed a commit that referenced this issue Sep 12, 2023
We need to set some environment variables for kolibri_explore_plugin to
load apps bundles and content collections from the correct locations.

#26
dylanmccall added a commit to learningequality/kolibri-installer-gnome that referenced this issue Apr 24, 2024
dylanmccall added a commit to learningequality/kolibri-installer-gnome that referenced this issue May 4, 2024
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

Successfully merging a pull request may close this issue.

2 participants