-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Container image lacks command used by Scylla scripts #17787
Comments
Currenly used 5.4.2 image is broken due to missing command (scylladb/scylladb#17787). 5.4.0 is latest version not affected by above bug.
Lack of systemctl is the least of the problems here - irqbalance is running in the host, not the container. We can add --restart-irqbalance Other problems:
This stuff really should run on the host. |
We are aware of it, we run perftune as privileged container inside host network namespace and we trick systemd by chrooting into host filesystem to make sure it restarts service running on the host. |
Well, then can't you pick up systemctl from the host? |
In theory we can, although it would be more fragile, as it we would have to worry about potential symlinks, non statically linked binaries, ABI incompatiblity. |
Currenly used 5.4.2 image is broken due to missing command (scylladb/scylladb#17787). 5.4.0 is latest version not affected by above bug.
But here you're violating it directly, by chrooting into the host filesystem. If you use systemctl from the image, then you'll have one version of systemctl talking to another version of systemd. |
I don't think this is great one way or the other. Remember, we don't control the host OS. Effectively, the host may not have python at all, so we can't copy perftune.py to the host (+ python libs would be a mess to copy correctly). So perftune has to be run from the container, which leaves us with: a) use systemctl from the container and rely on
|
I think we need to build a container with the needed tooling (which should not need systemd btw) to perform the initial configuration. A-la (or just use) NTO - node tuning operator (https://github.com/openshift/cluster-node-tuning-operator/tree/master ) and such. |
BTW, why is it trying to use systemd?
Maybe it needs to be invoked differently? |
irqbalancer is running on every AWS host as systemd service, not within container. We need to change its configuration on host to prevent it from messing around with our IRQ settings, and then initiate restart to pick it up, and we do it from the container. |
OK. Here's one way I'm aware of doing it - using nsenter - https://github.com/gluster/gluster-containers/blob/master/CentOS/exec-on-host.sh . |
I'm unsure why it got broken in 5.4.1 (scylla-5.4.0...scylla-5.4.1 ) - @yaronkaikov ? (btw, we use supervisor, where is systemctl coming from?) |
@syuu1228 Can you please have a look ? |
@syuu1228 - any updates? I'm mostly concerned how it got broken (do we know how). |
Well, Scylla Docker image does run perftune.py, since the script does not support container.
I checked 5.4.1 and 5.4.4 image, it does not executed perftune.py on startup. Also, about optimizing Host OS using perftune.py, I think user should install perftune.py and run it manually. |
It needs to be in its own privileged container, with its deps, perhaps, but we can't expect any other format other than a container (for K8S for example) |
This is not the case on Kubernetes. There are many nodes with an OS that doesn't have ScyllaDB repositories, not even the same packaging system (if any), or is immutable. We need to re-ship it in ScyllaDB container image as the change broke the images used with our operator. This isn't a question of whether we should add it but a bug to bring it back as it affects customers on newer versions. If we want to talk about a future path, I am open to it, but let's first fix the regression. |
@syuu1228 , @yaronkaikov - ping - where are we with this? I'd like to see it in a near-future 5.4.x. |
I was thinking maybe I need to rewrite perftune.py to support our container image which does not have neither systemd nor sysvinit, but I found that /etc/init.d/irqbalance actually able to use without any errors on our container image. After the fix applied, able to run perftne.py without an error:
Note that the container need to run with privileged mode and host mode network, like:
|
I don't understand why one would run |
K8S ... (however, one would argue even if it runs in a container, it should be running in its own, perhaps privileged, container, with nothing but the perftune scripts need to tune the system) |
It's not supposed to be executed from K8S containers either - for the same reasons. |
Why it's not supposed to be executed from container? Container is just another process spawned in different root with different namespaces. If someone launches perftune with host namespaces then it behaves the same as regular process running on host, being able to tune host system. I don't see why anyone would restrict it. |
Ah, this was wrong. So as we expected, user should install & run pertune.py on HostOS not the container. |
That's why you should mount host irqbalancer configuration in Bidirectional mode to change irqbalancer on host, not within the container. Again, perftune can be run from the container, but it needs special configuration. We know what we need to change, all we need is image to contain all dependency commands that perftune uses. |
|
I investigated what is the difference between 5.4.0 and 5.4.1 Docker image, since I have no idea how does it work in 5.4.0 and how it's break in 5.4.1. Both versions are using exactly same revision of perftune.py, only difference is installed package. I tested to run perftune.py with irqbalance on both version, both are causing error but 5.4.0 does not cause "No such file or directory 'systemctl'", since it has systemctl.
I am not sure this really can fix the problem (since it causing another error), but we can revert to the previous behavior if we add systemd package to the Docker image again. Also note that perftune.py will not try to restart irqbalance if it's not currently running:
|
Good findings @syuu1228 - but let's fix the real issue - we need perftune to work well here. If we are (re)adding systemd and just masking the issue, we are not solving anything here. |
Have you mounted host dbus inside the container so that it connects to host systemd? I think this should mimic what we do in Operator:
When
|
Why would we package systemctl in the container image? There isn't a systemd here. If you want a systemctl to talk to an outside systemd, bind-mount it (or some script to forward the command to the outside systemd). |
This was already covered in #17787 (comment) |
Can we please focus on distinguishing:
But those are separate tasks and I feel like the timeline for 1. is quite beyond what it should be. |
I wrote a scripts to implement this without changing perftune.py since this will very specific to Scylla Operator not generic usage of the container, here are the code: These two files are dummy irqbalance service which run in the container, let perftune.py to detect irqbalance is running:
And here is dummy /etc/init.d/irqbalance which perftune.py will invoke:
However, I found that nsenter actually cannot able to run HostOS's systemctl:
It can run basic command like |
On 7ce6962 we dropped openssh-server, it also dropped systemd package and caused an error on Scylla Operator (scylladb#17787). This reverts dropping systemd package and fix the issue. Fix scylladb#17787
As I described at #17787 (comment), the difference from 5.4.0 is dropping systemd package, so let's just add it again. And then we can continue disccuss how to perform IRQ tunup on Scylla Operator on differeunt issue, since it will not be urgent issue. |
I assume you still need to run it privileged. Which I keep re-iterating should be our long term solution - we run perftune and whatnot setup for the host as a separate, privileged container. |
I agree that if it's a regression we need to fix it first and come up with a better solution later. |
On 7ce6962 we dropped openssh-server, it also dropped systemd package and caused an error on Scylla Operator (scylladb#17787). This reverts dropping systemd package and fix the issue. Fix scylladb#17787
On 7ce6962 we dropped openssh-server, it also dropped systemd package and caused an error on Scylla Operator (scylladb#17787). This reverts dropping systemd package and fix the issue. Fix scylladb#17787
On 7ce6962 we dropped openssh-server, it also dropped systemd package and caused an error on Scylla Operator (scylladb#17787). This reverts dropping systemd package and fix the issue. Fix scylladb#17787 (cherry picked from commit 0c7aa93)
ScyllaDB container image doesn't have
systemctl
command installed, while this command is used byperftune.py
script shipped within the same image.https://github.com/scylladb/scylla-seastar/blob/9d44e5ebfb4c0fe54e2d6812a3968a2f629c34e0/scripts/perftune.py#L206
To reproduce:
This breaks node and container tuning in Scylla Operator.
Affected versions are 5.4.1 onwards - 5.4.0 is not affected.
The text was updated successfully, but these errors were encountered: