ソースを参照

Use Dool instead of Dstat (#8335)

Dstat is no longer maintained.
Anton Kirilov 2 年 前
コミット
116f8b275a
4 ファイル変更15 行追加8 行削除
  1. 11 4
      Dockerfile
  2. 1 1
      entrypoint.sh
  3. 2 2
      toolset/benchmark/benchmarker.py
  4. 1 1
      toolset/utils/results.py

+ 11 - 4
Dockerfile

@@ -10,8 +10,6 @@ RUN apt-get -yqq update && \
       -o Dpkg::Options::="--force-confold" \
       cloc \
       curl \
-      # Collect resource usage statistics
-      dstat \
       gcc \
       git-core \
       gosu \
@@ -36,6 +34,14 @@ RUN pip3 install \
       # https://github.com/docker/docker-py/issues/3113#issuecomment-1525500104
       requests==2.28.1
 
+# Collect resource usage statistics
+ARG DOOL_VERSION=v1.2.0
+
+WORKDIR /tmp
+RUN curl -LSs "https://github.com/scottchiefbaker/dool/archive/${DOOL_VERSION}.tar.gz" | \
+      tar --strip-components=1 -xz && \
+    ./install.py
+
 # Check if the group ID is already created
 ARG GROUP_ID
 RUN if ! getent group "$GROUP_ID"; then \
@@ -48,6 +54,7 @@ RUN if ! getent passwd "$USER_ID"; then \
       adduser --disabled-password --gecos '' --gid "$GROUP_ID" --uid "$USER_ID" user; \
     fi
 
-ENV FWROOT=/FrameworkBenchmarks PYTHONPATH=/FrameworkBenchmarks USER_ID="$USER_ID"
+ENV FWROOT=/FrameworkBenchmarks USER_ID="$USER_ID"
+ENV PYTHONPATH="$FWROOT"
 
-ENTRYPOINT ["FrameworkBenchmarks/entrypoint.sh"]
+ENTRYPOINT ["/FrameworkBenchmarks/entrypoint.sh"]

+ 1 - 1
entrypoint.sh

@@ -4,4 +4,4 @@ set -eo pipefail -u
 
 chown -LR "$USER_ID" /var/run
 # Drop permissions of user to match those of the host system
-gosu "$USER_ID" python3 /FrameworkBenchmarks/toolset/run-tests.py "$@"
+gosu "$USER_ID" python3 "${FWROOT}/toolset/run-tests.py" "$@"

+ 2 - 2
toolset/benchmark/benchmarker.py

@@ -307,11 +307,11 @@ class Benchmarker:
         output_file = "{file_name}".format(
             file_name=self.results.get_stats_file(framework_test.name,
                                                   test_type))
-        dstat_string = "dstat -Tafilmprs --aio --fs --ipc --lock --socket --tcp \
+        dool_string = "dool -Tafilmprs --aio --fs --ipc --lock --socket --tcp \
                                       --raw --udp --unix --vm --disk-util \
                                       --rpc --rpcd --output {output_file}".format(
             output_file=output_file)
-        cmd = shlex.split(dstat_string)
+        cmd = shlex.split(dool_string)
         self.subprocess_handle = subprocess.Popen(
             cmd, stdout=FNULL, stderr=subprocess.STDOUT)
 

+ 1 - 1
toolset/utils/results.py

@@ -453,7 +453,7 @@ class Results:
         stats_dict = dict()
         stats_file = self.get_stats_file(framework_test.name, test_type)
         with open(stats_file) as stats:
-            # dstat doesn't output a completely compliant CSV file - we need to strip the header
+            # dool doesn't output a completely compliant CSV file - we need to strip the header
             for _ in range(4):
                 next(stats)
             stats_reader = csv.reader(stats)