Browse Source

H2O: Update the base image to Ubuntu 22.04 (#7375)

Anton Kirilov 3 years ago
parent
commit
8638739872

+ 1 - 1
frameworks/C/h2o/CMakeLists.txt

@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8.0)
+cmake_minimum_required(VERSION 3.16.0)
 project(h2o_app)
 project(h2o_app)
 find_library(H2O_LIB h2o-evloop)
 find_library(H2O_LIB h2o-evloop)
 find_library(MUSTACHE_C_LIB mustache_c)
 find_library(MUSTACHE_C_LIB mustache_c)

+ 1 - 1
frameworks/C/h2o/benchmark_config.json

@@ -13,7 +13,7 @@
       "approach": "Realistic",
       "approach": "Realistic",
       "classification": "Platform",
       "classification": "Platform",
       "database": "Postgres",
       "database": "Postgres",
-      "framework": "None",
+      "framework": "libh2o",
       "language": "C",
       "language": "C",
       "flavor": "None",
       "flavor": "None",
       "orm": "Raw",
       "orm": "Raw",

+ 3 - 1
frameworks/C/h2o/h2o.dockerfile

@@ -1,4 +1,4 @@
-FROM ubuntu:20.04
+FROM ubuntu:22.04
 
 
 WORKDIR /h2o_app_src
 WORKDIR /h2o_app_src
 COPY ./ ./
 COPY ./ ./
@@ -43,6 +43,8 @@ RUN mkdir -p "${H2O_BUILD_DIR}/build" && \
     cd ../.. && \
     cd ../.. && \
     rm -rf "$H2O_BUILD_DIR"
     rm -rf "$H2O_BUILD_DIR"
 
 
+ARG BENCHMARK_ENV
+ENV BENCHMARK_ENV=$BENCHMARK_ENV
 EXPOSE 8080
 EXPOSE 8080
 
 
 CMD ["./h2o.sh"]
 CMD ["./h2o.sh"]

+ 2 - 4
frameworks/C/h2o/h2o.sh

@@ -24,12 +24,9 @@ if [[ -z "$MUSTACHE_C_PREFIX" ]]; then
 	MUSTACHE_C_PREFIX=/opt/mustache-c
 	MUSTACHE_C_PREFIX=/opt/mustache-c
 fi
 fi
 
 
-# A hacky way to detect whether we are running in the physical hardware or the cloud environment.
-if [[ $(nproc) -gt 16 ]]; then
-	echo "Running h2o_app in the physical hardware environment."
+if [[ "$BENCHMARK_ENV" = "Azure" ]]; then
 	DB_CONN=5
 	DB_CONN=5
 else
 else
-	echo "Running h2o_app in the cloud environment."
 	DB_CONN=5
 	DB_CONN=5
 fi
 fi
 
 
@@ -81,6 +78,7 @@ build_h2o_app "-fprofile-use"
 cmake --install .
 cmake --install .
 popd
 popd
 rm -rf "$H2O_APP_BUILD_DIR"
 rm -rf "$H2O_APP_BUILD_DIR"
+echo "Running h2o_app in the $BENCHMARK_ENV environment."
 echo "Maximum database connections per thread: $DB_CONN"
 echo "Maximum database connections per thread: $DB_CONN"
 run_h2o_app 0 "${H2O_APP_PREFIX}/bin" "${H2O_APP_PREFIX}/share/h2o_app"
 run_h2o_app 0 "${H2O_APP_PREFIX}/bin" "${H2O_APP_PREFIX}/share/h2o_app"
 wait
 wait