Compare commits
9
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
679151defc | ||
|
|
abdf7d3925 | ||
|
|
9addac8c91 | ||
|
|
cee45bb962 | ||
|
|
5ccb524366 | ||
|
|
c05e2cb6ef | ||
|
|
f8b85beb70 | ||
|
|
3623896464 | ||
|
|
d0e7cea117 |
No files matched your search
+1
-1
@@ -38,4 +38,4 @@ CODECRAFT_LOG_FORMAT=
|
|||||||
# Optional limits per environment and the image used when .factory/setup.json names none:
|
# Optional limits per environment and the image used when .factory/setup.json names none:
|
||||||
#RUNNER_MEMORY=2g
|
#RUNNER_MEMORY=2g
|
||||||
#RUNNER_CPUS=2
|
#RUNNER_CPUS=2
|
||||||
#RUNNER_DEFAULT_IMAGE=node:22-bookworm
|
#RUNNER_DEFAULT_IMAGE=git.familie-zink.org/zink/codecraft-testbase:latest
|
||||||
@@ -3,6 +3,32 @@
|
|||||||
All notable changes to CodeCraft. Versions follow [Semantic Versioning](https://semver.org/);
|
All notable changes to CodeCraft. Versions follow [Semantic Versioning](https://semver.org/);
|
||||||
until 1.0, minor versions may contain breaking changes.
|
until 1.0, minor versions may contain breaking changes.
|
||||||
|
|
||||||
|
## [v202611-00080] – 2026-11-21
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- **Factory page made the server stall (HTTP 504, one CPU core at 100 %).** The overview sums tokens and cost of up to 300 runs per request from the `usage` table, which had no index on `session_id`: every request scanned the table 900 times (about 4 s while holding the database lock). The index `usage_session` makes it take milliseconds (measured on the production database: 4.0 s → 8 ms).
|
||||||
|
|
||||||
|
## [v202611-00079] – 2026-11-21
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- **Server binary keeps its symbols and line tables** (`strip = "none"`, `debug = "line-tables-only"` in the release profile), so a stack sample of the running server can be resolved to functions. The binary is a few tens of MB larger.
|
||||||
|
|
||||||
|
## [v202611-00078] – 2026-11-21
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- **Zombie processes:** the compose files start the containers with `init: true`, so children left behind by agents (Chromium, bwrap, npm) are reaped – a long-running container had collected about 1000 zombies.
|
||||||
|
- **Telegram:** request errors no longer contain the URL, which includes the bot token, so the token does not end up in the server log.
|
||||||
|
|
||||||
|
## [v202611-00077] – 2026-11-20
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- **Shared base image for acceptance containers** (`git.familie-zink.org/zink/codecraft-testbase`, built from `docker/testbase/Dockerfile` by the release script): Node 24, Python 3, gcc/g++/make/cmake, Chromium with Playwright and common tools (git, curl, e2fsprogs, xz, zsh, sudo, jq, …). It is the runner's default image (`RUNNER_DEFAULT_IMAGE`), so setups that installed these again and again start faster; plain `node:24-bookworm` is the fallback if it cannot be pulled. Projects with their own `image` or `dockerfile` are unchanged.
|
||||||
|
- The runner also logs the apt packages an environment's setup installed (`apt installed: …`), to see what the base image still lacks.
|
||||||
|
|
||||||
## [v202611-00076] – 2026-11-20
|
## [v202611-00076] – 2026-11-20
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|||||||
@@ -4,6 +4,10 @@ members = ["core", "server", "cli"]
|
|||||||
|
|
||||||
[profile.release]
|
[profile.release]
|
||||||
opt-level = 3
|
opt-level = 3
|
||||||
|
# Symbols and line tables stay in the binary, so a hot thread can be resolved with eu-stack / addr2line
|
||||||
|
# on the running server (the file grows by a few tens of MB).
|
||||||
|
strip = "none"
|
||||||
|
debug = "line-tables-only"
|
||||||
|
|
||||||
# The command line client is small and self-contained.
|
# The command line client is small and self-contained.
|
||||||
[profile.release.package.codecraft-cli]
|
[profile.release.package.codecraft-cli]
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<img alt="Version v202611-00076" src="https://img.shields.io/badge/version-v202611--00076-d69e2e?style=flat-square">
|
<img alt="Version v202611-00080" src="https://img.shields.io/badge/version-v202611--00080-d69e2e?style=flat-square">
|
||||||
<img alt="License: MIT" src="https://img.shields.io/badge/license-MIT-689d6a?style=flat-square">
|
<img alt="License: MIT" src="https://img.shields.io/badge/license-MIT-689d6a?style=flat-square">
|
||||||
<img alt="Rust backend" src="https://img.shields.io/badge/backend-Rust-b7410e?style=flat-square&logo=rust">
|
<img alt="Rust backend" src="https://img.shields.io/badge/backend-Rust-b7410e?style=flat-square&logo=rust">
|
||||||
<img alt="React PWA" src="https://img.shields.io/badge/frontend-React%20PWA-2d81ff?style=flat-square&logo=react">
|
<img alt="React PWA" src="https://img.shields.io/badge/frontend-React%20PWA-2d81ff?style=flat-square&logo=react">
|
||||||
@@ -391,7 +391,11 @@ directories, and copied into a fresh container only while that key matches – s
|
|||||||
inherits changes from an earlier one, and editing a listed source rebuilds it. `"cache": false`
|
inherits changes from an earlier one, and editing a listed source rebuilds it. `"cache": false`
|
||||||
disables caching; `DELETE /v1/cache/<project>` on the runner clears one project.
|
disables caching; `DELETE /v1/cache/<project>` on the runner clears one project.
|
||||||
|
|
||||||
`image` defaults to `RUNNER_DEFAULT_IMAGE`; `"dockerfile": "path"` builds the image from the
|
`image` defaults to `RUNNER_DEFAULT_IMAGE`, by default the shared base image
|
||||||
|
`codecraft-testbase` (Node 24, Python 3, gcc/cmake, Chromium with Playwright and common tools; see
|
||||||
|
`docker/testbase/Dockerfile`; plain Node 24 is the fallback when it cannot be pulled). The runner logs
|
||||||
|
per environment the start time, the seed hit/miss and the apt packages the setup installed.
|
||||||
|
The image can be changed per project with `"image"`; `"dockerfile": "path"` builds the image from the
|
||||||
repository instead; helper services are reachable by their name. Containers run without extra
|
repository instead; helper services are reachable by their name. Containers run without extra
|
||||||
capabilities, with memory/CPU/process limits (`RUNNER_MEMORY`, `RUNNER_CPUS`), and cannot see the
|
capabilities, with memory/CPU/process limits (`RUNNER_MEMORY`, `RUNNER_CPUS`), and cannot see the
|
||||||
host. Without the runner, or without a `setup.json`, nothing changes. Note that the runner holds
|
host. Without the runner, or without a `setup.json`, nothing changes. Note that the runner holds
|
||||||
|
|||||||
@@ -18,6 +18,8 @@ services:
|
|||||||
# Pin a version (e.g. :v202611-00001) or follow :latest.
|
# Pin a version (e.g. :v202611-00001) or follow :latest.
|
||||||
image: git.familie-zink.org/zink/codecraft:${CODECRAFT_VERSION:-latest}
|
image: git.familie-zink.org/zink/codecraft:${CODECRAFT_VERSION:-latest}
|
||||||
container_name: codecraft
|
container_name: codecraft
|
||||||
|
# PID 1 reaps the children the agents leave behind (chromium, bwrap, npm …) instead of keeping them as zombies.
|
||||||
|
init: true
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
# Same UID/GID as the owner of your project files.
|
# Same UID/GID as the owner of your project files.
|
||||||
user: "${UID:-1000}:${GID:-1000}"
|
user: "${UID:-1000}:${GID:-1000}"
|
||||||
@@ -65,6 +67,7 @@ services:
|
|||||||
image: git.familie-zink.org/zink/codecraft:${CODECRAFT_VERSION:-latest}
|
image: git.familie-zink.org/zink/codecraft:${CODECRAFT_VERSION:-latest}
|
||||||
command: ["testrunner"]
|
command: ["testrunner"]
|
||||||
container_name: codecraft-testrunner
|
container_name: codecraft-testrunner
|
||||||
|
init: true
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
user: "${UID:-1000}:${GID:-1000}"
|
user: "${UID:-1000}:${GID:-1000}"
|
||||||
# Group that owns /var/run/docker.sock on the host: stat -c %g /var/run/docker.sock
|
# Group that owns /var/run/docker.sock on the host: stat -c %g /var/run/docker.sock
|
||||||
@@ -75,7 +78,7 @@ services:
|
|||||||
RUNNER_FACTORY_DIR: /factory
|
RUNNER_FACTORY_DIR: /factory
|
||||||
RUNNER_MEMORY: ${RUNNER_MEMORY:-2g}
|
RUNNER_MEMORY: ${RUNNER_MEMORY:-2g}
|
||||||
RUNNER_CPUS: ${RUNNER_CPUS:-2}
|
RUNNER_CPUS: ${RUNNER_CPUS:-2}
|
||||||
RUNNER_DEFAULT_IMAGE: ${RUNNER_DEFAULT_IMAGE:-node:22-bookworm}
|
RUNNER_DEFAULT_IMAGE: ${RUNNER_DEFAULT_IMAGE:-git.familie-zink.org/zink/codecraft-testbase:latest}
|
||||||
HOME: /tmp
|
HOME: /tmp
|
||||||
volumes:
|
volumes:
|
||||||
- /var/run/docker.sock:/var/run/docker.sock
|
- /var/run/docker.sock:/var/run/docker.sock
|
||||||
|
|||||||
+4
-1
@@ -14,6 +14,8 @@ services:
|
|||||||
GIT_COMMIT: ${GIT_COMMIT:-}
|
GIT_COMMIT: ${GIT_COMMIT:-}
|
||||||
image: codecraft:latest
|
image: codecraft:latest
|
||||||
container_name: codecraft
|
container_name: codecraft
|
||||||
|
# PID 1 reaps the children the agents leave behind (chromium, bwrap, npm …) instead of keeping them as zombies.
|
||||||
|
init: true
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
# Same UID/GID as the owner of your project files.
|
# Same UID/GID as the owner of your project files.
|
||||||
user: "${UID:-1000}:${GID:-1000}"
|
user: "${UID:-1000}:${GID:-1000}"
|
||||||
@@ -61,6 +63,7 @@ services:
|
|||||||
image: codecraft:latest
|
image: codecraft:latest
|
||||||
command: ["testrunner"]
|
command: ["testrunner"]
|
||||||
container_name: codecraft-testrunner
|
container_name: codecraft-testrunner
|
||||||
|
init: true
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
user: "${UID:-1000}:${GID:-1000}"
|
user: "${UID:-1000}:${GID:-1000}"
|
||||||
# Group that owns /var/run/docker.sock on the host: stat -c %g /var/run/docker.sock
|
# Group that owns /var/run/docker.sock on the host: stat -c %g /var/run/docker.sock
|
||||||
@@ -71,7 +74,7 @@ services:
|
|||||||
RUNNER_FACTORY_DIR: /factory
|
RUNNER_FACTORY_DIR: /factory
|
||||||
RUNNER_MEMORY: ${RUNNER_MEMORY:-2g}
|
RUNNER_MEMORY: ${RUNNER_MEMORY:-2g}
|
||||||
RUNNER_CPUS: ${RUNNER_CPUS:-2}
|
RUNNER_CPUS: ${RUNNER_CPUS:-2}
|
||||||
RUNNER_DEFAULT_IMAGE: ${RUNNER_DEFAULT_IMAGE:-node:22-bookworm}
|
RUNNER_DEFAULT_IMAGE: ${RUNNER_DEFAULT_IMAGE:-git.familie-zink.org/zink/codecraft-testbase:latest}
|
||||||
HOME: /tmp
|
HOME: /tmp
|
||||||
volumes:
|
volumes:
|
||||||
- /var/run/docker.sock:/var/run/docker.sock
|
- /var/run/docker.sock:/var/run/docker.sock
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
# Base image of the factory's throw-away acceptance containers (used when .factory/setup.json names no image).
|
||||||
|
# Node 24, Python 3, a C/C++ toolchain, the Chromium that Playwright needs, and the small tools
|
||||||
|
# that acceptance setups installed again and again (see the runner log "apt installed: ...").
|
||||||
|
FROM node:24-bookworm
|
||||||
|
ENV DEBIAN_FRONTEND=noninteractive PIP_BREAK_SYSTEM_PACKAGES=1 PLAYWRIGHT_BROWSERS_PATH=/ms-playwright
|
||||||
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
|
build-essential cmake pkg-config git curl wget ca-certificates unzip xz-utils zip \
|
||||||
|
e2fsprogs util-linux zsh sudo nano procps iproute2 netcat-openbsd jq sqlite3 \
|
||||||
|
python3 python3-pip python3-venv \
|
||||||
|
&& rm -rf /var/lib/apt/lists/* \
|
||||||
|
&& npm install -g playwright \
|
||||||
|
&& playwright install --with-deps chromium \
|
||||||
|
&& rm -rf /var/lib/apt/lists/* /root/.npm \
|
||||||
|
&& chmod -R a+rX /ms-playwright
|
||||||
@@ -94,6 +94,10 @@ if (( image )); then
|
|||||||
run docker buildx build --builder "$BUILDER" --platform "$PLATFORMS" \
|
run docker buildx build --builder "$BUILDER" --platform "$PLATFORMS" \
|
||||||
--build-arg GIT_COMMIT="$(git rev-parse --short HEAD)" --build-arg CODECRAFT_VERSION="$version" \
|
--build-arg GIT_COMMIT="$(git rev-parse --short HEAD)" --build-arg CODECRAFT_VERSION="$version" \
|
||||||
"${tags[@]}" --push .
|
"${tags[@]}" --push .
|
||||||
|
# Base image of the factory's acceptance containers (cached layers: cheap unless the Dockerfile changed).
|
||||||
|
step "Building and pushing ${REGISTRY}-testbase for $PLATFORMS"
|
||||||
|
run docker buildx build --builder "$BUILDER" --platform "$PLATFORMS" \
|
||||||
|
-t "${REGISTRY}-testbase:latest" -t "${REGISTRY}-testbase:$tag" --push docker/testbase
|
||||||
fi
|
fi
|
||||||
|
|
||||||
step "Creating the Gitea release $tag"
|
step "Creating the Gitea release $tag"
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ impl Store {
|
|||||||
);
|
);
|
||||||
CREATE INDEX IF NOT EXISTS usage_ts ON usage(ts);
|
CREATE INDEX IF NOT EXISTS usage_ts ON usage(ts);
|
||||||
CREATE INDEX IF NOT EXISTS usage_root ON usage(root_session_id);
|
CREATE INDEX IF NOT EXISTS usage_root ON usage(root_session_id);
|
||||||
|
CREATE INDEX IF NOT EXISTS usage_session ON usage(session_id);
|
||||||
CREATE TABLE IF NOT EXISTS users (
|
CREATE TABLE IF NOT EXISTS users (
|
||||||
id TEXT PRIMARY KEY,
|
id TEXT PRIMARY KEY,
|
||||||
username TEXT NOT NULL UNIQUE COLLATE NOCASE,
|
username TEXT NOT NULL UNIQUE COLLATE NOCASE,
|
||||||
|
|||||||
@@ -130,7 +130,7 @@ impl Bot {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async fn call(&self, method: &str, body: Value) -> Result<Value> {
|
async fn call(&self, method: &str, body: Value) -> Result<Value> {
|
||||||
let resp = crate::provider::http_client().post(self.url(method)).timeout(Duration::from_secs(60)).json(&body).send().await.context("telegram request failed")?;
|
let resp = crate::provider::http_client().post(self.url(method)).timeout(Duration::from_secs(60)).json(&body).send().await.map_err(|e| e.without_url()).context("telegram request failed")?;
|
||||||
let status = resp.status();
|
let status = resp.status();
|
||||||
let v: Value = resp.json().await.unwrap_or_else(|_| json!({}));
|
let v: Value = resp.json().await.unwrap_or_else(|_| json!({}));
|
||||||
if v["ok"].as_bool() != Some(true) {
|
if v["ok"].as_bool() != Some(true) {
|
||||||
@@ -174,7 +174,7 @@ impl Bot {
|
|||||||
if let Some(c) = caption {
|
if let Some(c) = caption {
|
||||||
form = form.text("caption", c.chars().take(1000).collect::<String>());
|
form = form.text("caption", c.chars().take(1000).collect::<String>());
|
||||||
}
|
}
|
||||||
let v: Value = crate::provider::http_client().post(self.url("sendPhoto")).timeout(Duration::from_secs(120)).multipart(form).send().await?.json().await?;
|
let v: Value = crate::provider::http_client().post(self.url("sendPhoto")).timeout(Duration::from_secs(120)).multipart(form).send().await.map_err(|e| e.without_url())?.json().await.map_err(|e| e.without_url())?;
|
||||||
if v["ok"].as_bool() != Some(true) {
|
if v["ok"].as_bool() != Some(true) {
|
||||||
bail!("telegram sendPhoto: {}", v["description"].as_str().unwrap_or("error"));
|
bail!("telegram sendPhoto: {}", v["description"].as_str().unwrap_or("error"));
|
||||||
}
|
}
|
||||||
@@ -186,7 +186,7 @@ impl Bot {
|
|||||||
let f = self.call("getFile", json!({"file_id": file_id})).await?;
|
let f = self.call("getFile", json!({"file_id": file_id})).await?;
|
||||||
let path = f["file_path"].as_str().context("telegram file without path")?.to_string();
|
let path = f["file_path"].as_str().context("telegram file without path")?.to_string();
|
||||||
let url = format!("{}/file/bot{}/{path}", api_base(), self.token);
|
let url = format!("{}/file/bot{}/{path}", api_base(), self.token);
|
||||||
let bytes = crate::provider::http_client().get(url).timeout(Duration::from_secs(120)).send().await?.error_for_status()?.bytes().await?;
|
let bytes = crate::provider::http_client().get(url).timeout(Duration::from_secs(120)).send().await.map_err(|e| e.without_url())?.error_for_status().map_err(|e| e.without_url())?.bytes().await.map_err(|e| e.without_url())?;
|
||||||
Ok((bytes.to_vec(), path))
|
Ok((bytes.to_vec(), path))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,6 +34,8 @@ const CACHE_LABEL: &str = "codecraft.testrunner.cache=1";
|
|||||||
|
|
||||||
/// What every environment container runs: link the shared directories, restore a matching seed, run
|
/// What every environment container runs: link the shared directories, restore a matching seed, run
|
||||||
/// `install`, store a new seed (only after a successful install, so it is pristine), start the app.
|
/// `install`, store a new seed (only after a successful install, so it is pristine), start the app.
|
||||||
|
const FALLBACK_IMAGE: &str = "node:24-bookworm";
|
||||||
|
|
||||||
const ENTRY_SCRIPT: &str = r#"cd /app
|
const ENTRY_SCRIPT: &str = r#"cd /app
|
||||||
hit=0
|
hit=0
|
||||||
if [ -d /cache ]; then
|
if [ -d /cache ]; then
|
||||||
@@ -42,9 +44,11 @@ if [ -d /cache ]; then
|
|||||||
if [ -n "$CC_SEED_KEY" ]; then for p in $CC_SEED_PATHS; do if [ -e "/cache/seed/$CC_SEED_KEY/$p" ]; then mkdir -p "$(dirname "$p")" && cp -a "/cache/seed/$CC_SEED_KEY/$p" "$p" && hit=1 && echo "[runner] restored $p from the cache"; fi; done; fi
|
if [ -n "$CC_SEED_KEY" ]; then for p in $CC_SEED_PATHS; do if [ -e "/cache/seed/$CC_SEED_KEY/$p" ]; then mkdir -p "$(dirname "$p")" && cp -a "/cache/seed/$CC_SEED_KEY/$p" "$p" && hit=1 && echo "[runner] restored $p from the cache"; fi; done; fi
|
||||||
fi
|
fi
|
||||||
if [ -n "$CC_SEED_KEY" ]; then if [ "$hit" = 1 ]; then echo "[runner] seed $CC_SEED_KEY: hit"; else echo "[runner] seed $CC_SEED_KEY: miss"; fi; fi
|
if [ -n "$CC_SEED_KEY" ]; then if [ "$hit" = 1 ]; then echo "[runner] seed $CC_SEED_KEY: hit"; else echo "[runner] seed $CC_SEED_KEY: miss"; fi; fi
|
||||||
t0=$(date +%s)
|
t0=$(date +%s); st=$(date -u '+%Y-%m-%d %H:%M:%S')
|
||||||
if [ -n "$CC_INSTALL" ]; then sh -c "$CC_INSTALL" || exit 1; fi
|
if [ -n "$CC_INSTALL" ]; then sh -c "$CC_INSTALL" || exit 1; fi
|
||||||
echo "[runner] install took $(( $(date +%s) - t0 )) s"
|
echo "[runner] install took $(( $(date +%s) - t0 )) s"
|
||||||
|
pk=$(awk -v s="$st" '$3=="install" && ($1" "$2)>=s {sub(/:.*/,"",$4); print $4}' /var/log/dpkg.log 2>/dev/null | sort -u | head -40 | tr '\n' ' ')
|
||||||
|
if [ -n "$pk" ]; then echo "[runner] apt installed: $pk"; fi
|
||||||
if [ -d /cache ] && [ -n "$CC_SEED_KEY" ] && [ ! -d "/cache/seed/$CC_SEED_KEY" ]; then
|
if [ -d /cache ] && [ -n "$CC_SEED_KEY" ] && [ ! -d "/cache/seed/$CC_SEED_KEY" ]; then
|
||||||
t="/cache/seed/.tmp-$$"; rm -rf "$t"; mkdir -p "$t"; ok=1
|
t="/cache/seed/.tmp-$$"; rm -rf "$t"; mkdir -p "$t"; ok=1
|
||||||
for p in $CC_SEED_PATHS; do if [ -e "$p" ]; then mkdir -p "$t/$(dirname "$p")" && cp -a "$p" "$t/$p" || ok=0; fi; done
|
for p in $CC_SEED_PATHS; do if [ -e "$p" ]; then mkdir -p "$t/$(dirname "$p")" && cp -a "$p" "$t/$p" || ok=0; fi; done
|
||||||
@@ -355,7 +359,7 @@ pub async fn serve() -> Result<()> {
|
|||||||
ports: (lo, hi),
|
ports: (lo, hi),
|
||||||
memory: std::env::var("RUNNER_MEMORY").unwrap_or_else(|_| "2g".into()),
|
memory: std::env::var("RUNNER_MEMORY").unwrap_or_else(|_| "2g".into()),
|
||||||
cpus: std::env::var("RUNNER_CPUS").unwrap_or_else(|_| "2".into()),
|
cpus: std::env::var("RUNNER_CPUS").unwrap_or_else(|_| "2".into()),
|
||||||
default_image: std::env::var("RUNNER_DEFAULT_IMAGE").unwrap_or_else(|_| "node:22-bookworm".into()),
|
default_image: std::env::var("RUNNER_DEFAULT_IMAGE").unwrap_or_else(|_| "git.familie-zink.org/zink/codecraft-testbase:latest".into()),
|
||||||
max_age: Duration::from_secs(60 * std::env::var("RUNNER_MAX_MINUTES").ok().and_then(|s| s.parse().ok()).unwrap_or(90)),
|
max_age: Duration::from_secs(60 * std::env::var("RUNNER_MAX_MINUTES").ok().and_then(|s| s.parse().ok()).unwrap_or(90)),
|
||||||
me: std::env::var("RUNNER_SELF").or_else(|_| std::env::var("HOSTNAME")).unwrap_or_default(),
|
me: std::env::var("RUNNER_SELF").or_else(|_| std::env::var("HOSTNAME")).unwrap_or_default(),
|
||||||
envs: Mutex::new(HashMap::new()),
|
envs: Mutex::new(HashMap::new()),
|
||||||
@@ -458,7 +462,7 @@ async fn create(r: &Arc<Runner>, id: &str, req: &StartReq, work: &Path) -> Resul
|
|||||||
r.envs.lock().unwrap().get_mut(id).unwrap().containers.push(cname);
|
r.envs.lock().unwrap().get_mut(id).unwrap().containers.push(cname);
|
||||||
}
|
}
|
||||||
let image = if req.dockerfile.is_empty() {
|
let image = if req.dockerfile.is_empty() {
|
||||||
if req.image.is_empty() { r.default_image.clone() } else { req.image.clone() }
|
if req.image.is_empty() { default_image_or_fallback(&r.default_image).await } else { req.image.clone() }
|
||||||
} else {
|
} else {
|
||||||
let tag = format!("cc-run-{id}");
|
let tag = format!("cc-run-{id}");
|
||||||
let df = work.join(&req.dockerfile);
|
let df = work.join(&req.dockerfile);
|
||||||
@@ -548,7 +552,7 @@ async fn create(r: &Arc<Runner>, id: &str, req: &StartReq, work: &Path) -> Resul
|
|||||||
tokio::time::sleep(Duration::from_millis(700)).await;
|
tokio::time::sleep(Duration::from_millis(700)).await;
|
||||||
}
|
}
|
||||||
// Report what the cache brought: seed hit/miss, install time, total time until the app answered.
|
// Report what the cache brought: seed hit/miss, install time, total time until the app answered.
|
||||||
let facts: Vec<String> = logs(&app).await.lines().filter(|l| l.starts_with("[runner] seed ") || l.starts_with("[runner] install took")).map(|l| l.trim_start_matches("[runner] ").to_string()).collect();
|
let facts: Vec<String> = logs(&app).await.lines().filter(|l| l.starts_with("[runner] seed ") || l.starts_with("[runner] install took") || l.starts_with("[runner] apt installed")).map(|l| l.trim_start_matches("[runner] ").to_string()).collect();
|
||||||
let took = began.elapsed().as_secs();
|
let took = began.elapsed().as_secs();
|
||||||
let cache = if cached { "on" } else { "off" };
|
let cache = if cached { "on" } else { "off" };
|
||||||
tracing::info!("test env {id} ({}) ready after {took} s; cache {cache}{}{}", req.cache_id, if facts.is_empty() { "" } else { "; " }, facts.join("; "));
|
tracing::info!("test env {id} ({}) ready after {took} s; cache {cache}{}{}", req.cache_id, if facts.is_empty() { "" } else { "; " }, facts.join("; "));
|
||||||
@@ -572,6 +576,15 @@ async fn create(r: &Arc<Runner>, id: &str, req: &StartReq, work: &Path) -> Resul
|
|||||||
Ok(Started { id: id.to_string(), port })
|
Ok(Started { id: id.to_string(), port })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// The shared base image; when it can neither be found nor pulled, fall back to plain Node so runs still work.
|
||||||
|
async fn default_image_or_fallback(img: &str) -> String {
|
||||||
|
if docker(&["image", "inspect", img]).await.is_ok() || docker(&["pull", "-q", img]).await.is_ok() {
|
||||||
|
return img.to_string();
|
||||||
|
}
|
||||||
|
tracing::warn!("test runner: base image {img} is not available, using {FALLBACK_IMAGE}");
|
||||||
|
FALLBACK_IMAGE.to_string()
|
||||||
|
}
|
||||||
|
|
||||||
async fn logs(container: &str) -> String {
|
async fn logs(container: &str) -> String {
|
||||||
match Command::new("docker").args(["logs", "--tail", "400", container]).output().await {
|
match Command::new("docker").args(["logs", "--tail", "400", container]).output().await {
|
||||||
Ok(o) => format!("{}{}", String::from_utf8_lossy(&o.stdout), String::from_utf8_lossy(&o.stderr)),
|
Ok(o) => format!("{}{}", String::from_utf8_lossy(&o.stdout), String::from_utf8_lossy(&o.stderr)),
|
||||||
|
|||||||
@@ -3,6 +3,22 @@
|
|||||||
* under "unreleased"; scripts/release.sh renames the key to the release version.
|
* under "unreleased"; scripts/release.sh renames the key to the release version.
|
||||||
*/
|
*/
|
||||||
export const WHATS_NEW: Record<string, { en: string[]; de: string[] }> = {
|
export const WHATS_NEW: Record<string, { en: string[]; de: string[] }> = {
|
||||||
|
"202611-00080": {
|
||||||
|
en: ["Fixed: the Factory page no longer makes the server stall (504 errors, high CPU)"],
|
||||||
|
de: ["Behoben: die Factory-Seite lässt den Server nicht mehr hängen (504-Fehler, hohe CPU-Last)"],
|
||||||
|
},
|
||||||
|
"202611-00079": {
|
||||||
|
en: ["The server binary keeps its symbols (for diagnosing a high CPU load); no change in behaviour"],
|
||||||
|
de: ["Das Server-Binary behält seine Symbole (zur Diagnose einer hohen CPU-Last); keine Änderung im Verhalten"],
|
||||||
|
},
|
||||||
|
"202611-00078": {
|
||||||
|
en: ["Fixed: leftover zombie processes in the container; the Telegram bot token no longer appears in error logs"],
|
||||||
|
de: ["Behoben: übrig gebliebene Zombie-Prozesse im Container; der Telegram-Bot-Token taucht nicht mehr in Fehlerlogs auf"],
|
||||||
|
},
|
||||||
|
"202611-00077": {
|
||||||
|
en: ["Factory test runner: shared base image (Node 24, Python, gcc, Chromium/Playwright) for acceptance containers; logs start time, cache hits and installed packages"],
|
||||||
|
de: ["Factory-Test-Runner: gemeinsames Basis-Image (Node 24, Python, gcc, Chromium/Playwright) für Abnahme-Container; protokolliert Startzeit, Cache-Treffer und installierte Pakete"],
|
||||||
|
},
|
||||||
"202611-00076": {
|
"202611-00076": {
|
||||||
en: ["Factory test runner: logs how long an environment took to start and whether the cache seed was a hit"],
|
en: ["Factory test runner: logs how long an environment took to start and whether the cache seed was a hit"],
|
||||||
de: ["Factory-Test-Runner: protokolliert, wie lange eine Umgebung zum Start brauchte und ob der Cache-Seed getroffen hat"],
|
de: ["Factory-Test-Runner: protokolliert, wie lange eine Umgebung zum Start brauchte und ob der Cache-Seed getroffen hat"],
|
||||||
|
|||||||
Reference in new issue
Block a user