From fc1851cdc16f24623dcc452ef87ecfc7b97c8d0d Mon Sep 17 00:00:00 2001 From: Pekka Enberg Date: Tue, 21 Jul 2020 11:19:39 +0300 Subject: [PATCH] dist/docker: Add '--io-setup ENABLE' command line option This adds a '--io-setup N' command line option, which users can pass to specify whether they want to run the "scylla_io_setup" script or not. This is useful if users want to specify I/O settings themselves in environments such as Kubernetes, where running "iotune" is problematic. Fixes #6587 --- dist/docker/redhat/commandlineparser.py | 1 + dist/docker/redhat/scyllasetup.py | 4 +++- docs/docker-hub.md | 14 ++++++++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/dist/docker/redhat/commandlineparser.py b/dist/docker/redhat/commandlineparser.py index 4199310abf..410e1f0327 100644 --- a/dist/docker/redhat/commandlineparser.py +++ b/dist/docker/redhat/commandlineparser.py @@ -12,6 +12,7 @@ def parse(): parser.add_argument('--reserve-memory', default=None, dest='reserveMemory', help="e.g. --reserve-memory 1G to reserve 1 GB of RAM") parser.add_argument('--overprovisioned', default=None, choices=['0', '1'], help="run in overprovisioned environment. By default it will run in overprovisioned mode unless --cpuset is specified") + parser.add_argument('--io-setup', default='1', choices=['0', '1'], dest='io_setup', help='Run I/O setup (i.e. iotune) at container startup. Defaults to 1.') parser.add_argument('--listen-address', default=None, dest='listenAddress') parser.add_argument('--rpc-address', default=None, dest='rpcAddress') parser.add_argument('--broadcast-address', default=None, dest='broadcastAddress') diff --git a/dist/docker/redhat/scyllasetup.py b/dist/docker/redhat/scyllasetup.py index daefe841ef..205ea71b65 100644 --- a/dist/docker/redhat/scyllasetup.py +++ b/dist/docker/redhat/scyllasetup.py @@ -29,6 +29,7 @@ class ScyllaSetup: self._clusterName = arguments.clusterName self._endpointSnitch = arguments.endpointSnitch self._replaceAddressFirstBoot = arguments.replaceAddressFirstBoot + self._io_setup = arguments.io_setup def _run(self, *args, **kwargs): logging.info('running: {}'.format(args)) @@ -61,7 +62,8 @@ class ScyllaSetup: if not os.path.exists(data_dir): os.makedirs(data_dir) - self._run(['/opt/scylladb/scripts/scylla_io_setup']) + if self._io_setup == "1": + self._run(['/opt/scylladb/scripts/scylla_io_setup']) def cqlshrc(self): home = os.environ['HOME'] diff --git a/docs/docker-hub.md b/docs/docker-hub.md index 9f4c00433a..46de240f22 100644 --- a/docs/docker-hub.md +++ b/docs/docker-hub.md @@ -243,6 +243,20 @@ For example, to enable optimizations for running in an statically partitioned en $ docker run --name some-scylla -d scylladb/scylla --overprovisioned 0 ``` +### `--io-setup ENABLE` + +The `--io-setup` command line option specifies if the `scylla_io_setup` script is run when the container is started for the first time. +This is useful if users want to specify I/O settings themselves in environments such as Kubernetes, where running `iotune` is problematic. +The default of `--io-setup` is `1`, which means I/O setup is run. + +For example, to skip running I/O setup: + +```console +$ docker run --name some-scylla -d scylladb/scylla --io-setup 0 +``` + +**Since: 4.3** + ### `--cpuset CPUSET` The `--cpuset` command line option restricts Scylla to run on only on CPUs specified by `CPUSET`.