mirror of
https://github.com/shiroyashik/sculptor.git
synced 2025-12-06 04:51:13 +03:00
Updated dependencies and added container builds for arm architectures
Some checks failed
Push Dev / docker (push) Has been cancelled
Some checks failed
Push Dev / docker (push) Has been cancelled
This commit is contained in:
parent
1c4f0f1106
commit
c0fc8ba2e8
6 changed files with 564 additions and 490 deletions
3
.github/workflows/dev-release.yml
vendored
3
.github/workflows/dev-release.yml
vendored
|
|
@ -39,6 +39,9 @@ jobs:
|
||||||
with:
|
with:
|
||||||
push: true
|
push: true
|
||||||
# context: .
|
# context: .
|
||||||
|
platforms: |
|
||||||
|
linux/amd64
|
||||||
|
linux/arm64
|
||||||
tags: ghcr.io/${{ github.repository_owner }}/sculptor:${{ steps.short_sha.outputs.sha }}
|
tags: ghcr.io/${{ github.repository_owner }}/sculptor:${{ steps.short_sha.outputs.sha }}
|
||||||
cache-from: type=registry,ref=ghcr.io/${{ github.repository_owner }}/sculptor:buildcache
|
cache-from: type=registry,ref=ghcr.io/${{ github.repository_owner }}/sculptor:buildcache
|
||||||
cache-to: type=registry,ref=ghcr.io/${{ github.repository_owner }}/sculptor:buildcache,mode=max
|
cache-to: type=registry,ref=ghcr.io/${{ github.repository_owner }}/sculptor:buildcache,mode=max
|
||||||
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
|
|
@ -137,7 +137,7 @@ jobs:
|
||||||
install: true
|
install: true
|
||||||
- name: Build for Dockerhub & ghcr.io
|
- name: Build for Dockerhub & ghcr.io
|
||||||
run: |
|
run: |
|
||||||
docker build --platform linux/amd64 \
|
docker build --platform linux/amd64,linux/arm64 \
|
||||||
-t ghcr.io/${{ github.repository_owner }}/sculptor:latest \
|
-t ghcr.io/${{ github.repository_owner }}/sculptor:latest \
|
||||||
-t ghcr.io/${{ github.repository_owner }}/sculptor:${{ github.ref_name }} \
|
-t ghcr.io/${{ github.repository_owner }}/sculptor:${{ github.ref_name }} \
|
||||||
--provenance=false --sbom=false \
|
--provenance=false --sbom=false \
|
||||||
|
|
|
||||||
1035
Cargo.lock
generated
1035
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
|
|
@ -30,7 +30,7 @@ dotenvy = "0.15"
|
||||||
semver = "1.0"
|
semver = "1.0"
|
||||||
walkdir = "2.5"
|
walkdir = "2.5"
|
||||||
indexmap = { version = "2.6", features = ["serde"] }
|
indexmap = { version = "2.6", features = ["serde"] }
|
||||||
zip = "2.2"
|
zip = "4.0"
|
||||||
notify = "8.0"
|
notify = "8.0"
|
||||||
|
|
||||||
# Crypto
|
# Crypto
|
||||||
|
|
@ -41,7 +41,7 @@ rand = "0.9"
|
||||||
axum = { version = "0.8", features = ["ws", "macros", "http2"] }
|
axum = { version = "0.8", features = ["ws", "macros", "http2"] }
|
||||||
tower-http = { version = "0.6", features = ["trace"] }
|
tower-http = { version = "0.6", features = ["trace"] }
|
||||||
tokio = { version = "1.41", features = ["full"] }
|
tokio = { version = "1.41", features = ["full"] }
|
||||||
prometheus = { version = "0.13.4", features = ["process"] }
|
prometheus = { version = "0.14", features = ["process"] }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
cross = "0.2.5"
|
cross = "0.2.5"
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
## Chef
|
## Chef
|
||||||
# FROM clux/muslrust:stable AS chef
|
# FROM clux/muslrust:stable AS chef
|
||||||
FROM rust:1.85-alpine3.21 AS chef
|
FROM rust:1.87-alpine3.21 AS chef
|
||||||
USER root
|
USER root
|
||||||
RUN apk add --no-cache musl-dev libressl-dev
|
RUN apk add --no-cache musl-dev libressl-dev
|
||||||
RUN cargo install cargo-chef
|
RUN cargo install cargo-chef
|
||||||
|
|
|
||||||
|
|
@ -19,9 +19,11 @@ async fn metrics(State(state): State<AppState>) -> String {
|
||||||
|
|
||||||
// Add new custom metrics
|
// Add new custom metrics
|
||||||
let players = {
|
let players = {
|
||||||
|
let mut gauge = prometheus::proto::Gauge::default();
|
||||||
|
gauge.set_value(state.session.len() as f64);
|
||||||
|
|
||||||
let mut metric = prometheus::proto::Metric::default();
|
let mut metric = prometheus::proto::Metric::default();
|
||||||
metric.set_gauge(prometheus::proto::Gauge::default());
|
metric.set_gauge(gauge);
|
||||||
metric.mut_gauge().set_value(state.session.len() as f64);
|
|
||||||
create_mf("sculptor_players_count".to_string(), "Number of players".to_string(), MetricType::GAUGE, metric)
|
create_mf("sculptor_players_count".to_string(), "Number of players".to_string(), MetricType::GAUGE, metric)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -54,7 +56,7 @@ pub async fn track_metrics(req: Request<Body>, next: Next) -> Result<Response<Bo
|
||||||
let latency = start.elapsed().as_secs_f64();
|
let latency = start.elapsed().as_secs_f64();
|
||||||
|
|
||||||
REQUESTS
|
REQUESTS
|
||||||
.with_label_values(&[&method, &route, response.status().as_str()])
|
.with_label_values(&[&method, &route, &String::from(response.status().as_str())])
|
||||||
.observe(latency);
|
.observe(latency);
|
||||||
|
|
||||||
Ok(response)
|
Ok(response)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue