github.com/dolthub/dolt/go@v0.40.5-0.20240520175717-68db7794bea6/performance/continuous_integration/SysbenchDockerfile (about)

     1  FROM --platform=linux/amd64 golang:1.22-alpine as gobin
     2  FROM --platform=linux/amd64 ubuntu:22.04
     3  
     4  COPY --from=gobin /usr/local/go/ /go/
     5  
     6  ENV GOPATH=$HOME/go
     7  ENV PATH="/go/bin:${PATH}"
     8  ENV DEBIAN_FRONTEND=noninteractive
     9  
    10  RUN apt update
    11  RUN apt install -y curl wget git
    12  
    13  # Install sqlite3 from source
    14  RUN \
    15    apt-get install -y \
    16    build-essential \
    17    tcl \
    18    lsb-release
    19  
    20  RUN wget \
    21      -O sqlite.tar.gz \
    22      https://www.sqlite.org/src/tarball/sqlite.tar.gz?r=release \
    23    && tar xvfz sqlite.tar.gz \
    24     # Configure and make SQLite3 binary
    25    && ./sqlite/configure --prefix=/usr \
    26    && make \
    27    && make install \
    28    # Smoke test
    29    && sqlite3 --version
    30  
    31  WORKDIR /
    32  COPY ./sysbench-runner-tests-entrypoint.sh /entrypoint.sh
    33  RUN git clone https://github.com/dolthub/sysbench-lua-scripts.git
    34  RUN git clone https://github.com/Percona-Lab/sysbench-tpcc.git
    35  
    36  # install doltgres
    37  ENV DOLTGRESQL_VERSION=${DOLTGRESQL_VERSION:-v0.4.0}
    38  RUN git clone https://github.com/dolthub/doltgresql.git
    39  RUN cd doltgresql/utils/doltgres_builder/cmd && go run . "$DOLTGRESQL_VERSION"
    40  ENV PATH="/doltgresql/utils/doltgres_builder/cmd/doltgresBin/$DOLTGRESQL_VERSION:${PATH}"
    41  RUN doltgres version
    42  
    43  WORKDIR /mysql
    44  RUN apt install -y mysql-server
    45  RUN mysql --version
    46  
    47  # Install sysbench
    48  RUN apt update
    49  RUN curl -s https://packagecloud.io/install/repositories/akopytov/sysbench/script.deb.sh | bash
    50  RUN apt -y install sysbench
    51  
    52  # Install Postgres 15
    53  WORKDIR /postgres
    54  RUN sh -c 'echo "deb https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
    55  RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
    56  # currently this command fails, but it succeeds on the stuff we need
    57  RUN apt-get update -y || true
    58  # currently this command fails, but it succeeds on the stuff we need
    59  RUN apt-get -y install postgresql-15 || true
    60  
    61  ENV PATH="/usr/lib/postgresql/15/bin:${PATH}"
    62  
    63  RUN postgres --version
    64  
    65  # create new user and add to postgres group so postgres can be run
    66  ARG UNAME=tester
    67  RUN useradd -m -u 199 $UNAME
    68  RUN usermod -aG postgres tester
    69  COPY ./mysqld.cnf /etc/mysql/mysql.conf.d/mysqld.cnf
    70  
    71  # install dolt
    72  COPY ./go /home/tester/dolt/go
    73  ENV DOLT_ROOT_PATH=/home/tester
    74  WORKDIR /home/tester/dolt/go/cmd/dolt
    75  RUN go build -o /usr/local/bin/dolt .
    76  RUN go mod tidy
    77  RUN chown -R tester:tester /go
    78  USER $UNAME
    79  
    80  RUN mkdir -p /home/tester/.cache
    81  ENV GOCACHE=/home/tester/.cache/
    82  
    83  # create directories owned by new user for mysql as well
    84  RUN mkdir -p /home/tester/.mysql/log
    85  WORKDIR /home/tester
    86  
    87  # supply env vars for tests
    88  ENV BENCHMARK_RUNNER_DOLT_VERSION="HEAD"
    89  ENV BENCHMARK_RUNNER_DOLTGRES_VERSION="$DOLTGRESQL_VERSION"
    90  ENV BENCHMARK_RUNNER_MYSQL_VERSION="8.0.35"
    91  ENV BENCHMARK_RUNNER_POSTGRES_VERSION="15.5"
    92  ENV BENCHMARK_RUNNER_DOLT_EXEC="/usr/local/bin/dolt"
    93  ENV BENCHMARK_RUNNER_MYSQL_EXEC="/usr/sbin/mysqld"
    94  ENV BENCHMARK_RUNNER_MYSQL_PROTOCOL="unix"
    95  ENV BENCHMARK_RUNNER_MYSQL_SOCKET="/home/tester/.mysql/mysqld.sock"
    96  ENV BENCHMARK_RUNNER_DOLTGRES_EXEC="/doltgresql/utils/doltgres_builder/cmd/doltgresBin/$DOLTGRESQL_VERSION/doltgres"
    97  ENV BENCHMARK_RUNNER_POSTGRES_EXEC="/usr/lib/postgresql/15/bin/postgres"
    98  ENV BENCHMARK_RUNNER_POSTGRES_INIT_EXEC="/usr/lib/postgresql/15/bin/initdb"
    99  ENV BENCHMARK_RUNNER_SYSBENCH_LUA_SCRIPTS="/sysbench-lua-scripts"
   100  ENV BENCHMARK_RUNNER_TPCC_LUA_SCRIPTS="/sysbench-tpcc"
   101  
   102  WORKDIR /home/tester/dolt/go/performance/utils/benchmark_runner
   103  ENTRYPOINT ["/entrypoint.sh"]