[Bug 38179] New: koha-common runtime dependency on yarn
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38179 Bug ID: 38179 Summary: koha-common runtime dependency on yarn Change sponsored?: --- Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: major Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: tomascohen@gmail.com QA Contact: testopia@bugs.koha-community.org On main as of bug 37303, for 24.11 onwards, in order to run: ```shell koha-translate --install <LANG> ``` Both `yarn` and `po2json` are required. A recollection of information about it: * Debian's version of node-po2json is not what we want: bug 37303 comment 21 => we don't want to be stuck with v0.4.5 * Yarn version might not be an issue * Node.js version could be an issue This change got reverted on 24.05.x (bug 38164) -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38179 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@gmail.com, | |katrin.fischer@bsz-bw.de, | |mtj@kohaaloha.com, | |tomascohen@gmail.com See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=38164 Depends on| |37303 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37303 [Bug 37303] Fuzzy translations displayed on the UI -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38179 --- Comment #1 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- One option here is to provide instructions for installing what is needed, as part of the install steps for Koha. Something like: ```shell # Add Node.js version 18 wget -O- -q https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key \ | gpg --dearmor \ | tee /usr/share/keyrings/nodesource.gpg >/dev/null \ && echo "deb [signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x nodistro main" > /etc/apt/sources.list.d/nodesource.list # Add Yarn repo echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list \ && wget -O- -q https://dl.yarnpkg.com/debian/pubkey.gpg \ | gpg --dearmor \ | tee /usr/share/keyrings/yarnkey.gpg >/dev/null \ && echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian stable main" | tee /etc/apt/sources.list.d/yarn.list # Pin nodejs version RUN echo "Package: nodejs" > /etc/apt/preferences.d/nodejs RUN echo "Pin: version 18.*" >> /etc/apt/preferences.d/nodejs RUN echo "Pin-Priority: 999" >> /etc/apt/preferences.d/nodejs # Install Node.js and Yarn apt-get update \ && apt-get -y install nodejs yarn # Install required tool yarn global add po2json ``` -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38179 --- Comment #2 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- One option here is to provide instructions for installing what is needed, as part of the install steps for Koha. Something like: ```shell # Add Node.js version 18 wget -O- -q https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key \ | gpg --dearmor \ | tee /usr/share/keyrings/nodesource.gpg >/dev/null \ && echo "deb [signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x nodistro main" > /etc/apt/sources.list.d/nodesource.list # Add Yarn repo echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list \ && wget -O- -q https://dl.yarnpkg.com/debian/pubkey.gpg \ | gpg --dearmor \ | tee /usr/share/keyrings/yarnkey.gpg >/dev/null \ && echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian stable main" | tee /etc/apt/sources.list.d/yarn.list # Pin nodejs version echo "Package: nodejs" > /etc/apt/preferences.d/nodejs echo "Pin: version 18.*" >> /etc/apt/preferences.d/nodejs RUN echo "Pin-Priority: 999" >> /etc/apt/preferences.d/nodejs # Install Node.js and Yarn apt-get update \ && apt-get -y install nodejs yarn # Install required tool yarn global add po2json ``` -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38179 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38179 --- Comment #3 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- One option here is to provide instructions for installing what is needed, as part of the install steps for Koha. Something like: ```shell # Add Node.js version 18 wget -O- -q https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key \ | gpg --dearmor \ | tee /usr/share/keyrings/nodesource.gpg >/dev/null \ && echo "deb [signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x nodistro main" > /etc/apt/sources.list.d/nodesource.list # Add Yarn repo echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list \ && wget -O- -q https://dl.yarnpkg.com/debian/pubkey.gpg \ | gpg --dearmor \ | tee /usr/share/keyrings/yarnkey.gpg >/dev/null \ && echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian stable main" | tee /etc/apt/sources.list.d/yarn.list # Pin nodejs version echo "Package: nodejs" > /etc/apt/preferences.d/nodejs echo "Pin: version 18.*" >> /etc/apt/preferences.d/nodejs echo "Pin-Priority: 999" >> /etc/apt/preferences.d/nodejs # Install Node.js and Yarn apt-get update \ && apt-get -y install nodejs yarn # Install required tool yarn global add po2json ``` -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38179 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kyle@bywatersolutions.com, | |martin.renvoize@ptfs-europe | |.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38179 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|major |blocker --- Comment #4 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- This is a blocker for release and needs to be resolved one way or another soon. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38179 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au --- Comment #5 from David Cook <dcook@prosentient.com.au> --- I'm not 100% sold on adding NodeJS to the prod dependencies, but I'm not 100% opposed either. There are pros and cons both ways, and I have included NodeJS on other non-Koha projects, because I've needed functionality in a prod install that I couldn't get elsewhere. I've provided a bunch of info on Comment 27 and Comment 28 of Bug 38164, which I'll summarize here: 1. I don't think that we need "yarn" in production. 2. We would need NodeJS as a prod dependency, and version is likely to be an issue, especially between Debian and Ubuntu and even within different versions of those OSes. (As Tomas notes, I think we'd have to mandate a NodeJS package version and specify how to get it.) 3. We can include "po2json" in our package.json, install it on our dev/build Koha servers, and bundle it into 1 single "po2json-bundle" script for production deployments, so that we don't pollute the whole server for this 1 little feature. (NOTE: We're already used to bundling things for installs, so this should be easy for the Koha community.) -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38179 --- Comment #6 from David Cook <dcook@prosentient.com.au> --- Note: for a "po2json-bundle", I'd suggest that it live in /usr/share/koha/bin/nodejs_tools or something like that. Something CLI-specific and non-web accessible. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38179 --- Comment #7 from Kyle M Hall (khall) <kyle@bywatersolutions.com> ---
3. We can include "po2json" in our package.json, install it on our dev/build Koha servers, and bundle it into 1 single "po2json-bundle" script for production deployments, so that we don't pollute the whole server for this 1 little feature. (NOTE: We're already used to bundling things for installs, so this should be easy for the Koha community.)
I like this. It could easily be automated as part of the build process. Could we go one step further and use node's single executable applications feature? -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38179 --- Comment #8 from David Cook <dcook@prosentient.com.au> --- (In reply to Kyle M Hall (khall) from comment #7)
I like this. It could easily be automated as part of the build process. Could we go one step further and use node's single executable applications feature?
I hadn't heard of that specific feature myself, but I was wondering if we could build a portable executable more broadly, so it would be great to try it out! -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38179 --- Comment #9 from David Cook <dcook@prosentient.com.au> --- It looks like the v18.19.0 node binary itself is 88MB alone, so the final size would be bigger than that. I don't know if we'd want to wedge that into our current koha-common package, as it could slow down deployments. But it would be easy enough to put it in its own Debian package. And for non-package installs, it wouldn't matter since it would just be installed like usual. So yeah... sounds good to me :) -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38179 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |In Discussion -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38179 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |julian.maurice@biblibre.com --- Comment #10 from Julian Maurice <julian.maurice@biblibre.com> --- Not against node in prod, but... are we really adding node, yarn and several npm dependencies to do the same thing as one single already existing Perl script (that does not require additional dependencies) ? What's the point ? I read that the Perl script was unmaintained. We could maintain it, it is/was already in our code base. I don't see how the chosen solution here is better, easier and/or less work than that. The "we will need node in prod at some point anyway" argument is not a convincing one to me. If we do need node at some point, then fine. But for PO to JSON conversion it is not needed. And I believe that the fact that bug 37303 was pushed without considering this is another sign that it should be reverted from main now. Big changes like this (adding node as prod dependency) should not be made in a hurry (and 24.11 will be released next month) -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38179 --- Comment #11 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- I think Julian has a valid point as we quickly run out of time that might be better spent elsewhere for this cycle. Could we push to fix this as a community project early next cycle maybe? Is there another use case than the translation scripts currently to include node/yarn etc.? -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38179 --- Comment #12 from Jonathan Druart <jonathan.druart@gmail.com> --- I feel like I need to clarify my position. On bug 37303 we found a quite bad bug impacting our translation system. It came from a script we embedded into our codebase that is no longer maintain upstream. And the project actually moved to a JS version. When I gave it a try, the issue was fixed and we didn't notice any other changes. It made sense to switch. I didn't anticipate that any problems will arise. No, we do not have time to dedicate to this for now. Yes, the single line patch (from Julian, bug 38164) is the way to go for 24.11. However it is good to know that we are not ready for node in production, and it would be good to spend time on it. At least to know if it's a solution we could deploy in case of a future emergency. For now there is no immediate need, but... who knows when it will come again? -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38179 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|blocker |normal --- Comment #13 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Hi Joubu and all, thanks for the clarification. I am going to push the solution from bug 38164 in this case and we will leave this open for the 25.05 cycle. Maybe we could already add the rel_25_05_candidate keyword to keep this in a more prominent spot? -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38179 Bug 38179 depends on bug 37303, which changed state. Bug 37303 Summary: Fuzzy translations displayed on the UI https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37303 What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |CLOSED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38179 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |rel_25_05_candidate -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38179 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|rel_25_05_candidate | --- Comment #14 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (In reply to Katrin Fischer from comment #13)
Hi Joubu and all,
thanks for the clarification. I am going to push the solution from bug 38164 in this case and we will leave this open for the 25.05 cycle.
Maybe we could already add the rel_25_05_candidate keyword to keep this in a more prominent spot?
This hasn't moved in the last months. I am removing the keyword as we will use it now to highlight enhancement that will still get reviewed/pushed after soft feature freeze. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38179 Paul Derscheid <paul.derscheid@lmscloud.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |paul.derscheid@lmscloud.de -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org