From 0b5ddeb86c1cd0f6b228602795398a14eda45394 Mon Sep 17 00:00:00 2001 From: Stanislas Polu Date: Wed, 27 Nov 2024 18:08:05 +0100 Subject: [PATCH] Rename core `dust-api` into `core-api` (#8970) * rename dust-api / core-api * tweaks --- .vscode/launch.json | 8 ++++---- core/Cargo.toml | 6 +++++- core/Dockerfile | 4 ++-- core/admin/dev.sh | 2 +- core/bin/{dust_api.rs => core_api.rs} | 4 +--- k8s/dust-kube/deployments/core-deployment.yaml | 2 +- 6 files changed, 14 insertions(+), 12 deletions(-) rename core/bin/{dust_api.rs => core_api.rs} (99%) diff --git a/.vscode/launch.json b/.vscode/launch.json index eeafe5fbc661..0b333fab544b 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -7,15 +7,15 @@ { "type": "lldb", "request": "launch", - "name": "Debug dust-api", + "name": "Debug core-api", "cargo": { "args": [ "build", - "--bin=dust-api", + "--bin=core-api", "--manifest-path=${workspaceFolder}/core/Cargo.toml" ], "filter": { - "name": "dust-api", + "name": "core-api", "kind": "bin" } }, @@ -46,4 +46,4 @@ "envFile": "${workspaceFolder}/front/.env.local", } ] -} \ No newline at end of file +} diff --git a/core/Cargo.toml b/core/Cargo.toml index 786e6c16e1a6..a7dad8bc07d6 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -5,9 +5,13 @@ edition = "2021" # SERVICES +[[bin]] +name = "core-api" +path = "bin/core_api.rs" + [[bin]] name = "dust-api" -path = "bin/dust_api.rs" +path = "bin/core_api.rs" [[bin]] name = "oauth" diff --git a/core/Dockerfile b/core/Dockerfile index 2324ae5d77b4..3c0e5e6010f6 100644 --- a/core/Dockerfile +++ b/core/Dockerfile @@ -6,9 +6,9 @@ WORKDIR /app COPY . . -RUN cargo build --release --bin dust-api --bin sqlite-worker +RUN cargo build --release --bin core-api --bin dust-api --bin sqlite-worker EXPOSE 3001 # Set a default command, it will start the API service if no command is provided -CMD ["cargo", "run", "--release", "--bin", "dust-api"] +CMD ["cargo", "run", "--release", "--bin", "core-api"] diff --git a/core/admin/dev.sh b/core/admin/dev.sh index 82b4bd4cb503..792b75bbed60 100755 --- a/core/admin/dev.sh +++ b/core/admin/dev.sh @@ -1,2 +1,2 @@ #!/bin/sh -cargo run --bin dust-api +cargo run --bin core-api diff --git a/core/bin/dust_api.rs b/core/bin/core_api.rs similarity index 99% rename from core/bin/dust_api.rs rename to core/bin/core_api.rs index a4f6573df8d7..623c6f543831 100644 --- a/core/bin/dust_api.rs +++ b/core/bin/core_api.rs @@ -10,7 +10,7 @@ use axum::{ routing::{delete, get, patch, post}, Router, }; -use futures::future::{try_join, try_join_all}; +use futures::future::try_join_all; use hyper::http::StatusCode; use parking_lot::Mutex; use serde_json::{json, Value}; @@ -3148,8 +3148,6 @@ fn main() { let rt = tokio::runtime::Builder::new_multi_thread() .worker_threads(32) - //.thread_name("dust-api-server") - //.thread_stack_size(32 * 1024 * 1024) .enable_all() .build() .unwrap(); diff --git a/k8s/dust-kube/deployments/core-deployment.yaml b/k8s/dust-kube/deployments/core-deployment.yaml index c4f4cc57fc39..839eaa5ef7ca 100644 --- a/k8s/dust-kube/deployments/core-deployment.yaml +++ b/k8s/dust-kube/deployments/core-deployment.yaml @@ -20,7 +20,7 @@ spec: containers: - name: web image: gcr.io/or1g1n-186209/core-image:latest - command: ["cargo", "run", "--release", "--bin", "dust-api"] + command: ["cargo", "run", "--release", "--bin", "core-api"] imagePullPolicy: Always ports: - containerPort: 3001