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

Info [move content catalogs to reside in /library] #3052

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

jvonau
Copy link
Contributor

@jvonau jvonau commented Nov 27, 2021

move the catalogs to reside in /library

@holta holta changed the title Info Info [move content catalogs to reside in /library] Nov 27, 2021
@holta holta added this to the 8.0 milestone Nov 27, 2021
@holta
Copy link
Member

holta commented Nov 27, 2021

Interesting idea.

If there was ever an IIAB containing /library2 and /library3 (detachable drives possibly?) this could help make the lineage of all content (within each detachable drive?) more clear?

@tim-moody
Copy link
Contributor

what problem does this solve?

@jvonau
Copy link
Contributor Author

jvonau commented Nov 27, 2021

what problem does this solve?

No problem just better engineering

Interesting idea.

If there was ever an IIAB containing /library2 and /library3 (detachable drives possibly?) this could help make the lineage of all content (within each detachable drive?) more clear?

Well sort of, not so much concurrently using multiple /libraryX rather grouping of the info of what is contained under /library, used to be on a different partition just want to keep the metadata closer to the data. I propose that returning to the complete isolation of /library via a loop-backed filesystem proposed in #3051 we can gain easy portability of the 'data partition' within iiab with backing up one file being the main advantage. The data is architecture and OS agnostic should be able to export/import the data image file from one machine to another by just copying the 'data partition' and mounting the image file at /library. The advanced aspects of this design would allow creation of the 'data image' on one machine for deployment with multiple reuse on others, think of a finished preset ready to re-deploy on any machine with just one file to move into place. Using the image file method one can set a hard limit on how big /library can get.

@tim-moody
Copy link
Contributor

I don't regard metadata that is intended to be consumed by a machine as in the same category as html that is intended to be consumed by a human, My understanding of the info directory is that it holds documentation in html for reading by a human.

In terms of restructuring, do you plan to move all of /etc/iiab to /library? For me ini, xml, and json are in similar categories.

@jvonau
Copy link
Contributor Author

jvonau commented Nov 27, 2021

There is a movement upstream that would like to see /etc/ be devoid of most files and mounted read-only, the move of /etc/iiab -> /library/info would be in line with that thinking. Sure that is possible but would entail altering the 'iiab' curl script for the new location I didn't want to go that far in one shot but if that is a goal it is reachable.

@tim-moody
Copy link
Contributor

There is a movement upstream that would like to see /etc/ be devoid of most files and mounted read-only

don't many apps have configuration files in /etc/, apache2, nginx, php, mysql, ssh, to mention a few? do they all have to move?

@jvonau
Copy link
Contributor Author

jvonau commented Nov 27, 2021

Ah, light bulb moment users read docs served up at http://box/info stored at /library/www/html/info is what Tim is referring to while /library/info as I propose is a different physical path on the filesystem.

There is a movement upstream that would like to see /etc/ be devoid of most files and mounted read-only

don't many apps have configuration files in /etc/, apache2, nginx, php, mysql, ssh, to mention a few? do they all have to move?

What the future holds is fuzzy as the disros juggle things around, I don't see the files 'moving' soon but I can see /etc/ being read-only and files introduced using a bindmount routine like how snaps are put together.

@holta
Copy link
Member

holta commented Dec 8, 2021

I don't fully understand the /library/iiab proposal just yet, so my apologies I can't comment intelligently.

