CodeBench: reqwest 0.13 + Docker volume cache + rust:latest

- reqwest 0.12 → 0.13, rustls-tls → rustls (golden, Dockerfile, promptit)
- Docker volume cache: kipina-cargo-registry + kipina-cargo-target
- rust:latest (1.94) + cmake (aws-lc-sys vaatii)
- Dockerfile yksinkertaistettu — esikäännös ei toimi, volume hoitaa
- Golden example 10/10 testattu uudella setupilla
This commit is contained in:
2026-04-14 18:42:05 +03:00
parent bb8be3ffb4
commit 0975385101
6 changed files with 8 additions and 32 deletions

View File

@@ -1,28 +1,4 @@
FROM rust:1.87-slim FROM rust:latest
RUN apt-get update && apt-get install -y pkg-config libssl-dev && rm -rf /var/lib/apt/lists/* RUN apt-get update && apt-get install -y pkg-config libssl-dev cmake && rm -rf /var/lib/apt/lists/*
WORKDIR /work WORKDIR /work
# Esikäännä riippuvuudet dummy-projektilla — nämä cachetaan Docker-layeriin
RUN cargo init --name bench-precompile . && \
cat > Cargo.toml <<'TOML'
[package]
name = "bench-precompile"
version = "0.1.0"
edition = "2024"
[dependencies]
axum = "0.8"
tokio = { version = "1", features = ["full"] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
sqlx = { version = "0.8", features = ["sqlite", "runtime-tokio"] }
tower-http = { version = "0.6", features = ["cors"] }
chrono = { version = "0.4", features = ["serde"] }
[dev-dependencies]
reqwest = { version = "0.12", default-features = false, features = ["json", "rustls-tls"] }
tokio = { version = "1", features = ["full", "test-util"] }
TOML
RUN cargo check 2>&1 && cargo build --tests 2>&1 && rm -rf src target/debug/deps/bench_precompile* target/debug/bench-precompile*
ENTRYPOINT ["sh", "-c", "cp -r /src/* . && cargo test 2>&1"] ENTRYPOINT ["sh", "-c", "cp -r /src/* . && cargo test 2>&1"]

View File

@@ -404,7 +404,7 @@ async function runPipeline(model, scenario) {
let checkOut = ''; let checkOut = '';
try { try {
checkOut = execSync( checkOut = execSync(
`docker run --rm --entrypoint sh -v "${dir}:/src:ro" ${LCONF.dockerImage} -c "cp -r /src/* . && cargo check 2>&1"`, `docker run --rm --entrypoint sh -v "${dir}:/src:ro" -v kipina-cargo-registry:/usr/local/cargo/registry -v kipina-cargo-target:/work/target ${LCONF.dockerImage} -c "cp -r /src/* . && cargo check 2>&1"`,
{ timeout: 300000, encoding: 'utf-8' } { timeout: 300000, encoding: 'utf-8' }
); );
} catch (e) { } catch (e) {
@@ -507,7 +507,7 @@ async function runPipeline(model, scenario) {
let testOut = ''; let testOut = '';
try { try {
testOut = execSync( testOut = execSync(
`docker run --rm -v "${dir}:/src:ro" ${LCONF.dockerImage} 2>&1`, `docker run --rm -v "${dir}:/src:ro" -v kipina-cargo-registry:/usr/local/cargo/registry -v kipina-cargo-target:/work/target ${LCONF.dockerImage} 2>&1`,
{ timeout: dockerTimeout, encoding: 'utf-8' } { timeout: dockerTimeout, encoding: 'utf-8' }
); );
} catch (e) { } catch (e) {

View File

@@ -22,7 +22,7 @@ sqlx = { version = "0.8", features = ["sqlite", "runtime-tokio"] }
tower-http = { version = "0.6", features = ["cors"] } tower-http = { version = "0.6", features = ["cors"] }
[dev-dependencies] [dev-dependencies]
reqwest = { version = "0.12", default-features = false, features = ["json", "rustls-tls"] } reqwest = { version = "0.13", default-features = false, features = ["json", "rustls"] }
tokio = { version = "1", features = ["full", "test-util"] } tokio = { version = "1", features = ["full", "test-util"] }
``` ```

View File

@@ -12,5 +12,5 @@ sqlx = { version = "0.8", features = ["sqlite", "runtime-tokio"] }
tower-http = { version = "0.6", features = ["cors"] } tower-http = { version = "0.6", features = ["cors"] }
[dev-dependencies] [dev-dependencies]
reqwest = { version = "0.12", default-features = false, features = ["json", "rustls-tls"] } reqwest = { version = "0.13", default-features = false, features = ["json", "rustls"] }
tokio = { version = "1", features = ["full", "test-util"] } tokio = { version = "1", features = ["full", "test-util"] }

View File

@@ -2,7 +2,7 @@ You are a Rust backend developer. Generate an Axum web project with SQLx and SQL
Given the project requirements, JSON specification, and a REFERENCE IMPLEMENTATION, generate these files: Given the project requirements, JSON specification, and a REFERENCE IMPLEMENTATION, generate these files:
1. Cargo.toml — axum 0.8, tokio, serde/serde_json, sqlx (sqlite, runtime-tokio), tower-http, reqwest (for tests) 1. Cargo.toml — axum 0.8, tokio, serde/serde_json, sqlx (sqlite, runtime-tokio), tower-http, reqwest 0.13 with features ["json", "rustls"] (for tests)
2. src/models.rs — Structs with Serialize, Deserialize, FromRow derives 2. src/models.rs — Structs with Serialize, Deserialize, FromRow derives
3. src/handlers.rs — Async handler functions for each CRUD endpoint 3. src/handlers.rs — Async handler functions for each CRUD endpoint
4. src/lib.rs — Public app(pool) function returning Router, init_db() for table creation 4. src/lib.rs — Public app(pool) function returning Router, init_db() for table creation

View File

@@ -5,7 +5,7 @@ STACK: Axum 0.8 + SQLx + SQLite + Tokio + Serde
Cargo.toml: Cargo.toml:
edition = "2024" edition = "2024"
deps: axum 0.8, tokio (full), serde (derive), serde_json, sqlx (sqlite, runtime-tokio), tower-http (cors) deps: axum 0.8, tokio (full), serde (derive), serde_json, sqlx (sqlite, runtime-tokio), tower-http (cors)
dev: reqwest (rustls-tls) dev: reqwest 0.13 (rustls)
src/models.rs: src/models.rs:
#[derive(Debug, Serialize, Deserialize, FromRow)] #[derive(Debug, Serialize, Deserialize, FromRow)]