-
Notifications
You must be signed in to change notification settings - Fork 0
275 lines (229 loc) · 9.55 KB
/
docker-cloud.yml
File metadata and controls
275 lines (229 loc) · 9.55 KB
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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
# Docker Cloud Build & Push
# Optimized for GHCR with buildx and multi-platform support
# Uses latest Docker features and caching
name: Docker Cloud Build
on:
push:
branches: [main]
paths:
- 'genesis-q-mem/**'
- 'yennefer-core/**'
- 'scripts/**'
- 'Dockerfile*'
- 'docker-compose*.yml'
workflow_dispatch:
inputs:
platforms:
description: 'Build platforms'
required: false
default: 'linux/amd64'
type: choice
options:
- linux/amd64
- linux/amd64,linux/arm64
push_latest:
description: 'Push as latest tag'
required: false
default: true
type: boolean
env:
REGISTRY: ghcr.io
DOCKER_BUILDKIT: 1
jobs:
# ═══════════════════════════════════════════════════════════════════════════
# BUILD MATRIX
# ═══════════════════════════════════════════════════════════════════════════
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write
attestations: write
strategy:
fail-fast: false
matrix:
include:
- name: cortex
context: .
dockerfile: genesis-q-mem/Dockerfile
description: "Yennefer Multimodal Cortex - GPU QFLOP optimized"
- name: conductor
context: .
dockerfile: Dockerfile.orchestrator
description: "Genesis Conductor - Blockchain event listener"
- name: landing
context: yennefer-core
dockerfile: yennefer-core/Dockerfile
description: "Yennefer Landing - Syn25 aesthetic frontend"
- name: qmcp
context: genesis-q-mem
dockerfile: genesis-q-mem/Dockerfile.qmcp
description: "QMCP System - Quantum Memory Control Protocol"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
version: latest
driver-opts: |
image=moby/buildkit:master
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Check if Dockerfile exists
id: check
run: |
if [ -f "${{ matrix.dockerfile }}" ]; then
echo "exists=true" >> $GITHUB_OUTPUT
else
echo "exists=false" >> $GITHUB_OUTPUT
echo "⚠️ Dockerfile not found: ${{ matrix.dockerfile }}"
fi
- name: Extract metadata
if: steps.check.outputs.exists == 'true'
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ github.repository }}-${{ matrix.name }}
tags: |
type=sha,prefix=
type=ref,event=branch
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' && github.event.inputs.push_latest != 'false' }}
type=raw,value={{date 'YYYYMMDD-HHmmss'}}
labels: |
org.opencontainers.image.title=Yennefer ${{ matrix.name }}
org.opencontainers.image.description=${{ matrix.description }}
org.opencontainers.image.vendor=Genesis Conductor Engine
- name: Build and push
if: steps.check.outputs.exists == 'true'
id: build
uses: docker/build-push-action@v6
with:
context: ${{ matrix.context }}
file: ${{ matrix.dockerfile }}
platforms: ${{ github.event.inputs.platforms || 'linux/amd64' }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha,scope=${{ matrix.name }}
cache-to: type=gha,mode=max,scope=${{ matrix.name }}
provenance: true
sbom: true
build-args: |
BUILDKIT_INLINE_CACHE=1
BUILD_DATE=${{ github.event.head_commit.timestamp }}
VCS_REF=${{ github.sha }}
- name: Attest
if: steps.check.outputs.exists == 'true'
uses: actions/attest-build-provenance@v2
with:
subject-name: ${{ env.REGISTRY }}/${{ github.repository }}-${{ matrix.name }}
subject-digest: ${{ steps.build.outputs.digest }}
push-to-registry: true
- name: Summary
if: steps.check.outputs.exists == 'true'
run: |
echo "### 🐳 Docker Image Built" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Image:** \`${{ env.REGISTRY }}/${{ github.repository }}-${{ matrix.name }}\`" >> $GITHUB_STEP_SUMMARY
echo "**Digest:** \`${{ steps.build.outputs.digest }}\`" >> $GITHUB_STEP_SUMMARY
echo "**Description:** ${{ matrix.description }}" >> $GITHUB_STEP_SUMMARY
# ═══════════════════════════════════════════════════════════════════════════
# CREATE MISSING DOCKERFILES
# ═══════════════════════════════════════════════════════════════════════════
ensure-dockerfiles:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Create missing Dockerfiles
run: |
# QMCP Dockerfile
if [ ! -f genesis-q-mem/Dockerfile.qmcp ]; then
cat > genesis-q-mem/Dockerfile.qmcp << 'DOCKERFILE'
# QMCP - Quantum Memory Control Protocol
FROM python:3.12-slim
WORKDIR /app
# Install system deps
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
&& rm -rf /var/lib/apt/lists/*
# Copy QMCP system
COPY qmcp_system.py /app/
COPY requirements.txt /app/
# Install Python deps
RUN pip install --no-cache-dir numpy scipy aiohttp
RUN pip install --no-cache-dir -r requirements.txt || true
# Environment
ENV PYTHONUNBUFFERED=1
ENV QMCP_CACHE_SIZE=256
ENV QUANTUM_DIMS=16
# Expose shared memory
VOLUME ["/dev/shm"]
CMD ["python3", "qmcp_system.py"]
DOCKERFILE
echo "Created genesis-q-mem/Dockerfile.qmcp"
fi
# Cortex Dockerfile (if missing)
if [ ! -f genesis-q-mem/Dockerfile ]; then
cat > genesis-q-mem/Dockerfile << 'DOCKERFILE'
# Yennefer Multimodal Cortex
FROM python:3.12-slim
WORKDIR /app
RUN apt-get update && apt-get install -y --no-install-recommends \
curl git \
&& rm -rf /var/lib/apt/lists/*
COPY *.py /app/
COPY requirements.txt /app/
RUN pip install --no-cache-dir -r requirements.txt || pip install numpy aiohttp
ENV PYTHONUNBUFFERED=1
CMD ["python3", "yennefer_multimodal_cortex.py"]
DOCKERFILE
echo "Created genesis-q-mem/Dockerfile"
fi
# Landing Dockerfile (if missing)
if [ ! -f yennefer-core/Dockerfile ]; then
cat > yennefer-core/Dockerfile << 'DOCKERFILE'
# Yennefer Landing Server
FROM python:3.12-slim
WORKDIR /app
RUN pip install --no-cache-dir flask stripe gunicorn
COPY *.py /app/
COPY templates/ /app/templates/
EXPOSE 8000
CMD ["gunicorn", "-b", "0.0.0.0:8000", "landing_server:app"]
DOCKERFILE
echo "Created yennefer-core/Dockerfile"
fi
- name: Commit Dockerfiles
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "chore: Add missing Dockerfiles for CI/CD"
file_pattern: "**/Dockerfile*"
# ═══════════════════════════════════════════════════════════════════════════
# DOCKER COMPOSE VALIDATION
# ═══════════════════════════════════════════════════════════════════════════
validate-compose:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4
- name: Validate docker-compose files
run: |
for f in docker-compose*.yml; do
if [ -f "$f" ]; then
echo "Validating: $f"
docker compose -f "$f" config --quiet && echo " ✓ Valid" || echo " ✗ Invalid"
fi
done
- name: Test compose up (dry-run)
run: |
if [ -f docker-compose.yml ]; then
docker compose config
fi