Skip to content

Commit

Permalink
Merge pull request #102 from k82cn/ci_minikube
Browse files Browse the repository at this point in the history
Run CI with minikube
  • Loading branch information
k82cn authored Jan 13, 2025
2 parents cb8c891 + 885f421 commit 4028441
Show file tree
Hide file tree
Showing 14 changed files with 61 additions and 33 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/code-verify.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,8 @@ jobs:
with:
command: make
args: clippy-ci-flow
- name: Cargo make
uses: actions-rs/cargo@v1
with:
command: make
args: build-release
35 changes: 19 additions & 16 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,25 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Kind Cluster
uses: helm/kind-action@v1
with:
config: ci/kind.yaml
cluster_name: flame-ci-cluster
- name: Build images
run: |
make ci-image
- name: Load images
run: |
kind load docker-image --name flame-ci-cluster xflops/flame-session-manager:latest
kind load docker-image --name flame-ci-cluster xflops/flame-executor-manager:latest
kind load docker-image --name flame-ci-cluster xflops/flame-console:latest
- name: Deploy Flame
run: |
kubectl apply -k installer/
- name: Install gRPC
run: |
sudo apt-get update && sudo apt-get install -y protobuf-compiler
- name: Install rust
uses: actions-rs/toolchain@v1
with:
Expand All @@ -25,22 +44,6 @@ jobs:
with:
command: install
args: --debug cargo-make
- name: Install gRPC
run: |
sudo apt-get update && sudo apt-get install -y protobuf-compiler
- name: Cargo build
uses: actions-rs/cargo@v1
with:
command: make
args: build
- name: Install supervisord
run: |
sudo apt-get update && sudo apt-get install -y supervisor
- name: Start supervisord
run: |
mkdir -p ci/logs
cp -r session_manager/migrations .
supervisord -c ci/supervisord.conf
- name: Run E2E Test
run: |
cargo make test
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,13 @@ FEM_TAG=`cargo get --entry executor_manager/ package.version --pretty`
all: docker-release

init:
cargo install cargo-get
cargo install cargo-get --force

docker-release: init
sudo docker build -t xflops/flame-session-manager:${FSM_TAG} -f docker/Dockerfile.fsm .
sudo docker build -t xflops/flame-executor-manager:${FEM_TAG} -f docker/Dockerfile.fem .

ci-image:
sudo docker build -t xflops/flame-session-manager -f docker/Dockerfile.fsm .
sudo docker build -t xflops/flame-executor-manager -f docker/Dockerfile.fem .
sudo docker build -t xflops/flame-console -f docker/Dockerfile.console .
2 changes: 1 addition & 1 deletion ci/flame-conf.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: flame
endpoint: "http://127.0.0.1:8080"
endpoint: "http://flame-session-manager.flame-system:8080"
slot: "cpu=1,mem=1g"
policy: priority
storage: sqlite://flame.db
Expand Down
10 changes: 10 additions & 0 deletions ci/kind.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: kind.x-k8s.io/v1alpha4
kind: Cluster
nodes:
- role: control-plane
extraPortMappings:
- containerPort: 30080
hostPort: 30080
- role: worker
- role: worker
- role: worker
2 changes: 1 addition & 1 deletion client/rust/tests/integration_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use flame_client as flame;

use self::flame::{FlameError, SessionAttributes, SessionState};

const FLAME_DEFAULT_ADDR: &str = "http://127.0.0.1:8080";
const FLAME_DEFAULT_ADDR: &str = "http://127.0.0.1:30080";

const FLAME_DEFAULT_APP: &str = "flmexec";

Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile.console
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM rust:1.74-slim-bookworm as builder
FROM rust:1.82-slim-bookworm as builder

WORKDIR /usr/src/flame
COPY . .
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.74-slim-bookworm as builder
FROM rust:1.82-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.74-slim-bookworm as builder
FROM rust:1.82-slim-bookworm as builder

WORKDIR /usr/src/flame
COPY . .
Expand Down
5 changes: 3 additions & 2 deletions installer/flame-console.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ spec:
spec:
containers:
- name: console
image: registry.minikube/flame-console:latest
image: xflops/flame-console:latest
imagePullPolicy: IfNotPresent
env:
- name: RUST_LOG
value: "info"
Expand All @@ -26,4 +27,4 @@ spec:
volumes:
- name: flame-conf
configMap:
name: flame-conf
name: flame-conf
7 changes: 4 additions & 3 deletions installer/flame-executor-manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
labels:
app.kubernetes.io/name: flame-executor-manager
spec:
replicas: 3
replicas: 6
selector:
matchLabels:
app.kubernetes.io/name: flame-executor-manager
Expand All @@ -16,7 +16,8 @@ spec:
spec:
containers:
- name: fem
image: registry.minikube/flame-executor-manager:latest
image: xflops/flame-executor-manager:latest
imagePullPolicy: IfNotPresent
env:
- name: RUST_LOG
value: "info"
Expand All @@ -26,4 +27,4 @@ spec:
volumes:
- name: flame-conf
configMap:
name: flame-conf
name: flame-conf
5 changes: 3 additions & 2 deletions installer/flame-session-manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ spec:
spec:
containers:
- name: fsm
image: registry.minikube/flame-session-manager:latest
image: xflops/flame-session-manager:latest
imagePullPolicy: IfNotPresent
env:
- name: RUST_LOG
value: "info"
Expand All @@ -32,4 +33,4 @@ spec:
volumes:
- name: flame-conf
configMap:
name: flame-conf
name: flame-conf
4 changes: 3 additions & 1 deletion installer/fsm-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ kind: Service
metadata:
name: flame-session-manager
spec:
type: NodePort
selector:
app.kubernetes.io/name: flame-session-manager
ports:
- protocol: TCP
port: 8080
targetPort: 8080
targetPort: 8080
nodePort: 30080
6 changes: 3 additions & 3 deletions installer/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: flame-system
resources:
- flame-system.yaml
- flame-executor-manager.yaml
- flame-session-manager.yaml
- fsm-service.yaml
- flame-console.yaml
- fsm-service.yaml
configMapGenerator:
- name: flame-conf
files:
- flame-conf.yaml

generatorOptions:
disableNameSuffixHash: true
disableNameSuffixHash: true

0 comments on commit 4028441

Please sign in to comment.