Files
scylladb/dist/docker/redhat
Nadav Har'El c3da9f2bd4 alternator: add mandatory configurable write isolation mode
Alternator supports four ways in which write operations can use quorum
writes or LWT or both, which we called "write isolation policies".

Until this patch, Alternator defaulted to the most generally safe policy,
"always_use_lwt". This default could have been overriden for each table
separately, but there was no way to change this default for all tables.
This patch adds a "--alternator-write-isolation" configuration option which
allows changing the default.

Moreover, @dorlaor asked that users must *explicitly* choose this default
mode, and not get "always_use_lwt" without noticing. The previous default,
"always_use_lwt" supports any workload correctly but because it uses LWT
for all writes it may be disappointingly slow for users who run write-only
workloads (including most benchmarks) - such users might find the slow
writes so disappointing that they will drop Scylla. Conversely, a default
of "forbid_rmw" will be faster and still correct, but will fail on workloads
which need read-modify-write operations - and suprise users that need these
operations. So Dor asked that that *none* of the write modes be made the
default, and users must make an informed choice between the different write
modes, rather than being disappointed by a default choice they weren't
aware of.

So after this patch, Scylla refuses to boot if Alternator is enabled but
a "--alternator-write-isolation" option is missing.

The patch also modifies the relevant documentation, adds the same option to
our docker image, and the modifies the test-running script
test/alternator/run to run Scylla with the old default mode (always_use_lwt),
which we need because we want to test RMW operations as well.

Fixes #6452

Signed-off-by: Nadav Har'El <nyh@scylladb.com>
Message-Id: <20200524160338.108417-1-nyh@scylladb.com>
2020-05-27 08:40:05 +03:00
..
2020-03-04 11:56:30 +02:00

Building a CentOS-based Docker image

Running

docker build -t <image-name> .

in this directory will build a Docker image of Scylla. You can then run it with, for example,

docker run --name scylla -d -p 9042:9042 -t <image name>

However, it is important to note that while the resulting image will contain some scripts taken from this directory, the actual Scylla executable will not be taken from this build directory. Instead, our Dockerfile downloads the Scylla executable and other Scylla tools (e.g., JMX, nodetool, etc.) from http://downloads.scylladb.com/. If you want to build a Docker image which includes a Scylla executable which you compiled yourself, please refer to the next section.

Docker image with a self-built executable

The following instructions will allow you to build a Docker image which contains a combination of some tools from the nightly build in http://downloads.scylladb.com/ (as described above) but with a Scylla executable which you build yourself.

The following instructions are currently messy, but we hope to one day make them as simple as "ninja docker".

Do the following in the top-level Scylla source directory:

  1. Build your own Scylla in whatever build mode you prefer, e.g., dev.

  2. Run ./reloc/build_reloc.sh --mode dev Unfortunately, even if you already compiled Scylla above, this step will rerun configure.py with slightly different options and then recompile Scylla from scratch. This is issue #6477.

  3. Run ./reloc/build_rpm.sh --reloc-pkg build/dev/scylla-package.tar.gz

  4. cd to dist/docker/redhat

  5. Docker stubbornly refuses to allow using files from outside the current directory in preparing images, so we must copy the RPMs prepared above into the current directory (a symbolic link would not work): rm -r rpms; cp -a ../../../build/redhat/RPMS/x86_64 rpms

  6. Add the following lines near the end of Dockerfile, after the RUN curl:

    COPY rpms /rpms
    RUN yum install -y /rpms/*.rpm
    
  7. Finally, run docker build -t <image-name> .