Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add flame-console for debug #67

Merged
merged 1 commit into from
Nov 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions docker/Dockerfile.console
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM rust:1.71.1-slim-bookworm as builder

WORKDIR /usr/src/flame
COPY . .
RUN apt-get update && apt-get install -y protobuf-compiler
RUN cargo install --path ./examples/pi
RUN cargo install --path ./flmctl
RUN cargo install --path ./flmping

FROM ubuntu:22.04
RUN apt-get update && apt-get install -y wget vim iputils-ping ssh
COPY --from=builder /usr/local/cargo/bin/flmping /usr/local/bin/flmping
COPY --from=builder /usr/local/cargo/bin/flmctl /usr/local/bin/flmctl
COPY --from=builder /usr/local/cargo/bin/pi /usr/local/bin/pi
COPY --from=builder /usr/local/cargo/bin/pi-local /usr/local/bin/pi-local
COPY --from=builder /usr/local/cargo/bin/pi-server /usr/local/bin/pi-server

CMD ["service", "ssh", "start", "-D"]
3 changes: 3 additions & 0 deletions docker/Dockerfile.fem
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ WORKDIR /usr/src/flame
COPY . .
RUN apt-get update && apt-get install -y protobuf-compiler
RUN cargo install --path ./executor_manager
RUN cargo install --path ./examples/pi

FROM ubuntu:22.04
COPY --from=builder /usr/local/cargo/bin/flame-executor-manager /opt/flame-executor-manager
COPY --from=builder /usr/local/cargo/bin/pi-server /opt/pi-server

ENTRYPOINT ["/opt/flame-executor-manager"]
12 changes: 11 additions & 1 deletion examples/pi/src/client/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,17 @@ async fn main() -> Result<(), Box<dyn Error>> {
.unwrap_or(DEFAULT_TASK_INPUT);
let task_num = cli.task_num.unwrap_or(DEFAULT_TASK_NUM);

let conn = flame::connect("http://127.0.0.1:8080").await?;
let host = match std::env::var("FLAME_SESSION_MANAGER_SERVICE_HOST") {
Ok(ip) => ip,
Err(_) => "127.0.0.1".to_string(),
};

let port = match std::env::var("FLAME_SESSION_MANAGER_SERVICE_PORT") {
Ok(p) => p,
Err(_) => "8080".to_string(),
};

let conn = flame::connect(format!("http://{}:{}", host, port).as_str()).await?;
let ssn = conn
.create_session(&SessionAttributes {
application: app,
Expand Down
6 changes: 6 additions & 0 deletions installer/flame-conf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,9 @@ applications:
arguments: []
environments: []
working_directory: "/tmp"
- name: "pi"
shim: Stdio
command: "/opt/pi-server"
arguments: []
environments: []
working_directory: "/tmp"
29 changes: 29 additions & 0 deletions installer/flame-console.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: flame-console
labels:
app.kubernetes.io/name: flame-console
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: flame-console
template:
metadata:
labels:
app.kubernetes.io/name: flame-console
spec:
containers:
- name: console
image: registry.minikube/flame-console:latest
env:
- name: RUST_LOG
value: "info"
volumeMounts:
- name: flame-conf
mountPath: /root/.flame
volumes:
- name: flame-conf
configMap:
name: flame-conf
1 change: 1 addition & 0 deletions installer/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ resources:
- flame-executor-manager.yaml
- flame-session-manager.yaml
- fsm-service.yaml
- flame-console.yaml
configMapGenerator:
- name: flame-conf
files:
Expand Down
9 changes: 8 additions & 1 deletion skaffold.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,14 @@ build:
sync:
infer:
- "session_manager"

- image: registry.minikube/flame-console
docker:
dockerfile: docker/Dockerfile.console
sync:
infer:
- "example"
- "flmping"
- "flmctl"
manifests:
kustomize:
paths:
Expand Down
Loading