| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 | FROM sumeetchhetri/ffead-cpp-base:6.0LABEL maintainer="Sumeet Chhetri"LABEL version="6.0"LABEL description="SQL Raw Base ffead-cpp docker image with commit id - master"WORKDIR /tmpRUN mkdir postgresqlCOPY postgresql/* /tmp/postgresql/#POSTGRESQLWORKDIR /tmp/postgresql/# prepare PostgreSQL APT repositoryRUN apt-get -yqq update && apt-get -yqq install locales gnupg lsb-releaseRUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" | tee  /etc/apt/sources.list.d/pgdg.listENV PG_VERSION 13RUN locale-gen en_US.UTF-8ENV LANG en_US.UTF-8ENV LANGUAGE en_US:enENV LC_ALL en_US.UTF-8ENV DEBIAN_FRONTEND noninteractive# install postgresql on database machineRUN apt-get -yqq update && apt-get -yqq install postgresql-13 postgresql-contrib-13 &&  rm -rf /var/lib/apt/lists/*# Make sure all the configuration files in main belong to postgresRUN mv postgresql.conf /etc/postgresql/${PG_VERSION}/main/postgresql.confRUN mv pg_hba.conf /etc/postgresql/${PG_VERSION}/main/pg_hba.confRUN chown -Rf postgres:postgres /etc/postgresql/${PG_VERSION}/mainRUN mkdir /ssdRUN cp -R -p /var/lib/postgresql/${PG_VERSION}/main /ssd/postgresqlRUN cp /etc/postgresql/${PG_VERSION}/main/postgresql.conf /ssd/postgresqlRUN mv 60-postgresql-shm.conf /etc/sysctl.d/60-postgresql-shm.confRUN chown -Rf postgres:postgres /var/run/postgresqlRUN chmod 2777 /var/run/postgresqlRUN chown postgres:postgres /etc/sysctl.d/60-postgresql-shm.confRUN chown postgres:postgres create-postgres*RUN chown -Rf postgres:postgres /ssdENV PGDATA=/ssd/postgresqlUSER postgres# We have to wait for postgres to start before we can use the cliRUN service postgresql start && \    until psql -c "\q"; do sleep 1; done && \    psql < create-postgres-database.sql && \    psql -a hello_world < create-postgres.sql && \    service postgresql stop#POSTGRESQLUSER root#WRKWORKDIR /tmp/wrkRUN apt-get -yqq update && apt-get -yqq install libluajit-5.1-dev libssl-dev luajit && rm -rf /var/lib/apt/lists/* && \	curl -sL https://github.com/wg/wrk/archive/4.1.0.tar.gz | tar xz --strip-components=1ENV LDFLAGS="-O3 -march=native -flto"ENV CFLAGS="-I /usr/include/luajit-2.1 $LDFLAGS"RUN make WITH_LUAJIT=/usr WITH_OPENSSL=/usr -j "$(nproc)"RUN cp wrk /usr/local/binENV name nameENV server_host server_hostENV levels levelsENV duration durationENV max_concurrency max_concurrencyENV max_threads max_threadsENV pipeline pipelineENV accept accept#WRKWORKDIR ${IROOT}RUN sed -i 's|"TeBkUmLpqRouter"|"TeBkUmLpqRouterPicoV"|g' $IROOT/ffead-cpp-src/web/t3/config/application.xmlCOPY sql-profiled-util.sh ${IROOT}/RUN chmod 755 ${IROOT}/sql-profiled-util.shRUN ./sql-profiled-util.sh nobatch noclang noasyncCOPY sql-profiled-install.sh install_ffead-cpp-sql-raw-profiled.sh ${IROOT}/RUN chmod 755 ${IROOT}/sql-profiled-install.sh ${IROOT}/install_ffead-cpp-sql-raw-profiled.shRUN ./sql-profiled-install.sh nocleanupRUN apt update -yqq && apt install -y git make && rm -rf /var/lib/apt/lists/*#For Latest vlang, uncomment the below mentioned line, due to lot of new enhancements and unsafe block handling, vlang has slowed down tremendously#RUN git clone https://github.com/vlang/v && cd v && make && ./v symlink#For the fastest vlang performance, use 0.1.29, where the unsafe changes were only restricted to pointer arithmeticRUN wget -q https://github.com/vlang/v/releases/download/0.1.29/v_linux.zip && unzip -q v_linux.zip && cd v && chmod +x v && ./v symlink && cd .. && rm -f v_linux.zipRUN rm -f /usr/local/lib/libffead-* /usr/local/lib/libte_benc* /usr/local/lib/libinter.so /usr/local/lib/libdinter.so && \	ln -s ${IROOT}/ffead-cpp-6.0-sql/lib/libffead-modules.so /usr/local/lib/libffead-modules.so && \	ln -s ${IROOT}/ffead-cpp-6.0-sql/lib/libffead-framework.so /usr/local/lib/libffead-framework.so && \	ldconfigCOPY sql-v-picov-profiled-install.sh install_ffead-cpp-sql-raw-v-picov-profiled.sh ${IROOT}/RUN chmod 755 ${IROOT}/sql-v-picov-profiled-install.sh ${IROOT}/install_ffead-cpp-sql-raw-v-picov-profiled.shRUN ./sql-v-picov-profiled-install.sh
 |