Skip to content

Commit

Permalink
Fixed issues in crystal-h2o, swift-nio and java lang implementations
Browse files Browse the repository at this point in the history
[docker_verify]
  • Loading branch information
sumeetchhetri committed Jun 10, 2024
1 parent 9a854ef commit dd47f73
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 50 deletions.
22 changes: 15 additions & 7 deletions docker/all/lang/ffead-cpp-crystal-h2o.dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
10 changes: 5 additions & 5 deletions docker/all/lang/ffead-cpp-swift-nio.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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}

Expand Down
19 changes: 9 additions & 10 deletions docker/all/run_ffead.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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" ]
Expand Down Expand Up @@ -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" ]
Expand Down Expand Up @@ -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" ]
Expand All @@ -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" ]
Expand All @@ -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
Expand All @@ -309,7 +309,6 @@ then
-server \
-XX:+UseNUMA \
-XX:+UseParallelGC \
-XX:+AggressiveOpts \
-Dlite=false \
-Dcore=1 \
-Dframe=16 \
Expand All @@ -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
Expand Down
19 changes: 9 additions & 10 deletions docker/te/run_ffead.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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" ]
Expand Down Expand Up @@ -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" ]
Expand Down Expand Up @@ -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" ]
Expand All @@ -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" ]
Expand All @@ -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
Expand All @@ -298,7 +298,6 @@ then
-server \
-XX:+UseNUMA \
-XX:+UseParallelGC \
-XX:+AggressiveOpts \
-Dlite=false \
-Dcore=1 \
-Dframe=16 \
Expand All @@ -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
Expand Down
19 changes: 9 additions & 10 deletions docker/te/tekp/run_ffead.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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" ]
Expand Down Expand Up @@ -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" ]
Expand Down Expand Up @@ -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" ]
Expand All @@ -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" ]
Expand All @@ -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
Expand All @@ -298,7 +298,6 @@ then
-server \
-XX:+UseNUMA \
-XX:+UseParallelGC \
-XX:+AggressiveOpts \
-Dlite=false \
-Dcore=1 \
-Dframe=16 \
Expand All @@ -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
Expand Down
10 changes: 5 additions & 5 deletions lang-server-backends/crystal/h2o.cr/h2o-evloop-ffead-cpp.cr
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
4 changes: 2 additions & 2 deletions lang-server-backends/swift/swift-nio/app/Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
]
Expand Down
2 changes: 1 addition & 1 deletion lang-server-backends/swift/swift-nio/app/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand Down

0 comments on commit dd47f73

Please sign in to comment.