Skip to content

Commit dedb881

Browse files
committed
pr feedback
1 parent 459b929 commit dedb881

File tree

4 files changed

+21
-12
lines changed

4 files changed

+21
-12
lines changed

.github/workflows/cloud-runner-integrity.yml

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,18 +41,19 @@ jobs:
4141
run: |
4242
curl -s https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh | bash
4343
k3d version | cat
44-
- name: Start LocalStack (S3) for k3d access
44+
- name: Start LocalStack (S3) on host
4545
run: |
46-
# Start LocalStack manually to ensure it's accessible from k3d cluster
46+
# Start LocalStack on the host to simulate external S3 (like production)
4747
# Stop any existing LocalStack containers
4848
docker stop localstack-k3d 2>/dev/null || true
4949
docker rm localstack-k3d 2>/dev/null || true
50-
# Start LocalStack with port mapping to make it accessible from k3d
50+
# Start LocalStack with port exposed, listening on all interfaces
5151
docker run -d --name localstack-k3d \
52-
-p 4566:4566 \
52+
-p 0.0.0.0:4566:4566 \
5353
-e SERVICES=s3,cloudformation,ecs,kinesis,cloudwatch,logs \
5454
-e DEBUG=1 \
5555
-e DOCKER_HOST=unix:///var/run/docker.sock \
56+
-e LOCALSTACK_HOST=0.0.0.0 \
5657
localstack/localstack:latest
5758
# Wait for LocalStack to be ready
5859
echo "Waiting for LocalStack to be ready..."
@@ -64,6 +65,8 @@ jobs:
6465
echo "Waiting for LocalStack... ($i/30)"
6566
sleep 2
6667
done
68+
# Verify LocalStack is accessible
69+
curl -s http://localhost:4566/_localstack/health | head -5 || echo "LocalStack health check"
6770
- name: Install awscli-local
6871
run: |
6972
pip install awscli-local || pip3 install awscli-local || echo "awslocal installation skipped"
@@ -74,11 +77,11 @@ jobs:
7477
- name: Create k3s cluster (k3d)
7578
timeout-minutes: 5
7679
run: |
77-
# Create cluster with basic configuration
78-
# Using simpler setup to avoid hangs - resource limits handled via container requests
79-
k3d cluster create unity-builder --agents 1 --wait
80+
# Create cluster with port mapping to expose host services
81+
# Map host port 4566 to agent node so pods can access LocalStack via host.k3d.internal
82+
k3d cluster create unity-builder --agents 1 --port "4566:4566@agent:0" --wait
8083
kubectl config current-context | cat
81-
- name: Verify cluster readiness
84+
- name: Verify cluster readiness and LocalStack connectivity
8285
timeout-minutes: 2
8386
run: |
8487
for i in {1..60}; do
@@ -93,9 +96,11 @@ jobs:
9396
kubectl get storageclass
9497
# Show node resources
9598
kubectl describe nodes | grep -A 5 "Allocated resources" || true
96-
# Verify LocalStack is accessible from cluster via host.k3d.internal
97-
echo "Testing LocalStack connectivity from k3d cluster..."
98-
kubectl run test-localstack-connectivity --image=curlimages/curl --rm -i --restart=Never --timeout=10s -- curl -s --max-time 5 http://host.k3d.internal:4566/_localstack/health 2>&1 || echo "Note: LocalStack connectivity test - this is expected to work once LocalStack is fully ready"
99+
# Test LocalStack connectivity from cluster
100+
echo "Testing LocalStack connectivity from k3d cluster via host.k3d.internal:4566..."
101+
kubectl run test-localstack --image=curlimages/curl --rm -i --restart=Never --timeout=10s -- \
102+
curl -s --max-time 5 http://host.k3d.internal:4566/_localstack/health 2>&1 | head -10 || \
103+
echo "Note: If this fails, LocalStack may need additional network configuration"
99104
- uses: actions/setup-node@v4
100105
with:
101106
node-version: 20

dist/index.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/model/cloud-runner/providers/k8s/kubernetes-job-spec-factory.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ class KubernetesJobSpecFactory {
3939
endpointEnvNames.has(x.name) &&
4040
(value.startsWith('http://localhost') || value.startsWith('http://127.0.0.1'))
4141
) {
42+
// Replace localhost with host.k3d.internal so pods can access host services
43+
// This simulates accessing external services (like real AWS S3)
4244
value = value
4345
.replace('http://localhost', 'http://host.k3d.internal')
4446
.replace('http://127.0.0.1', 'http://host.k3d.internal');

0 commit comments

Comments
 (0)