Skip to content

Commit 0a2c621

Browse files
committed
feat: convert persysctl and compute-agent from submodules to monorepo directories
- Deinit submodules - Add as first-class directories - Setup Go workspace (go.work) - Update build system and references
1 parent c09fffc commit 0a2c621

131 files changed

Lines changed: 37064 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "persys-operator"]
2+
path = persys-operator
3+
url = https://github.com/persys-dev/persys-operator.git
Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
- master
9+
- work
10+
11+
concurrency:
12+
group: ci-${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
permissions:
16+
contents: read
17+
18+
jobs:
19+
lint-and-validate:
20+
name: Lint And Validate
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v4
25+
26+
- name: Setup Go
27+
uses: actions/setup-go@v5
28+
with:
29+
go-version-file: go.mod
30+
cache: true
31+
32+
- name: Go mod download
33+
run: go mod download
34+
35+
- name: Verify gofmt
36+
run: |
37+
files="$(gofmt -l .)"
38+
if [ -n "$files" ]; then
39+
echo "Unformatted files:"
40+
echo "$files"
41+
exit 1
42+
fi
43+
44+
- name: Verify shell scripts syntax
45+
run: |
46+
if find . -type f -name '*.sh' | grep -q .; then
47+
find . -type f -name '*.sh' -print0 | xargs -0 -n1 bash -n
48+
fi
49+
50+
# - name: Run golangci-lint
51+
# uses: golangci/golangci-lint-action@v8
52+
# with:
53+
# version: latest
54+
# args: --timeout=5m
55+
56+
proto-drift-check:
57+
name: Proto Drift Check
58+
runs-on: ubuntu-latest
59+
steps:
60+
- name: Checkout
61+
uses: actions/checkout@v4
62+
63+
- name: Setup Go
64+
uses: actions/setup-go@v5
65+
with:
66+
go-version-file: go.mod
67+
cache: true
68+
69+
- name: Install protoc
70+
run: |
71+
sudo apt-get update
72+
sudo apt-get install -y --no-install-recommends protobuf-compiler libprotobuf-dev
73+
protoc --version
74+
75+
- name: Install protobuf generators
76+
run: |
77+
go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.36.11
78+
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.6.1
79+
echo "$(go env GOPATH)/bin" >> "$GITHUB_PATH"
80+
81+
- name: Regenerate proto
82+
run: make proto
83+
84+
- name: Verify generated code is committed
85+
run: git diff --exit-code
86+
87+
unit-tests:
88+
name: Unit Tests
89+
runs-on: ubuntu-latest
90+
needs: [lint-and-validate, proto-drift-check]
91+
steps:
92+
- name: Checkout
93+
uses: actions/checkout@v4
94+
95+
- name: Setup Go
96+
uses: actions/setup-go@v5
97+
with:
98+
go-version-file: go.mod
99+
cache: true
100+
101+
- name: Run unit tests with race and coverage
102+
run: make test-unit
103+
104+
- name: Upload coverage artifact
105+
uses: actions/upload-artifact@v4
106+
with:
107+
name: unit-coverage
108+
path: coverage.txt
109+
if-no-files-found: error
110+
111+
e2e-tests:
112+
name: End-to-End Tests
113+
runs-on: ubuntu-latest
114+
needs: [unit-tests]
115+
steps:
116+
- name: Checkout
117+
uses: actions/checkout@v4
118+
119+
- name: Setup Go
120+
uses: actions/setup-go@v5
121+
with:
122+
go-version-file: go.mod
123+
cache: true
124+
125+
- name: Run end-to-end tests
126+
run: make test-e2e
127+
128+
build-binaries:
129+
name: Build Binaries
130+
runs-on: ubuntu-latest
131+
needs: [unit-tests]
132+
steps:
133+
- name: Checkout
134+
uses: actions/checkout@v4
135+
136+
- name: Setup Go
137+
uses: actions/setup-go@v5
138+
with:
139+
go-version-file: go.mod
140+
cache: true
141+
142+
- name: Build agent and client
143+
run: |
144+
go build -v ./cmd/agent
145+
go build -v ./examples/client
146+
147+
docker-build:
148+
name: Docker Build
149+
runs-on: ubuntu-latest
150+
needs: [unit-tests]
151+
steps:
152+
- name: Checkout
153+
uses: actions/checkout@v4
154+
155+
- name: Set up Docker Buildx
156+
uses: docker/setup-buildx-action@v3
157+
158+
- name: Build optimized runtime image
159+
uses: docker/build-push-action@v6
160+
with:
161+
context: .
162+
file: ./Dockerfile
163+
target: runtime
164+
push: false
165+
tags: persys/compute-agent:ci-runtime
166+
cache-from: type=gha
167+
cache-to: type=gha,mode=max
168+
169+
- name: Build full runtime image
170+
uses: docker/build-push-action@v6
171+
with:
172+
context: .
173+
file: ./Dockerfile
174+
target: full-runtime
175+
push: false
176+
tags: persys/compute-agent:ci-full-runtime
177+
cache-from: type=gha
178+
cache-to: type=gha,mode=max

compute-agent/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
bin/
2+
ai/
3+
persys_compute_agent_design_doc.pdf
4+
FIXES_SUMMARY.md

0 commit comments

Comments
 (0)