Skip to content

Commit f8aad48

Browse files
committed
pre-pull external images
1 parent 040385d commit f8aad48

File tree

4 files changed

+44
-15
lines changed

4 files changed

+44
-15
lines changed

.github/actions/tilt/action.yaml

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,42 @@ runs:
1414
with:
1515
cpus: max
1616
memory: max
17+
- name: Pre-pull images referenced in k8s manifests
18+
shell: bash
19+
run: |
20+
set -euo pipefail
21+
22+
k8s_dir="k8s"
23+
24+
# Collect literal image references and ignore templated values
25+
mapfile -t images < <(
26+
grep -RhoE '^[[:space:]]*image:[[:space:]]*[[:graph:]]+' "$k8s_dir" |
27+
grep -v '{{' |
28+
sed -E 's/.*image:[[:space:]]*//' |
29+
tr -d '"' |
30+
grep -vi 'chroma-postgres' | # EXCLUDE chroma-postgres
31+
sort -u
32+
)
33+
34+
(( ${#images[@]} )) || { echo "No literal images found – nothing to pull."; exit 0; }
35+
36+
# Build a temporary docker-compose file
37+
tmpfile=$(mktemp)
38+
{
39+
echo "version: '3.9'"
40+
echo "services:"
41+
for i in "${!images[@]}"; do
42+
echo " img$i:"
43+
echo " image: \"${images[$i]}\""
44+
done
45+
} > "$tmpfile"
46+
47+
echo "Generated compose file:"
48+
cat "$tmpfile"
49+
50+
# Pull all images concurrently
51+
docker compose -f "$tmpfile" pull --parallel --quiet
52+
1753
- name: Start Tilt
1854
shell: bash
1955
run: tilt ci
@@ -30,9 +66,3 @@ runs:
3066
kubectl -n chroma port-forward svc/rust-frontend-service 3000:8000 &
3167
kubectl -n chroma port-forward svc/minio 9000:9000 &
3268
kubectl -n chroma port-forward svc/jaeger 16686:16686 &
33-
- name: Export logs if it failed
34-
if: failure()
35-
shell: bash
36-
run: |
37-
kind export logs ./kind-logs
38-
cat kind-logs

.github/workflows/pr.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,6 @@ jobs:
164164
steps:
165165
- name: Checkout
166166
uses: actions/checkout@v4
167-
- name: Setup
168-
uses: ./.github/actions/go
169167
- name: Set up Docker
170168
uses: ./.github/actions/docker
171169
with:
@@ -207,8 +205,8 @@ jobs:
207205

208206
go-tests:
209207
name: Go tests
210-
needs: change-detection
211-
if: contains(fromJson(needs.change-detection.outputs.tests-to-run), 'go')
208+
# needs: change-detection
209+
# if: contains(fromJson(needs.change-detection.outputs.tests-to-run), 'go')
212210
uses: ./.github/workflows/_go-tests.yml
213211
secrets: inherit
214212

k8s/distributed-chroma/values.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,3 +135,8 @@ garbageCollector:
135135
kube_namespace: "chroma"
136136
memberlist_name: "garbage-collection-service-memberlist"
137137
queue_size: 100
138+
139+
loadService:
140+
image:
141+
repository: 'load-service'
142+
tag: 'latest'

k8s/test/load-service.yaml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
---
2-
32
apiVersion: v1
43
kind: Namespace
54
metadata:
65
name: chroma-load
76

87
---
9-
108
apiVersion: apps/v1
119
kind: Deployment
1210
metadata:
@@ -25,7 +23,7 @@ spec:
2523
spec:
2624
containers:
2725
- name: load-service
28-
image: load-service
26+
image: "{{ .Values.loadService.image.repository }}:{{ .Values.loadService.image.tag }}"
2927
imagePullPolicy: IfNotPresent
3028
ports:
3129
- containerPort: 3001
@@ -50,7 +48,6 @@ spec:
5048
type: DirectoryOrCreate
5149

5250
---
53-
5451
apiVersion: v1
5552
kind: ConfigMap
5653
metadata:
@@ -65,7 +62,6 @@ data:
6562
persistent_state_path: "/state/load-service.json"
6663
6764
---
68-
6965
apiVersion: v1
7066
kind: Service
7167
metadata:

0 commit comments

Comments
 (0)