From 18ed2c094cfa36faa3c30553655b98bfca36d53c Mon Sep 17 00:00:00 2001
From: timofey <tim@ongoteam.yaconnect.com>
Date: Tue, 3 Oct 2023 22:29:15 +0000
Subject: [PATCH] 1.72

---
 docker-compose.yml                |  2 ++
 metrics/Dockerfile                |  2 +-
 nginx-default.conf                | 20 ++++++++++++++++++--
 radn-rs/Dockerfile                |  4 ++--
 radn-rs/Dockerfile.Book.Exercises |  2 +-
 radn-rs/Dockerfile.Book.Monads    |  2 +-
 radn-rs/Dockerfile.Book.RADN      |  2 +-
 radn-rs/Dockerfile.Docs           |  6 ++----
 xmetrics/Dockerfile               | 10 ++++++++--
 xmetrics/c_linear.py              |  2 +-
 xmetrics/commits.py               |  2 +-
 xmetrics/render_hist.py           |  2 ++
 xmetrics/render_ploc.py           |  2 ++
 13 files changed, 42 insertions(+), 16 deletions(-)

diff --git a/docker-compose.yml b/docker-compose.yml
index 298ad22..1e13738 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -28,6 +28,8 @@ services:
       - radn-rs:/code/:ro
     networks:
       radn: {}
+    tty: true
+    stop_signal: SIGINT
   book-monads:
     container_name: book-monads
     build:
diff --git a/metrics/Dockerfile b/metrics/Dockerfile
index 41aa910..71fd4ae 100644
--- a/metrics/Dockerfile
+++ b/metrics/Dockerfile
@@ -5,7 +5,7 @@ RUN git clone https://gitea.parrrate.ru/PTV/radn-rs.git
 WORKDIR /code/radn-rs/
 COPY metrics.py /code/metrics.py
 
-RUN git fetch && git checkout 1a8d70957b7d0f3f08f1c0f11ff04ebc007a6b48
+RUN git fetch && git checkout dc98e38b8fbc10e6329c86cad110ce653b94eafd
 RUN --mount=type=cache,target=/code/cache/ python3 /code/metrics.py
 
 FROM python:3.11
diff --git a/nginx-default.conf b/nginx-default.conf
index 0369c75..95a4e29 100644
--- a/nginx-default.conf
+++ b/nginx-default.conf
@@ -13,8 +13,8 @@ server {
         root   /usr/share/nginx/html;
     }
 
-    location /live/docs/ {
-        proxy_pass http://radn-rs-dd/;
+    location /latest/docs {
+        proxy_pass http://buildbot-nginx/docs/radn-rs;
     }
 }
 
@@ -23,6 +23,22 @@ map $http_upgrade $connection_upgrade {
     '' close;
 }
 
