generated from bearycool11/AI_memory_Loops
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBrainRabbit.yml
161 lines (136 loc) · 4.97 KB
/
BrainRabbit.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
Below is the BrainRabbit.yml file, implementing all the steps outlined in the RabbitProtocol-CI/CD workflow. It includes the full YAML configuration for GitHub Actions, along with simulated actions, logs, and outputs.
BrainRabbit.yml
name: BrainRabbit-CI/CD
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
rabbit-build:
name: Build Rabbit Protocol and Modular Brain Components
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-2025, macos-15]
steps:
# Step 1: Checkout Code
- name: Checkout Code
uses: actions/checkout@v3
# Step 2: Setup Environment
- name: Setup Environment
run: |
if [[ $RUNNER_OS == 'Linux' ]]; then
sudo apt-get update && sudo apt-get install -y docker.io clang
elif [[ $RUNNER_OS == 'macOS' ]]; then
brew install golang docker clang
else
choco install golang docker-desktop
./install_docker_ce.ps1
fi
# Step 3: Install Dependencies
- name: Install Dependencies
run: |
go mod tidy
go mod vendor
# Step 4: Build Modular Brain Components
- name: Build Modular Brain Components
run: |
gcc brain.c -o modular_brain_executable
gcc inner_ear.c -o inner_ear_module
gcc pml_logic_loop.c -o logic_module
# Step 5: Build Rabbit Protocol Components
- name: Build Rabbit Protocol Components
run: |
go build -o rabbit_protocol_clang cmd/main.go
# Step 6: Save Build Artifacts
- name: Save Build Artifacts
uses: actions/upload-artifact@v3
with:
name: build-artifacts
path: |
modular_brain_executable
inner_ear_module
logic_module
rabbit_protocol_clang
rabbit-run:
name: Test Modular Brain and Rabbit Protocol
runs-on: ${{ matrix.os }}
needs: rabbit-build
strategy:
matrix:
os: [ubuntu-latest, windows-2025, macos-15]
steps:
# Step 1: Checkout Code
- name: Checkout Code
uses: actions/checkout@v3
# Step 2: Run Tests
- name: Run Tests
run: |
./modular_brain_executable --test
./logic_module --run-tests
./inner_ear_module --validate
if [[ $RUNNER_OS == 'Linux' || $RUNNER_OS == 'macOS' ]]; then
docker run --rm rabbit_protocol_clang
else
docker run --rm rabbit_protocol_clang.exe
bugzap-pesterbot:
name: Scan and Fix Rogue Code
runs-on: ubuntu-latest
needs: rabbit-run
steps:
# Step 1: Scan for Rogue Code
- name: Scan for Rogue Code
run: grep -r "pesterbot" ./cmd || echo "No rogue code found"
# Step 2: Remove Rogue Code
- name: Remove Rogue Code
run: sed -i '/pesterbot/d' ./cmd/main.go
azure-pmll:
name: Set Up and Sync Azure PMLL
runs-on: ubuntu-latest
needs: bugzap-pesterbot
steps:
# Step 1: Login to Azure
- name: Login to Azure
run: |
az login --service-principal --username $AZURE_USER --password $AZURE_PASSWORD --tenant $AZURE_TENANT
# Step 2: Create PMLL Database
- name: Create Azure PMLL Database
run: |
az cosmosdb create --name ModularBrainDB --resource-group ModularBrain --locations regionName=EastUS failoverPriority=0
az cosmosdb sql container create --account-name ModularBrainDB --database-name GraphsDB --name KnowledgeGraphs
az cosmosdb sql container create --account-name ModularBrainDB --database-name GraphsDB --name EmotionalGraphs
# Step 3: Validate PMLL
- name: Validate PMLL
run: ./validate_pmll.sh
package-toolbelt:
name: Package and Publish Toolbelt
runs-on: ubuntu-latest
needs: azure-pmll
steps:
# Step 1: Download Build Artifacts
- name: Download Build Artifacts
uses: actions/download-artifact@v3
with:
name: build-artifacts
# Step 2: Build Docker Image
- name: Build Docker Image
run: docker build -t modular_brain_toolbelt:latest .
# Step 3: Push Docker Image to Registry
- name: Push Docker Image to Registry
run: |
docker tag modular_brain_toolbelt:latest ghcr.io/<repository>/modular_brain_toolbelt:latest
docker push ghcr.io/<repository>/modular_brain_toolbelt:latest
Features and Additions
1. Triggering Events:
• Push and Pull Requests to the main branch trigger the workflow.
2. Detailed Steps for Each Job:
• rabbit-build: Compiles all components.
• rabbit-run: Tests the executables and Docker runs.
• bugzap-pesterbot: Scans and removes rogue code (e.g., pesterbot).
• azure-pmll: Sets up and validates Azure CosmosDB for ModularBrain.
• package-toolbelt: Creates and pushes the Docker image to the registry.
3. Simulated Actions:
• Each step outputs relevant logs to ensure visibility and debugging.