ffead-cpp-sql-raw-async-clibpqb-profiled-base.dockerfile 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. FROM sumeetchhetri/ffead-cpp-base:6.0
  2. LABEL maintainer="Sumeet Chhetri"
  3. LABEL version="6.0"
  4. LABEL description="SQL Raw Custom libpq batch patched Base ffead-cpp docker image with commit id - master"
  5. WORKDIR /tmp
  6. RUN mkdir postgresql
  7. COPY postgresql/* /tmp/postgresql/
  8. #POSTGRESQL
  9. WORKDIR /tmp/postgresql/
  10. # prepare PostgreSQL APT repository
  11. RUN apt-get -yqq update && apt-get -yqq install locales gnupg lsb-release
  12. RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
  13. RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" | tee /etc/apt/sources.list.d/pgdg.list
  14. ENV PG_VERSION 13
  15. RUN locale-gen en_US.UTF-8
  16. ENV LANG en_US.UTF-8
  17. ENV LANGUAGE en_US:en
  18. ENV LC_ALL en_US.UTF-8
  19. ENV DEBIAN_FRONTEND noninteractive
  20. # install postgresql on database machine
  21. RUN apt-get -yqq update && apt-get -yqq install postgresql-13 postgresql-contrib-13 && rm -rf /var/lib/apt/lists/*
  22. # Make sure all the configuration files in main belong to postgres
  23. RUN mv postgresql.conf /etc/postgresql/${PG_VERSION}/main/postgresql.conf
  24. RUN mv pg_hba.conf /etc/postgresql/${PG_VERSION}/main/pg_hba.conf
  25. RUN chown -Rf postgres:postgres /etc/postgresql/${PG_VERSION}/main
  26. RUN mkdir /ssd
  27. RUN cp -R -p /var/lib/postgresql/${PG_VERSION}/main /ssd/postgresql
  28. RUN cp /etc/postgresql/${PG_VERSION}/main/postgresql.conf /ssd/postgresql
  29. RUN mv 60-postgresql-shm.conf /etc/sysctl.d/60-postgresql-shm.conf
  30. RUN chown -Rf postgres:postgres /var/run/postgresql
  31. RUN chmod 2777 /var/run/postgresql
  32. RUN chown postgres:postgres /etc/sysctl.d/60-postgresql-shm.conf
  33. RUN chown postgres:postgres create-postgres*
  34. RUN chown -Rf postgres:postgres /ssd
  35. ENV PGDATA=/ssd/postgresql
  36. USER postgres
  37. # We have to wait for postgres to start before we can use the cli
  38. RUN service postgresql start && \
  39. until psql -c "\q"; do sleep 1; done && \
  40. psql < create-postgres-database.sql && \
  41. psql -a hello_world < create-postgres.sql && \
  42. service postgresql stop
  43. #POSTGRESQL
  44. USER root
  45. #WRK
  46. WORKDIR /tmp/wrk
  47. RUN apt-get -yqq update && apt-get -yqq install libluajit-5.1-dev libssl-dev luajit && rm -rf /var/lib/apt/lists/* && \
  48. curl -sL https://github.com/wg/wrk/archive/4.1.0.tar.gz | tar xz --strip-components=1
  49. ENV LDFLAGS="-O3 -march=native -flto"
  50. ENV CFLAGS="-I /usr/include/luajit-2.1 $LDFLAGS"
  51. RUN make WITH_LUAJIT=/usr WITH_OPENSSL=/usr -j "$(nproc)"
  52. RUN cp wrk /usr/local/bin
  53. ENV name name
  54. ENV server_host server_host
  55. ENV levels levels
  56. ENV duration duration
  57. ENV max_concurrency max_concurrency
  58. ENV max_threads max_threads
  59. ENV pipeline pipeline
  60. ENV accept accept
  61. #WRK
  62. WORKDIR ${IROOT}
  63. COPY sql-profiled-util.sh ${IROOT}/
  64. RUN chmod 755 ${IROOT}/sql-profiled-util.sh
  65. RUN ./sql-profiled-util.sh batch clang async
  66. COPY sql-async-profiled-install-clang.sh install_ffead-cpp-sql-raw-profiled.sh ${IROOT}/
  67. RUN chmod 755 ${IROOT}/sql-async-profiled-install-clang.sh ${IROOT}/install_ffead-cpp-sql-raw-profiled.sh
  68. RUN ./sql-async-profiled-install-clang.sh batch