Repository navigation
Rewrite in Go - #318
Rewrite in Go#318
Conversation
|
So first: Let's try to get a vote among contributors here - do you really really want Go? I think the code in #319 is pretty good, Rust's "structopt" is a lot nicer than anything Go can do, etc. But, if you don't know Rust (and don't have the time to learn), that's a totally valid argument against. Go is very easy to learn. It's also valid that podman is in Go. But I'd hope people at least take a careful look at the toolbox-rs code and think about it! But I write Go a lot, and I just really dislike the language. The "Go strength" in web services doesn't apply here at all. On the other hand, hopefully this project doesn't exceed 2000 lines, so it doesn't matter too much. |
I really want to learn more rust and I like the concept of the language.
I think these points are the biggest one in favor of Go and why we have centered on go in previous discussions.
+1 - I looked at it earlier today. I don't quite understand it, because I don't know rust, but it at least looks nice.
Understood.
Agree, Either one should be fine implmentations for this. We should hoist advanced features back into podman. |
|
Switching to either opens opportunities for me to contribute to the code (I can't write bash). However, toolbox not in a vacuum and entire container domain is almost Go-exclusive, which is not exactly good, but means moving toolbox to Go would attract more contributions from people that already work on container projects and also new people (Go is really easy to get started with, after all). Podman being in Go is really important point. Still, it seems to me an even better option is a scripting/interpreted language. As a wrapper around a complete container solution (podman), I'm not sure what benefit there will be from features of a compiled language like Rust or Go (performance, advanced memory management, complex data representations, direct system calls, etc.). I would make many points in favor of Python, but as I understood because of CoreOS it's a no-go. Is it the case? |
It is true that the CoreOS team has a goal of keeping Python out of the base. See https://github.com/coreos/fedora-coreos-tracker/blob/master/Design.md#approach-towards-shipping-python |
e667f44 to
1501b09
Compare
I see, thanks for the reference. Python is not an option then (unless you feel like freezing binaries) :( So to me it seems Go has more advantages if starting from scratch. At the same time there is cgwalters/coretoolbox which is an already functional implementation. Between the two, I'm not sure what I would choose. Very curious to see how this decision goes. |
|
If you pick Go, I'd also suggest to use podman directly from the CLI, or alternatively through varlink. The |
Yes. Agree. This is something we had previously discussed as well and we agreed to not vendor libpod. |
9542708 to
58e3dac
Compare
58e3dac to
e00462d
Compare
|
Merge Failed. This change or one of its cross-repo dependencies was unable to be automatically merged with the current state of its repository. Please rebase the change and upload a new patchset. |
004df35 to
1d53152
Compare
|
Merge Failed. This change or one of its cross-repo dependencies was unable to be automatically merged with the current state of its repository. Please rebase the change and upload a new patchset. |
1d53152 to
43230a4
Compare
|
Merge Failed. This change or one of its cross-repo dependencies was unable to be automatically merged with the current state of its repository. Please rebase the change and upload a new patchset. |
43230a4 to
462abda
Compare
|
Merge Failed. This change or one of its cross-repo dependencies was unable to be automatically merged with the current state of its repository. Please rebase the change and upload a new patchset. |
462abda to
1599d7d
Compare
|
Merge Failed. This change or one of its cross-repo dependencies was unable to be automatically merged with the current state of its repository. Please rebase the change and upload a new patchset. |
1 similar comment
|
Merge Failed. This change or one of its cross-repo dependencies was unable to be automatically merged with the current state of its repository. Please rebase the change and upload a new patchset. |
... based on the default values, and those overridden by the user. containers#318
The Go version supports specifying the name of the new toolbox container as 'toolbox create NAME', in addition to the existing 'toolbox create --container NAME' form. containers#318
For some reason, the State:Pid value in the JSON returned by 'podman inspect --format json --type container' is a float64 [1], even though internally Podman represents it as an int. [1] podman-container-tools/podman#6105 containers#318
The Go version supports specifying the name of the toolbox container as 'toolbox enter NAME', on top of the 'toolbox enter --container NAME' form. containers#318
|
No way! :D |
This is where the Go rewrite is happening. I welcome any kind of comment/contribution.
The shell script has been renamed to toolbox.sh so that toolbox.go can
be compiled.
The new codebase is based on Cobra which takes care of the CLI heavy lifting.