Skip to content

Commit

Permalink
Replace supervisord with skaffod/minikube
Browse files Browse the repository at this point in the history
Signed-off-by: Klaus Ma <[email protected]>
  • Loading branch information
k82cn committed Nov 21, 2023
1 parent 0f5c304 commit a4594b8
Show file tree
Hide file tree
Showing 11 changed files with 194 additions and 75 deletions.
189 changes: 125 additions & 64 deletions Cargo.lock

Large diffs are not rendered by default.

11 changes: 6 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ members = [

[workspace.dependencies]
tokio = { version = "1", features = ["full"] }
tonic = "0.8"
prost = "0.11"
tonic = "0.10"
tonic-build = "0.10"
prost = "0.12"
env_logger = { version = "0.10" }
log = { version = "0.4", features = ["std", "serde"] }
strum = { version = "0.24", features = ["derive"] }
strum_macros = "0.24"
strum = { version = "0.25", features = ["derive"] }
strum_macros = "0.25"
async-trait = "0.1"
clap = { version = "4.1", features = ["derive"] }
clap = { version = "4", features = ["derive"] }
2 changes: 1 addition & 1 deletion client/rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ thiserror = "1.0"
chrono = "0.4"

[build-dependencies]
tonic-build = "0.8"
tonic-build = { workspace = true }
2 changes: 1 addition & 1 deletion common/src/apis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ impl From<&rpc::Application> for Application {
fn from(app: &rpc::Application) -> Self {
Application {
name: app.name.to_string(),
shim: Shim::from_i32(app.shim).unwrap_or(Shim::default()),
shim: Shim::try_from(app.shim).unwrap_or(Shim::default()),
command: app.command.to_string(),
arguments: app.arguments.to_vec(),
environments: app.environments.to_vec(),
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile.fem
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM rust:1.67 as builder
FROM rust:1.71.1-slim-bookworm as builder

WORKDIR /usr/src/flame
COPY . .
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile.fsm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM rust:1.67 as builder
FROM rust:1.71.1-slim-bookworm as builder

WORKDIR /usr/src/flame
COPY . .
Expand Down
13 changes: 13 additions & 0 deletions installer/flame-conf.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
name: flame
endpoint: "http://flame-session-manager.flame-system:8080"
slot: "cpu=1,mem=2g"
policy: priority
storage: mem
applications:
- name: "flmexec"
shim: Log
command: ""
arguments: []
environments: []
working_directory: "/tmp"
10 changes: 10 additions & 0 deletions installer/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- flame-executor-manager.yaml
- flame-session-manager.yaml
- fsm-service.yaml
configMapGenerator:
- name: flame-conf
files:
- flame-conf.yaml
2 changes: 1 addition & 1 deletion rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ prost-types = "*"
prost-build = "*"

[build-dependencies]
tonic-build = "0.8"
tonic-build = { workspace = true}
2 changes: 1 addition & 1 deletion session_manager/src/scheduler/plugins/fairshare.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ impl Plugin for FairShare {
}

let delta = remaining_slots / underused.len() as f64;
let mut ssn = underused.pop().unwrap();
let ssn = underused.pop().unwrap();

if ssn.deserved + delta < ssn.desired {
ssn.deserved += delta;
Expand Down
34 changes: 34 additions & 0 deletions skaffold.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
apiVersion: skaffold/v4beta2
kind: Config
metadata:
name: flame
build:
tagPolicy:
sha256: {}
local:
useBuildkit: true
useDockerCLI: true
insecureRegistries:
- "registry.minikube"
artifacts:
- image: registry.minikube/flame-executor-manager
docker:
dockerfile: docker/Dockerfile.fem
sync:
infer:
- "executor_manager"
- image: registry.minikube/flame-session-manager
docker:
dockerfile: docker/Dockerfile.fsm
sync:
infer:
- "session_manager"

manifests:
kustomize:
paths:
- installer

deploy:
kubectl:
defaultNamespace: flame-system

0 comments on commit a4594b8

Please sign in to comment.