[yast-devel] YaST Runlevel in Ruby
Hi, Last week, I've decided to start a pilot project: YaST Runlevel written completely in Ruby. I've just got it to the state when I dare to publish it :) Please try... See the project here: https://github.com/kobliha/yast-runlevel-ruby How to run sudo cp src/runlevel-ruby.rb /usr/share/YaST2/clients/ sudo yast2 runlevel-ruby Right now, it - lists services you can modify (enabled or disabled) - shows their current state - offers to start/stop or disable/enable them - can save the current configuration What is missing - dependencies: install yast2.rpm from YaST:Head:ruby at build.opensuse.org - whole packaging into RPM/Gem - setting the default target (default runlevel) Comments and patches are welcomed! :) It was really easy to write such YaST module in Ruby. I'll blog about it later. Bye Lukas -- Lukas Ocilka, Cloud & Systems Management Department SUSE LINUX s.r.o., Praha -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org
V Tue, 18 Jun 2013 11:21:49 +0200 Lukas Ocilka <lukas.ocilka@suse.com> napsáno:
Hi,
Last week, I've decided to start a pilot project: YaST Runlevel written completely in Ruby. I've just got it to the state when I dare to publish it :) Please try... ...
Comments and patches are welcomed! :) It was really easy to write such YaST module in Ruby. I'll blog about it later.
Good step! Few questions/notes: - Does this mean current yast2-runlevel will be completely dropped and replaced by this new one? - Do you keep current API of modules that are part of yast2-runlevel? (subquestion: what about installation?) - What about parts that belong to yast2 package but logically belong to same group (Service.ycp, mostly), will they get rewritten the same way, or do they stay automatically translated? - Please release working package asap. Current y2-runlevel is mostly unusable and we have to offer new/fixed one for early 13.1 testing. Jiri -- Jiri Suchomel SUSE LINUX, s.r.o. Lihovarská 1060/12 tel: +420 284 028 960 190 00 Praha 9, Czech Republic http://www.suse.cz -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org
On 18/06/13 11:48, Jiří Suchomel wrote:
V Tue, 18 Jun 2013 11:21:49 +0200 Lukas Ocilka <lukas.ocilka@suse.com> napsáno:
Great work Lukas... some comments: Why the name runlevel? that is a leftover concept from SystemV. Why not using the systemd nomenclature? (services and targets). As the code is not translated, the code is a good start point for discussing guidelines for future code. - Enums are usually implemented with simple symbols instead of string constants. What will YaST use? - Hashes vs Struct or classes (this is not a rule, but it would be good to have guidelines when one or the others will be used) - Inconsistent usage of ! for methods: eg: "save" does not have one (mostly coming from the limitation that data is a hash and the method is wrapped instead of being in the object itself) - Inconsistent usage of single and double quotes - documentation. Standard rdoc? yard? Cheers -- Duncan Mac-Vicar P. - http://www.suse.com/ SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg) Maxfeldstraße 5, 90409 Nürnberg, Germany -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org
On Tue, 18 Jun 2013 12:23:16 +0200 "Duncan Mac-Vicar P." <dmacvicar@suse.de> wrote:
On 18/06/13 11:48, Jiří Suchomel wrote:
V Tue, 18 Jun 2013 11:21:49 +0200 Lukas Ocilka <lukas.ocilka@suse.com> napsáno:
Great work Lukas...
some comments:
Why the name runlevel? that is a leftover concept from SystemV. Why not using the systemd nomenclature? (services and targets).
As the code is not translated, the code is a good start point for discussing guidelines for future code.
for code guidelines I prefer to use suse guidelines that is based on ruby guideline - https://github.com/SUSE/style-guides/blob/master/Ruby.md
- Enums are usually implemented with simple symbols instead of string constants. What will YaST use?
for new code I hope, that ruby conventions and practices can be used.
- Hashes vs Struct or classes (this is not a rule, but it would be good to have guidelines when one or the others will be used)
Well, I like Structs or classes and I think it should be used. Only difference is that on border between modules you should pass Hash ( of course I can add some support to ruby bindings to call something like to_hash on class or Struct and do it automatic, but deserialization is much harder ).
- Inconsistent usage of ! for methods: eg: "save" does not have one (mostly coming from the limitation that data is a hash and the method is wrapped instead of being in the object itself)
I am not sure if Y2 support exclamation mark, if so, then there is no reason to not use it. Of course we need to consider for existing modules backward compatibility.
- Inconsistent usage of single and double quotes
Well, I hope that ruby world have it already solved and I don't see here big issue. Both is suitable for me and even combination.
- documentation. Standard rdoc? yard?
I prefer yard, especially because I hope we will have online generated documentation ( not part of ycp killing project, but it will be useful ). Josef
Cheers
-- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org
On 06/18/2013 12:23 PM, Duncan Mac-Vicar P. wrote:
On 18/06/13 11:48, Jiří Suchomel wrote:
V Tue, 18 Jun 2013 11:21:49 +0200 Lukas Ocilka <lukas.ocilka@suse.com> napsáno:
Great work Lukas...
some comments:
Why the name runlevel? that is a leftover concept from SystemV. Why not using the systemd nomenclature? (services and targets).
Project name has been chosen just to tell what and how it replaces. Even then I knew I would rename it later. Would yast-services-manager sound better :)?
As the code is not translated, the code is a good start point for discussing guidelines for future code.
Exactly, these guidelines are currently quite unclear. At least for newcomers.
- Enums are usually implemented with simple symbols instead of string constants. What will YaST use?
I will leave this for the team.
- Hashes vs Struct or classes (this is not a rule, but it would be good to have guidelines when one or the others will be used)
This comes from the fact that data should be outside in Service module which is still written in YCP (as you can see, there's a note that it should be moved to Service module). And yes, I plan to iteratively rewrite it to Class/es. Right now, the code is as simple as possible and that's why it's in one file only.
- Inconsistent usage of ! for methods: eg: "save" does not have one (mostly coming from the limitation that data is a hash and the method is wrapped instead of being in the object itself)
Yes, I use "!" and "?" in getters and setters only.
- Inconsistent usage of single and double quotes
It might look like so, but double quotes are (yes, mostly) used only where string interpolation is required, otherwise I used single ones.
- documentation. Standard rdoc? yard?
I will leave this for the team. Thanks Lukas -- Lukas Ocilka, Cloud & Systems Management Department SUSE LINUX s.r.o., Praha -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org
On 06/18/2013 11:48 AM, JiříSuchomel wrote:
V Tue, 18 Jun 2013 11:21:49 +0200 Lukas Ocilka <lukas.ocilka@suse.com> napsáno:
Hi,
Last week, I've decided to start a pilot project: YaST Runlevel written completely in Ruby. I've just got it to the state when I dare to publish it :) Please try... ...
Comments and patches are welcomed! :) It was really easy to write such YaST module in Ruby. I'll blog about it later.
Good step!
Few questions/notes: - Does this mean current yast2-runlevel will be completely dropped and replaced by this new one?
I think so. As I said, it's a pilot project but selected on its necessity.
- Do you keep current API of modules that are part of yast2-runlevel? (subquestion: what about installation?)
No, there's no public API now/yet. It's a simple project to write some YaST module from scratch as fast as possible.
- What about parts that belong to yast2 package but logically belong to same group (Service.ycp, mostly), will they get rewritten the same way, or do they stay automatically translated?
They will be translated by the Kill-YCP project. As you can see, they are currently used directly from my code. Depending on their futural state, I'll either clean them up or rewrite them from scratch.
- Please release working package asap. Current y2-runlevel is mostly unusable and we have to offer new/fixed one for early 13.1 testing.
It's open-source (although I have to state it in sources). I expect others to participate as well if they want to. Thanks for your comments Lukas -- Lukas Ocilka, Cloud & Systems Management Department SUSE LINUX s.r.o., Praha -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org
El 18/06/13 05:21, Lukas Ocilka escribió:
Hi,
Last week, I've decided to start a pilot project: YaST Runlevel written completely in Ruby. I've just got it to the state when I dare to publish it :) Please try...
See the project here: https://github.com/kobliha/yast-runlevel-ruby
How to run sudo cp src/runlevel-ruby.rb /usr/share/YaST2/clients/ sudo yast2 runlevel-ruby
Right now, it - lists services you can modify (enabled or disabled) - shows their current state - offers to start/stop or disable/enable them - can save the current configuration
What is missing - dependencies: install yast2.rpm from YaST:Head:ruby at build.opensuse.org - whole packaging into RPM/Gem - setting the default target (default runlevel)
Comments and patches are welcomed! :) It was really easy to write such YaST module in Ruby. I'll blog about it later.
Yes I have comments ;) - I suggest not to use the "runlevel" name anywhere. - I strongly suggest that you do not call systemctl from the module, this is the most important part, please use the systemd dbus api for YAST. - You can currently do all operations except setting the default target using the DBUS-API , this limitation has been corrected recently and a systemd supporting this operation will land later in factory. -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org
On 06/18/2013 05:52 PM, Cristian Rodríguez wrote:
El 18/06/13 05:21, Lukas Ocilka escribió: Yes I have comments ;)
Thanks!
- I suggest not to use the "runlevel" name anywhere.
Yep, already suggested by Duncan. Runlevel-Ruby is a Work In Progress name bound to be changed.
- I strongly suggest that you do not call systemctl from the module, this is the most important part, please use the systemd dbus api for YAST.
I've thoroughly went through all the pros and cons and I will not use D-BUS API as it's too low level and I would need to create special high-level API (library) to be used from YaST, plus I would need to maintain it. Using D-BUS API is similar to creating sockets and all the handling just to download a file if I could simply use Net::HTTP.get instead. Anyway, if there was a library (that could be used from Ruby) using D-BUS API, I would use it. I could not find any and it seems such library doesn't exist. BTW, implementation sounds like a nice HackWeek or Workshop project.
- You can currently do all operations except setting the default target using the DBUS-API , this limitation has been corrected recently and a systemd supporting this operation will land later in factory.
Right now, I have to create a symlink anyway. I wonder why nobody objected that commandline doesn't support setting the default target. Bye Lukas -- Lukas Ocilka, Cloud & Systems Management Department SUSE LINUX s.r.o., Praha -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org
On Wed, Jun 19, 2013 at 11:17 AM, Lukas Ocilka <lukas.ocilka@suse.com> wrote:
- I strongly suggest that you do not call systemctl from the module, this is the most important part, please use the systemd dbus api for YAST.
I've thoroughly went through all the pros and cons and I will not use D-BUS API as it's too low level and I would need to create special high-level API (library) to be used from YaST, plus I would need to maintain it.
Using D-BUS API is similar to creating sockets and all the handling just to download a file if I could simply use Net::HTTP.get instead.
Anyway, if there was a library (that could be used from Ruby) using D-BUS API, I would use it.
Do you mean systemd specific bindings? -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org
On 06/19/2013 09:30 AM, Andrey Borzenkov wrote:
On Wed, Jun 19, 2013 at 11:17 AM, Lukas Ocilka <lukas.ocilka@suse.com> wrote:
- I strongly suggest that you do not call systemctl from the module, this is the most important part, please use the systemd dbus api for YAST.
I've thoroughly went through all the pros and cons and I will not use D-BUS API as it's too low level and I would need to create special high-level API (library) to be used from YaST, plus I would need to maintain it.
Using D-BUS API is similar to creating sockets and all the handling just to download a file if I could simply use Net::HTTP.get instead.
Anyway, if there was a library (that could be used from Ruby) using D-BUS API, I would use it.
Do you mean systemd specific bindings?
Yes, systemd specific. Of course, ruby-dbus exists. -- Lukas Ocilka, Cloud & Systems Management Department SUSE LINUX s.r.o., Praha -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org
On 06/18/2013 11:21 AM, Lukas Ocilka wrote:
Hi,
Last week, I've decided to start a pilot project: YaST Runlevel written completely in Ruby. I've just got it to the state when I dare to publish it :) Please try...
See the project here: https://github.com/kobliha/yast-runlevel-ruby
According to comments, I've just renamed it to YaST Services Manager And the new URL is https://github.com/kobliha/yast-services-manager Bye Lukas -- Lukas Ocilka, Cloud & Systems Management Department SUSE LINUX s.r.o., Praha -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org
On 06/19/2013 03:31 PM, Lukas Ocilka wrote:
According to comments, I've just renamed it to
YaST Services Manager
And the new URL is
You've probably seen my blogpost about Yast Services Manager at: http://kobliha-suse.blogspot.cz/2013/06/yast-runlevel-is-dead-long-live-yast... Some have tried that but one user run into this issue: --- cut --- I add yast:head repo and install yast-services-manager byt now yast dont work. On QT interface say: http://paste.kde.org/784232/ and on console say: http://paste.kde.org/784238/ Is any solution for me? --- cut --- It seems we either had it just half-build or maybe broken dependencies. Any idea what could have went wrong? Any simple fix? Thanks in advance Lukas -- Lukas Ocilka, Cloud & Systems Management Department SUSE LINUX s.r.o., Praha -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org
On 06/19/2013 03:31 PM, Lukas Ocilka wrote:
According to comments, I've just renamed it to
YaST Services Manager
And the new URL is
You've probably seen my blogpost about Yast Services Manager at:
http://kobliha-suse.blogspot.cz/2013/06/yast-runlevel-is-dead-long-live-yast...
Some have tried that but one user run into this issue:
--- cut --- I add yast:head repo and install yast-services-manager byt now yast dont work. On QT interface say: http://paste.kde.org/784232/ and on console say: http://paste.kde.org/784238/
Is any solution for me? --- cut ---
It seems we either had it just half-build or maybe broken dependencies. Any idea what could have went wrong? Any simple fix?
On 06/28/2013 09:47 AM, Lukas Ocilka wrote: libyui-qt and libyui-ncurses need to be installed. In ycp-yast the package yast2-ycp-ui-bindings is also required, dunno how this works in ruby-yast. Cheers, Thomas
Thanks in advance Lukas
-- Thomas Goettlicher SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg) Maxfeldstraße 5 90409 Nürnberg Germany -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org
On Fri, 28 Jun 2013 09:52:44 +0200 Thomas Goettlicher <tgoettlicher@suse.de> wrote:
On 06/19/2013 03:31 PM, Lukas Ocilka wrote:
According to comments, I've just renamed it to
YaST Services Manager
And the new URL is
You've probably seen my blogpost about Yast Services Manager at:
http://kobliha-suse.blogspot.cz/2013/06/yast-runlevel-is-dead-long-live-yast...
Some have tried that but one user run into this issue:
--- cut --- I add yast:head repo and install yast-services-manager byt now yast dont work. On QT interface say: http://paste.kde.org/784232/ and on console say: http://paste.kde.org/784238/
Is any solution for me? --- cut ---
It seems we either had it just half-build or maybe broken dependencies. Any idea what could have went wrong? Any simple fix?
On 06/28/2013 09:47 AM, Lukas Ocilka wrote: libyui-qt and libyui-ncurses need to be installed. In ycp-yast the package yast2-ycp-ui-bindings is also required, dunno how this works in ruby-yast.
Ruby yast is exactly same. BTW UI bindings is in fact y2-ui-bindigns and not ycp, as it is connected to y2 component system and not directly into ycp language. For debugging I recommend to obtain y2log which can show problem and if it is still not clear, then Y2DEBUG can help debug internals. Josef
Cheers, Thomas
Thanks in advance Lukas
-- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org
participants (7)
-
Andrey Borzenkov
-
Cristian Rodríguez
-
Duncan Mac-Vicar P.
-
Jiří Suchomel
-
Josef Reidinger
-
Lukas Ocilka
-
Thomas Goettlicher