+server {
+    listen       80;
+    listen  [::]:80;
+    server_name  radn-live.parrrate.ru;
+
+    location / {
+        proxy_pass http://radn-rs-dd/;
+
+        proxy_http_version 1.1;
+        proxy_set_header Upgrade $http_upgrade;
+        proxy_set_header Connection $connection_upgrade;
+
+        proxy_buffering off;
+    }
+}
+
 server {
     listen       80;
     listen  [::]:80;
diff --git a/radn-rs/Dockerfile b/radn-rs/Dockerfile
index 542c078..c709ba6 100644
--- a/radn-rs/Dockerfile
+++ b/radn-rs/Dockerfile
@@ -1,10 +1,10 @@
-FROM rust:1.69
+FROM rust:1.72
 
 RUN cargo install cargo-watch
 RUN rustup component add rustfmt
 RUN rustup component add clippy
 RUN cargo install mdbook
 RUN cargo install rust-code-analysis-cli
-RUN apt-get update && install -y cloc
+RUN apt-get update && apt-get install -y cloc
 
 WORKDIR /code/
diff --git a/radn-rs/Dockerfile.Book.Exercises b/radn-rs/Dockerfile.Book.Exercises
index b93d6e2..5ace0d6 100644
--- a/radn-rs/Dockerfile.Book.Exercises
+++ b/radn-rs/Dockerfile.Book.Exercises
@@ -1,4 +1,4 @@
-FROM rust:1.69
+FROM rust:1.72
 
 RUN cargo install mdbook
 
diff --git a/radn-rs/Dockerfile.Book.Monads b/radn-rs/Dockerfile.Book.Monads
index 465f6fb..dca1da7 100644
--- a/radn-rs/Dockerfile.Book.Monads
+++ b/radn-rs/Dockerfile.Book.Monads
@@ -1,4 +1,4 @@
-FROM rust:1.69
+FROM rust:1.72
 
 RUN cargo install mdbook
 
diff --git a/radn-rs/Dockerfile.Book.RADN b/radn-rs/Dockerfile.Book.RADN
index 1cc370a..62979a1 100644
--- a/radn-rs/Dockerfile.Book.RADN
+++ b/radn-rs/Dockerfile.Book.RADN
@@ -1,4 +1,4 @@
-FROM rust:1.69
+FROM rust:1.72
 
 RUN cargo install mdbook
 
diff --git a/radn-rs/Dockerfile.Docs b/radn-rs/Dockerfile.Docs
index 60c635c..9e87770 100644
--- a/radn-rs/Dockerfile.Docs
+++ b/radn-rs/Dockerfile.Docs
@@ -1,7 +1,5 @@
 FROM node:19
 
-RUN npm install -g http-server
+RUN npm install -g browser-sync
 
-WORKDIR /code/radn-rs/target/doc/
-
-CMD [ "http-server", "-p", "80" ]
+CMD [ "browser-sync", "start", "-w", "--ss", "/code/radn-rs/target/doc/", "-s", "/code/radn-rs/target/doc/", "--directory", "--no-open", "--port", "80" ]
diff --git a/xmetrics/Dockerfile b/xmetrics/Dockerfile
index bb14f28..a47b8e6 100644
--- a/xmetrics/Dockerfile
+++ b/xmetrics/Dockerfile
@@ -10,7 +10,13 @@ ENV SRCPATTERN="./build/src/**/*.cs"
 FROM metrics-base as metrics-radn
 RUN git clone https://gitea.parrrate.ru/PTV/radn-rs.git repo
 WORKDIR /code/repo/
-RUN git fetch && git checkout 1a8d70957b7d0f3f08f1c0f11ff04ebc007a6b48
+RUN git fetch && git checkout dc98e38b8fbc10e6329c86cad110ce653b94eafd
+
+FROM metrics-base as metrics-meta
+RUN git clone https://gitea.parrrate.ru/PTV/radn-dev.git repo
+WORKDIR /code/repo/
+RUN git fetch && git checkout 33d8daee79e53fc0eded5f7d56486f68aac4d26d
+ENV SRCPATTERN="./*metrics/**/*"
 
 FROM metrics-base as metrics-mdbook
 RUN git clone https://github.com/rust-lang/mdBook.git repo
@@ -45,7 +51,7 @@ RUN git fetch && git checkout f81543a34ee363dcc00e8632fd7cfcd4a3478b23
 ENV SRCDIR="."
 ENV SRCPATTERN="./**/*.[ach]*"
 
-FROM metrics-rust as metrics-repo
+FROM metrics-radn as metrics-repo
 
 FROM metrics-repo as metrics-commits
 COPY common.py /code/common.py
diff --git a/xmetrics/c_linear.py b/xmetrics/c_linear.py
index 973d886..77b68f6 100644
--- a/xmetrics/c_linear.py
+++ b/xmetrics/c_linear.py
@@ -6,6 +6,6 @@ from k2c import k2c
 with open("Y.dat", "rb") as file:
     Y = pickle.load(file)
 M = Y.shape[0]
-K = np.arange(M) / M
+K = (np.arange(M) + .5) / M
 with open("C.dat", "wb") as file:
     pickle.dump(k2c(K), file)
diff --git a/xmetrics/commits.py b/xmetrics/commits.py
index 2ce9159..d5dbea8 100644
--- a/xmetrics/commits.py
+++ b/xmetrics/commits.py
@@ -4,7 +4,7 @@ from subprocess import check_output
 
 from common import set_
 
-BITS = 2
+BITS = 10
 
 
 def mask(height: int) -> int:
diff --git a/xmetrics/render_hist.py b/xmetrics/render_hist.py
index f583c2e..39e2466 100644
--- a/xmetrics/render_hist.py
+++ b/xmetrics/render_hist.py
@@ -1,11 +1,13 @@
 import pickle
 
 import matplotlib.pyplot as plt
+from matplotlib.ticker import MaxNLocator
 
 plt.rcParams["figure.figsize"] = [18, 9]
 plt.style.use("dark_background")
 plt.subplots_adjust(left=0.05, right=0.99, top=0.95, bottom=0.05)
 plt.margins(x=0.025)
+plt.gca().xaxis.set_major_locator(MaxNLocator(integer=True))
 
 with open("Y.dat", "rb") as file:
     Y = pickle.load(file)
diff --git a/xmetrics/render_ploc.py b/xmetrics/render_ploc.py
index 091851e..5b9b959 100644
--- a/xmetrics/render_ploc.py
+++ b/xmetrics/render_ploc.py
@@ -1,11 +1,13 @@
 import pickle
 
 import matplotlib.pyplot as plt
+from matplotlib.ticker import MaxNLocator
 
 plt.rcParams["figure.figsize"] = [18, 9]
 plt.style.use("dark_background")
 plt.subplots_adjust(left=0.05, right=0.99, top=0.95, bottom=0.05)
 plt.margins(x=0.025)
+plt.gca().xaxis.set_major_locator(MaxNLocator(integer=True))
 
 with open("entries.dat", "rb") as file:
     entries_t = pickle.load(file)