But no matter what path/directory is chosen in the end (/library/etc or /library/catalogs or whatever makes most sense) to store these settings/catalog files — we should try to align the variable name (the variable that's currently named content_info) to correspond to that actual path.

As best we can anyway! Background below from: https://github.com/jvonau/iiab/blob/46d9191bacacd0e58a05fc637ebc09802b502674/vars/default_vars.yml#L36-L37 :

content_base: /library
content_info: "{{ content_base }}/iiab"

@jvonau
Copy link
Contributor Author

jvonau commented Dec 8, 2021

I don't regard metadata that is intended to be consumed by a machine as in the same category as html that is intended to be consumed by a human, My understanding of the info directory is that it holds documentation in html for reading by a human.

Sure I can see the confusion, moved away from naming the directory "info" to using "iiab"

In terms of restructuring, do you plan to move all of /etc/iiab to /library? For me ini, xml, and json are in similar categories.

/etc/iiab -> /etc/local/iiab would make sense but that has to come with a change to the 'iiab" curl script, not required to have but should be on the to-do list.

Extracted from #3051 (comment)

jvonau@box:/media/usb1/output$ grep lrw maps-manifest.txt
lrwxrwxrwx 1 root     root           18 Dec  5 08:47 /library/www/html/common/assets/iiab.ini -> /etc/iiab/iiab.ini
lrwxrwxrwx 1 root     root           28 Dec  5 09:04 /library/www/html/common/assets/kiwix_catalog.json -> /etc/iiab/kiwix_catalog.json
lrwxrwxrwx 1 root     root           26 Dec  5 11:39 /library/www/html/common/assets/map-catalog.json -> /etc/iiab/map-catalog.json
lrwxrwxrwx 1 root     root           29 Dec  5 09:04 /library/www/html/common/assets/oer2go_catalog.json -> /etc/iiab/oer2go_catalog.json
lrwxrwxrwx 1 root     root           22 Dec  5 08:58 /library/www/html/common/assets/regions.json -> /etc/iiab/regions.json
lrwxrwxrwx 1 root     root           57 Dec  5 11:41 /library/www/osm-vector-maps/maplist/assets/bboxes.geojson -> /library/www/osm-vector-maps/viewer/assets/bboxes.geojson
lrwxrwxrwx 1 root     root           57 Dec  5 11:41 /library/www/osm-vector-maps/maplist/assets/countries.json -> /library/www/osm-vector-maps/viewer/assets/countries.json
lrwxrwxrwx 1 root     root           22 Dec  5 11:39 /library/www/osm-vector-maps/maplist/assets/regions.json -> /etc/iiab/regions.json
lrwxrwxrwx 1 root     root           26 Dec  5 11:39 /library/www/osm-vector-maps/test-page/assets/map-catalog.json -> /etc/iiab/map-catalog.json
lrwxrwxrwx 1 root     root           64 Dec  5 11:40 /library/www/osm-vector-maps/viewer/tiles/planet_z0-z6_2019.mbtiles -> /library/www/osm-vector-maps/installer/planet_z0-z6_2019.mbtiles

Would like to thank the effort put into soft-coding, made for juggling these 4 json file pretty straight forward. Think this PR and the companion one in iiab.-admin can be curl tested soon. I'll give that a spin and let you know.

@tim-moody
Copy link
Contributor

/etc/iiab -> /etc/local/iiab would make sense

I take it this is on the model of /usr/local/bin, etc. will that be read only?

If there was ever an IIAB containing /library2 and /library3 (detachable drives possibly?) this could help make the lineage of all content (within each detachable drive?) more clear?

need to be careful about catalogs vs locally installed content, both are metadata but have different scope. library.xml records all zims installed, but that is different from the zim catalog downloaded from kiwix. btw, adm cons creates a local library.xml on any usb attached drive to allow copying of content on and off of the drive. for now there is no oer2go equivalent of library.xml, but it will probably be needed one day.

I'm still not clear why all of a sudden these catalogs need to be moved, but ini and other xml files don't.

@tim-moody
Copy link
Contributor

Think this PR and the companion one in iiab.-admin can be curl tested soon. I'll give that a spin and let you know.

@holta please report what you tested along with the results. The impact goes substantially beyond ansible.

@holta
Copy link
Member

holta commented Dec 9, 2021

@tim-moody wrote:

@holta please report what you tested along with the results. The impact goes substantially beyond ansible.

I haven't tested this PR to date.

(Did you mean to ask @jvonau?)

@jvonau
Copy link
Contributor Author

jvonau commented Dec 9, 2021

/etc/iiab -> /etc/local/iiab would make sense

That should of been /usr/local/etc/iiab/, slight brain cramp with the quick reply.

I take it this is on the model of /usr/local/bin, etc. will that be read only?

No, but better adherence to https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard, note the /usr/local/

If there was ever an IIAB containing /library2 and /library3 (detachable drives possibly?) this could help make the lineage of all content (within each detachable drive?) more clear?

need to be careful about catalogs vs locally installed content, both are metadata but have different scope. library.xml records all zims installed, but that is different from the zim catalog downloaded from kiwix. btw, adm cons creates a local library.xml on any usb attached drive to allow copying of content on and off of the drive. for now there is no oer2go equivalent of library.xml, but it will probably be needed one day.

I'm still not clear why all of a sudden these catalogs need to be moved, but ini and other xml files don't.

Much for the same reason local_vars were suddenly renamed, before release. Now json is primarily used for transmitting data between a web application and a server, has much more to do with other data within /library and interfacing with the webserver than residing in /etc. Symlinks are provided within /etc/iiab to the new locations to cover some of the butt encase I missed something and keeps the docs the same.

And I'm giving this the combined curl test curl d.iiab.io/install.txt | sudo bash -s 3052 348 as I type this, I'll sum it up in tomorrow's meeting.

@jvonau
Copy link
Contributor Author

jvonau commented Dec 9, 2021

Installed and running at 10.8.0.74, http://sprunge.us/9cOQRh
After selecting the 'test' preset I can see the jobs queue. I can see the modules selected/tagged as downloading but artofproblemsolving_en_all_maxi zim file is not being shown as ticked off. Waiting on the jobs.

@jvonau
Copy link
Contributor Author

jvonau commented Dec 9, 2021

Noted that kalite was installed by the 'test' preset but not the en.zip just the es.zip, by design? all 14 jobs completed.

@tim-moody
Copy link
Contributor

Noted that kalite was installed by the 'test' preset but not the en.zip just the es.zip, by design? all 14 jobs completed

That would be a bug. I assume this was not on an image that already had kalite. The EN lang pack is not installed if already present.

@tim-moody
Copy link
Contributor

@holta

I haven't tested this PR to date.
(Did you mean to ask @jvonau?)

I got lost on the thread and thought you had volunteered to test.

@jvonau
Copy link
Contributor Author

jvonau commented Dec 9, 2021

Noted that kalite was installed by the 'test' preset but not the en.zip just the es.zip, by design? all 14 jobs completed

That would be a bug. I assume this was not on an image that already had kalite. The EN lang pack is not installed if already present.

No bug, the install flags are present. IP moved now at 10.8.0.86

@tim-moody
Copy link
Contributor

No bug

? si o no

I notice in the kalite admin that the en lang pack seems to be installed.

@jvonau
Copy link
Contributor Author

jvonau commented Dec 9, 2021

I had to scroll down slightly to be able to see the drop-down language box near the bottom, both are present within kalite.

@holta holta modified the milestones: 8.1, 8.0 May 30, 2022
whitespace
@holta
Copy link
Member

holta commented May 30, 2022

Whether or not this PR #3052 should be part of IIAB 8.0 I've relabeled it, so these design questions are at least more findable ✔️

correct - use {{ content_info }}
@holta holta modified the milestones: 8.0, 8.1 Oct 23, 2022
@holta holta modified the milestones: 8.1, 8.2 Jan 1, 2023
@holta holta modified the milestones: 8.2, 8.3 Jan 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants