From dd47f73bc01700290beb191226bb94af18cc78bb Mon Sep 17 00:00:00 2001 From: Sumeet Chhetri Date: Mon, 10 Jun 2024 22:13:08 +0530 Subject: [PATCH] Fixed issues in crystal-h2o, swift-nio and java lang implementations [docker_verify] --- .../all/lang/ffead-cpp-crystal-h2o.dockerfile | 22 +++++++++++++------ .../all/lang/ffead-cpp-swift-nio.dockerfile | 10 ++++----- docker/all/run_ffead.sh | 19 ++++++++-------- docker/te/run_ffead.sh | 19 ++++++++-------- docker/te/tekp/run_ffead.sh | 19 ++++++++-------- .../crystal/h2o.cr/h2o-evloop-ffead-cpp.cr | 10 ++++----- .../swift/swift-nio/app/Package.resolved | 4 ++-- .../swift/swift-nio/app/Package.swift | 2 +- 8 files changed, 55 insertions(+), 50 deletions(-) diff --git a/docker/all/lang/ffead-cpp-crystal-h2o.dockerfile b/docker/all/lang/ffead-cpp-crystal-h2o.dockerfile index 734dd4e1e..39213cd31 100644 --- a/docker/all/lang/ffead-cpp-crystal-h2o.dockerfile +++ b/docker/all/lang/ffead-cpp-crystal-h2o.dockerfile @@ -1,16 +1,24 @@ +FROM ubuntu:22.04 +RUN apt-get update -y && apt-get install -yqq libh2o-evloop-dev + FROM sumeetchhetri/ffead-cpp-base:7.0 ENV IROOT=/installs RUN 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-7.0/lib/libffead-modules.so /usr/local/lib/libffead-modules.so && \ - ln -s ${IROOT}/ffead-cpp-7.0/lib/libffead-framework.so /usr/local/lib/libffead-framework.so && \ - ln -s ${IROOT}/ffead-cpp-7.0/lib/libinter.so /usr/local/lib/libinter.so && \ - ln -s ${IROOT}/ffead-cpp-7.0/lib/libdinter.so /usr/local/lib/libdinter.so && \ - ldconfig + ln -s ${IROOT}/ffead-cpp-7.0/lib/libffead-modules.so /usr/local/lib/libffead-modules.so && \ + ln -s ${IROOT}/ffead-cpp-7.0/lib/libffead-framework.so /usr/local/lib/libffead-framework.so && \ + ln -s ${IROOT}/ffead-cpp-7.0/lib/libinter.so /usr/local/lib/libinter.so && \ + ln -s ${IROOT}/ffead-cpp-7.0/lib/libdinter.so /usr/local/lib/libdinter.so && \ + ldconfig + +RUN apt-get update -y && apt-get install -yqq libwslay-dev libyaml-0-2 libevent-dev libpcre3-dev \ + gcc wget git libssl-dev libuv1-dev ca-certificates --no-install-recommends && rm -rf /var/lib/apt/lists/* -RUN apt-get update -y && apt-get install -yqq libh2o-evloop-dev libwslay-dev libyaml-0-2 libevent-dev libpcre3-dev \ - gcc wget git libssl-dev libuv1-dev ca-certificates --no-install-recommends && rm -rf /var/lib/apt/lists/* +COPY --from=0 /usr/lib/x86_64-linux-gnu/libh2o* /usr/lib/x86_64-linux-gnu/ +COPY --from=0 /usr/include/h2o.h /usr/include/h2o.h +COPY --from=0 /usr/include/h2o /usr/include/h2o + RUN wget -q https://github.com/crystal-lang/crystal/releases/download/0.26.1/crystal-0.26.1-1-linux-x86_64.tar.gz \ && tar --strip-components=1 -xzf crystal-0.26.1-1-linux-x86_64.tar.gz -C /usr/ && rm -f *.tar.gz WORKDIR ${IROOT}/lang-server-backends/crystal/h2o.cr diff --git a/docker/all/lang/ffead-cpp-swift-nio.dockerfile b/docker/all/lang/ffead-cpp-swift-nio.dockerfile index a881231c9..ae910b9b3 100644 --- a/docker/all/lang/ffead-cpp-swift-nio.dockerfile +++ b/docker/all/lang/ffead-cpp-swift-nio.dockerfile @@ -11,13 +11,13 @@ RUN rm -f /usr/local/lib/libffead-* /usr/local/lib/libte_benc* /usr/local/lib/li ldconfig WORKDIR ${IROOT} -RUN apt-get update -y && apt-get install -y --no-install-recommends clang libicu-dev libpython2.7-dev libtinfo5 libncurses5 libz3-dev \ +RUN apt-get update -y && apt-get install -y --no-install-recommends clang libicu-dev libpython3-dev libtinfo6 libncurses6 libz3-dev \ && rm -rf /var/lib/apt/lists/* -RUN wget -q https://download.swift.org/swift-5.5.1-release/ubuntu2004/swift-5.5.1-RELEASE/swift-5.5.1-RELEASE-ubuntu20.04.tar.gz -RUN tar -xzf swift-5.5.1-RELEASE-ubuntu20.04.tar.gz -RUN mv swift-5.5.1-RELEASE-ubuntu20.04 /opt/ && rm -f swift-5.5.1-RELEASE-ubuntu20.04.tar.gz -RUN ln -s /opt/swift-5.5.1-RELEASE-ubuntu20.04 /opt/swift +RUN wget -q https://download.swift.org/swift-5.10.1-release/ubuntu2404/swift-5.10.1-RELEASE/swift-5.10.1-RELEASE-ubuntu24.04.tar.gz +RUN tar -xzf swift-5.10.1-RELEASE-ubuntu24.04.tar.gz +RUN mv swift-5.10.1-RELEASE-ubuntu24.04 /opt/ && rm -f swift-5.10.1-RELEASE-ubuntu24.04.tar.gz +RUN ln -s /opt/swift-5.10.1-RELEASE-ubuntu24.04 /opt/swift ENV PATH=/opt/swift/usr/bin:${PATH} diff --git a/docker/all/run_ffead.sh b/docker/all/run_ffead.sh index fd7825d68..be3031e96 100644 --- a/docker/all/run_ffead.sh +++ b/docker/all/run_ffead.sh @@ -172,7 +172,7 @@ then then sed -i 's|QUEUED_WRITES=false|QUEUED_WRITES=true|g' $FFEAD_CPP_PATH/resources/server.prop fi - for i in $(seq 0 $(($(nproc --all)-1))); do + for i in $(seq 0 $(($(taskset 1 getconf _NPROCESSORS_ONLN)-1))); do taskset -c $i ./ffead-cpp $FFEAD_CPP_PATH & done elif [ "$2" = "lithium" ] @@ -225,18 +225,18 @@ then elif [ "$2" = "crystal-http" ] then cd ${IROOT} - for i in $(seq 0 $(($(nproc --all)-1))); do + for i in $(seq 0 $(($(taskset 1 getconf _NPROCESSORS_ONLN)-1))); do taskset -c $i ./crystal-ffead-cpp.out --ffead-cpp-dir=$FFEAD_CPP_PATH --to=8080 & done elif [ "$2" = "crystal-h2o" ] then cd ${IROOT} - for i in $(seq 0 $(($(nproc --all)-1))); do + for i in $(seq 0 $(($(taskset 1 getconf _NPROCESSORS_ONLN)-1))); do taskset -c $i ./h2o-evloop-ffead-cpp.out --ffead-cpp-dir=$FFEAD_CPP_PATH --to=8080 & done elif [ "$2" = "julia-http" ] then - for i in $(seq 0 $(($(nproc --all)-1))); do + for i in $(seq 0 $(($(taskset 1 getconf _NPROCESSORS_ONLN)-1))); do julia ${IROOT}/lang-server-backends/julia/http.jl/server.jl $FFEAD_CPP_PATH done elif [ "$2" = "swift-nio" ] @@ -274,7 +274,7 @@ then elif [ "$2" = "v-vweb" ] then cd ${IROOT} - for i in $(seq 0 $(($(nproc --all)-1))); do + for i in $(seq 0 $(($(taskset 1 getconf _NPROCESSORS_ONLN)-1))); do taskset -c $i ./vweb --server_dir=$FFEAD_CPP_PATH --server_port=8080 & done elif [ "$2" = "v-picov" ] @@ -283,7 +283,7 @@ then sed -i 's|EVH_SINGLE=false|EVH_SINGLE=true|g' $FFEAD_CPP_PATH/resources/server.prop if [ "$3" = "postgresql-raw-async" ] then - for i in $(seq 0 $(($(nproc --all)-1))); do + for i in $(seq 0 $(($(taskset 1 getconf _NPROCESSORS_ONLN)-1))); do if [ "$6" = "pool" ] then if [ -f "main_async_pool" ] @@ -298,7 +298,7 @@ then done else sed -i 's|"TeBkUmLpqRouter"|"TeBkUmLpqRouterPicoV"|g' ${WEB_DIR}/config/application.xml - for i in $(seq 0 $(($(nproc --all)-1))); do + for i in $(seq 0 $(($(taskset 1 getconf _NPROCESSORS_ONLN)-1))); do taskset -c $i ./main --server_dir=$FFEAD_CPP_PATH --server_port=8080 --is_async=false & done fi @@ -309,7 +309,6 @@ then -server \ -XX:+UseNUMA \ -XX:+UseParallelGC \ - -XX:+AggressiveOpts \ -Dlite=false \ -Dcore=1 \ -Dframe=16 \ @@ -327,13 +326,13 @@ then elif [ "$2" = "java-rapidoid" ] then cd ${IROOT} - java -server -XX:+UseNUMA -XX:+UseParallelGC -XX:+AggressiveOpts \ + java -server -XX:+UseNUMA -XX:+UseParallelGC \ -classpath rapidoid-ffead-cpp-1.0-jar-with-dependencies.jar \ com.rapidoid.ffeadcpp.Main $FFEAD_CPP_PATH 8080 profiles=production elif [ "$2" = "java-wizzardo-http" ] then cd ${IROOT} - java -Xmx2G -Xms2G -server -XX:+UseNUMA -XX:+UseParallelGC -XX:+AggressiveOpts \ + java -Xmx2G -Xms2G -server -XX:+UseNUMA -XX:+UseParallelGC \ -jar wizzardo-ffead-cpp-all-1.0.jar $FFEAD_CPP_PATH 8080 env=prod elif [ "$2" = "seastar" ] then diff --git a/docker/te/run_ffead.sh b/docker/te/run_ffead.sh index 2149b6acc..7a27d0b62 100644 --- a/docker/te/run_ffead.sh +++ b/docker/te/run_ffead.sh @@ -172,7 +172,7 @@ then then sed -i 's|QUEUED_WRITES=false|QUEUED_WRITES=true|g' $FFEAD_CPP_PATH/resources/server.prop fi - for i in $(seq 0 $(($(nproc --all)-1))); do + for i in $(seq 0 $(($(taskset 1 getconf _NPROCESSORS_ONLN)-1))); do taskset -c $i ./ffead-cpp $FFEAD_CPP_PATH & done elif [ "$2" = "lithium" ] @@ -212,18 +212,18 @@ then elif [ "$2" = "crystal-http" ] then cd ${IROOT} - for i in $(seq 0 $(($(nproc --all)-1))); do + for i in $(seq 0 $(($(taskset 1 getconf _NPROCESSORS_ONLN)-1))); do taskset -c $i ./crystal-ffead-cpp.out --ffead-cpp-dir=$FFEAD_CPP_PATH --to=8080 & done elif [ "$2" = "crystal-h2o" ] then cd ${IROOT} - for i in $(seq 0 $(($(nproc --all)-1))); do + for i in $(seq 0 $(($(taskset 1 getconf _NPROCESSORS_ONLN)-1))); do taskset -c $i ./h2o-evloop-ffead-cpp.out --ffead-cpp-dir=$FFEAD_CPP_PATH --to=8080 & done elif [ "$2" = "julia-http" ] then - for i in $(seq 0 $(($(nproc --all)-1))); do + for i in $(seq 0 $(($(taskset 1 getconf _NPROCESSORS_ONLN)-1))); do julia ${IROOT}/lang-server-backends/julia/http.jl/server.jl $FFEAD_CPP_PATH done elif [ "$2" = "swift-nio" ] @@ -261,7 +261,7 @@ then elif [ "$2" = "v-vweb" ] then cd ${IROOT} - for i in $(seq 0 $(($(nproc --all)-1))); do + for i in $(seq 0 $(($(taskset 1 getconf _NPROCESSORS_ONLN)-1))); do taskset -c $i ./vweb --server_dir=$FFEAD_CPP_PATH --server_port=8080 & done elif [ "$2" = "v-picov" ] @@ -271,7 +271,7 @@ then if [[ $3 == *"-async"* ]] then rm -f ${WEB_DIR}/config/cache.xml - for i in $(seq 0 $(($(nproc --all)-1))); do + for i in $(seq 0 $(($(taskset 1 getconf _NPROCESSORS_ONLN)-1))); do if [ "$6" = "pool" ] then if [ -f "main_async_pool" ] @@ -287,7 +287,7 @@ then else sed -i 's|"TeBkUmLpqRouter"|"TeBkUmLpqRouterPicoV"|g' ${WEB_DIR}/config/application.xml sed -i 's|"TeBkUmFpgRouter"|"TeBkUmFpgRouterPicoV"|g' ${WEB_DIR}/config/application.xml - for i in $(seq 0 $(($(nproc --all)-1))); do + for i in $(seq 0 $(($(taskset 1 getconf _NPROCESSORS_ONLN)-1))); do taskset -c $i ./main --server_dir=$FFEAD_CPP_PATH --server_port=8080 --is_async=false & done fi @@ -298,7 +298,6 @@ then -server \ -XX:+UseNUMA \ -XX:+UseParallelGC \ - -XX:+AggressiveOpts \ -Dlite=false \ -Dcore=1 \ -Dframe=16 \ @@ -316,13 +315,13 @@ then elif [ "$2" = "java-rapidoid" ] then cd ${IROOT} - java -server -XX:+UseNUMA -XX:+UseParallelGC -XX:+AggressiveOpts \ + java -server -XX:+UseNUMA -XX:+UseParallelGC \ -classpath rapidoid-ffead-cpp-1.0-jar-with-dependencies.jar \ com.rapidoid.ffeadcpp.Main $FFEAD_CPP_PATH 8080 profiles=production elif [ "$2" = "java-wizzardo-http" ] then cd ${IROOT} - java -Xmx2G -Xms2G -server -XX:+UseNUMA -XX:+UseParallelGC -XX:+AggressiveOpts \ + java -Xmx2G -Xms2G -server -XX:+UseNUMA -XX:+UseParallelGC \ -jar wizzardo-ffead-cpp-all-1.0.jar $FFEAD_CPP_PATH 8080 env=prod elif [ "$2" = "seastar" ] then diff --git a/docker/te/tekp/run_ffead.sh b/docker/te/tekp/run_ffead.sh index 2149b6acc..7a27d0b62 100644 --- a/docker/te/tekp/run_ffead.sh +++ b/docker/te/tekp/run_ffead.sh @@ -172,7 +172,7 @@ then then sed -i 's|QUEUED_WRITES=false|QUEUED_WRITES=true|g' $FFEAD_CPP_PATH/resources/server.prop fi - for i in $(seq 0 $(($(nproc --all)-1))); do + for i in $(seq 0 $(($(taskset 1 getconf _NPROCESSORS_ONLN)-1))); do taskset -c $i ./ffead-cpp $FFEAD_CPP_PATH & done elif [ "$2" = "lithium" ] @@ -212,18 +212,18 @@ then elif [ "$2" = "crystal-http" ] then cd ${IROOT} - for i in $(seq 0 $(($(nproc --all)-1))); do + for i in $(seq 0 $(($(taskset 1 getconf _NPROCESSORS_ONLN)-1))); do taskset -c $i ./crystal-ffead-cpp.out --ffead-cpp-dir=$FFEAD_CPP_PATH --to=8080 & done elif [ "$2" = "crystal-h2o" ] then cd ${IROOT} - for i in $(seq 0 $(($(nproc --all)-1))); do + for i in $(seq 0 $(($(taskset 1 getconf _NPROCESSORS_ONLN)-1))); do taskset -c $i ./h2o-evloop-ffead-cpp.out --ffead-cpp-dir=$FFEAD_CPP_PATH --to=8080 & done elif [ "$2" = "julia-http" ] then - for i in $(seq 0 $(($(nproc --all)-1))); do + for i in $(seq 0 $(($(taskset 1 getconf _NPROCESSORS_ONLN)-1))); do julia ${IROOT}/lang-server-backends/julia/http.jl/server.jl $FFEAD_CPP_PATH done elif [ "$2" = "swift-nio" ] @@ -261,7 +261,7 @@ then elif [ "$2" = "v-vweb" ] then cd ${IROOT} - for i in $(seq 0 $(($(nproc --all)-1))); do + for i in $(seq 0 $(($(taskset 1 getconf _NPROCESSORS_ONLN)-1))); do taskset -c $i ./vweb --server_dir=$FFEAD_CPP_PATH --server_port=8080 & done elif [ "$2" = "v-picov" ] @@ -271,7 +271,7 @@ then if [[ $3 == *"-async"* ]] then rm -f ${WEB_DIR}/config/cache.xml - for i in $(seq 0 $(($(nproc --all)-1))); do + for i in $(seq 0 $(($(taskset 1 getconf _NPROCESSORS_ONLN)-1))); do if [ "$6" = "pool" ] then if [ -f "main_async_pool" ] @@ -287,7 +287,7 @@ then else sed -i 's|"TeBkUmLpqRouter"|"TeBkUmLpqRouterPicoV"|g' ${WEB_DIR}/config/application.xml sed -i 's|"TeBkUmFpgRouter"|"TeBkUmFpgRouterPicoV"|g' ${WEB_DIR}/config/application.xml - for i in $(seq 0 $(($(nproc --all)-1))); do + for i in $(seq 0 $(($(taskset 1 getconf _NPROCESSORS_ONLN)-1))); do taskset -c $i ./main --server_dir=$FFEAD_CPP_PATH --server_port=8080 --is_async=false & done fi @@ -298,7 +298,6 @@ then -server \ -XX:+UseNUMA \ -XX:+UseParallelGC \ - -XX:+AggressiveOpts \ -Dlite=false \ -Dcore=1 \ -Dframe=16 \ @@ -316,13 +315,13 @@ then elif [ "$2" = "java-rapidoid" ] then cd ${IROOT} - java -server -XX:+UseNUMA -XX:+UseParallelGC -XX:+AggressiveOpts \ + java -server -XX:+UseNUMA -XX:+UseParallelGC \ -classpath rapidoid-ffead-cpp-1.0-jar-with-dependencies.jar \ com.rapidoid.ffeadcpp.Main $FFEAD_CPP_PATH 8080 profiles=production elif [ "$2" = "java-wizzardo-http" ] then cd ${IROOT} - java -Xmx2G -Xms2G -server -XX:+UseNUMA -XX:+UseParallelGC -XX:+AggressiveOpts \ + java -Xmx2G -Xms2G -server -XX:+UseNUMA -XX:+UseParallelGC \ -jar wizzardo-ffead-cpp-all-1.0.jar $FFEAD_CPP_PATH 8080 env=prod elif [ "$2" = "seastar" ] then diff --git a/lang-server-backends/crystal/h2o.cr/h2o-evloop-ffead-cpp.cr b/lang-server-backends/crystal/h2o.cr/h2o-evloop-ffead-cpp.cr index 92d48a353..b8d5f8fe3 100644 --- a/lang-server-backends/crystal/h2o.cr/h2o-evloop-ffead-cpp.cr +++ b/lang-server-backends/crystal/h2o.cr/h2o-evloop-ffead-cpp.cr @@ -79,11 +79,11 @@ class H2oFfeadCppCry < H2o freq.headers_len = counter scode = 0 - smsg_len: UInt64 = 0 - out_mime_len: UInt64 = 0 - out_url_len: UInt64 = 0 - out_headers_len: UInt64 = 0 - out_body_len: UInt64 = 0 + smsg_len: UInt64 = 0_u64 + out_mime_len: UInt64 = 0_u64 + out_url_len: UInt64 = 0_u64 + out_headers_len: UInt64 = 0_u64 + out_body_len: UInt64 = 0_u64 FfeadCppRespTL.set LibFfeadCpp.ffead_cpp_handle_crystal_js_1(pointerof(freq), pointerof(scode), out smsg, pointerof(smsg_len), out out_mime, pointerof(out_mime_len), out out_url, pointerof(out_url_len), freq.headers, pointerof(out_headers_len), out out_body, pointerof(out_body_len)) diff --git a/lang-server-backends/swift/swift-nio/app/Package.resolved b/lang-server-backends/swift/swift-nio/app/Package.resolved index 520894e74..86d8f4017 100644 --- a/lang-server-backends/swift/swift-nio/app/Package.resolved +++ b/lang-server-backends/swift/swift-nio/app/Package.resolved @@ -6,8 +6,8 @@ "repositoryURL": "https://github.com/apple/swift-nio.git", "state": { "branch": null, - "revision": "c3e2359c55cd8b47207ab7363b77c9c398a95294", - "version": "2.23.0" + "revision": "9428f62793696d9a0cc1f26a63f63bb31da0516d", + "version": "2.66.0" } } ] diff --git a/lang-server-backends/swift/swift-nio/app/Package.swift b/lang-server-backends/swift/swift-nio/app/Package.swift index bde09c5e0..9d17b616b 100644 --- a/lang-server-backends/swift/swift-nio/app/Package.swift +++ b/lang-server-backends/swift/swift-nio/app/Package.swift @@ -10,7 +10,7 @@ let package = Package( .executable(name: "app", targets: ["App"]) ], dependencies: [ - .package(url: "https://github.com/apple/swift-nio.git", from: "2.0.0"), + .package(url: "https://github.com/apple/swift-nio.git", from: "2.66.0"), .package(path: "../FfeadCpp"), ], targets: [