Skip to content

Commit

Permalink
use nix/flake to install all tools
Browse files Browse the repository at this point in the history
  • Loading branch information
jashan-lco committed Dec 6, 2023
1 parent 7956dec commit 3f8c2e9
Show file tree
Hide file tree
Showing 8 changed files with 1,028 additions and 43 deletions.
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,7 @@ distribute-*.tar.gz
*.xml

*.iml

.venv/

.devenv/
47 changes: 24 additions & 23 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,37 +12,38 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Install kubectl
uses: azure/setup-kubectl@v3
- name: Install nix
uses: cachix/install-nix-action@v24
with:
version: "v1.22.17"
extra_nix_config: |
accept-flake-config = true
- name: Build docker image
run: |
docker build -t banzai:test-latest .
- name: Start a Kind cluster
uses: helm/[email protected]
- name: Setup cachix
uses: cachix/cachix-action@v12
with:
cluster_name: kind
version: "v0.19.0"
node_image: kindest/node:v1.22.17@sha256:9af784f45a584f6b28bce2af84c494d947a05bd709151466489008f80a9ce9d5
wait: "600s"
name: lco-public
extraPullNames: devenv
skipPush: true

- name: Copy docker image to nodes
run: |
kind load docker-image banzai:test-latest
- name: Expose GitHub Runtime
uses: crazy-max/ghaction-github-runtime@v3

- name: Start banzai
run: |
cat banzai/tests/e2e-k8s.yaml
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

# Deploy banzai stack
kubectl apply -f banzai/tests/e2e-k8s.yaml
- name: Start Kind cluster
shell: nix develop --impure --command bash -e {0}
run: |
kind-create-cluster
# Wait for banzai to be ready
kubectl wait --for=condition=Ready --timeout=60m pod/banzai-e2e-test
- name: Deploy Banzai w/ Skaffold
env:
SKAFFOLD_BUILDX_ARGS: "--cache-to type=gha,mode=max,ignore-error=true --cache-from type=gha"
shell: nix develop --impure --command bash -e {0}
run: |
skaffold -p e2e run
- name: Test Master Bias Creation
shell: nix develop --impure --command bash -e {0}
run: |
kubectl exec banzai-e2e-test -c banzai-listener -- pytest -s --pyargs banzai.tests --durations=0 --junitxml=/archive/engineering/pytest-master-bias.xml -m master_bias
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,5 @@ distribute-*.tar.gz
*.iml

.coverage.subprocess

.devenv/
33 changes: 13 additions & 20 deletions banzai/tests/e2e-k8s.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,15 @@ spec:
- -a
- /archive/engineering
- /data/
resources:
requests:
cpu: 0.1
memory: 256M
limits:
cpu: 1
memory: 1Gi

containers:
- name: banzai-redis
image: redis:5.0.3
imagePullPolicy: IfNotPresent
resources:
requests:
cpu: 0.1
memory: 256M
cpu: 100m
memory: 256Mi
limits:
cpu: 1
memory: 1Gi
Expand All @@ -65,8 +58,8 @@ spec:
imagePullPolicy: IfNotPresent
resources:
requests:
cpu: 1
memory: 512M
cpu: 100m
memory: 256Mi
limits:
cpu: 2
memory: 1Gi
Expand All @@ -79,7 +72,7 @@ spec:
periodSeconds: 1
timeoutSeconds: 10
- name: banzai-celery-workers
image: banzai:test-latest
image: localhost:5001/banzai
imagePullPolicy: IfNotPresent
volumeMounts:
- name: banzai-data
Expand Down Expand Up @@ -137,13 +130,13 @@ spec:
timeoutSeconds: 10
resources:
requests:
cpu: 6
memory: 6Gi
cpu: 100m
memory: 256Mi
limits:
cpu: 8
memory: 8Gi
- name: banzai-celery-beat
image: banzai:test-latest
image: localhost:5001/banzai
imagePullPolicy: IfNotPresent
volumeMounts:
- name: banzai-data
Expand All @@ -163,13 +156,13 @@ spec:
- banzai_automate_stack_calibrations
resources:
requests:
cpu: 0.1
memory: 1Gi
cpu: 100m
memory: 256Mi
limits:
cpu: 1
memory: 1Gi
- name: banzai-listener
image: banzai:test-latest
image: localhost:5001/banzai
imagePullPolicy: IfNotPresent
volumeMounts:
- name: banzai-data
Expand Down Expand Up @@ -202,8 +195,8 @@ spec:
- "--broker-url=localhost"
resources:
requests:
cpu: 0.1
memory: 1Gi
cpu: 100m
memory: 256Mi
limits:
cpu: 1
memory: 2Gi
Expand Down
Loading

0 comments on commit 3f8c2e9

Please sign in to comment.