Compare commits
2 Commits
fix/deploy
...
fix/flaky-
| Author | SHA1 | Date | |
|---|---|---|---|
| 143c08ea12 | |||
| 892ffd637f |
@@ -340,6 +340,8 @@ steps:
|
|||||||
|
|
||||||
# ─── Deploy to Docker Swarm (main only) ─────────────────────
|
# ─── Deploy to Docker Swarm (main only) ─────────────────────
|
||||||
|
|
||||||
|
# ─── Deploy to Docker Swarm via Portainer (main only) ─────────────────────
|
||||||
|
|
||||||
deploy-swarm:
|
deploy-swarm:
|
||||||
image: alpine:3
|
image: alpine:3
|
||||||
environment:
|
environment:
|
||||||
@@ -347,29 +349,29 @@ steps:
|
|||||||
from_secret: ssh_private_key
|
from_secret: ssh_private_key
|
||||||
SSH_KNOWN_HOSTS:
|
SSH_KNOWN_HOSTS:
|
||||||
from_secret: ssh_known_hosts
|
from_secret: ssh_known_hosts
|
||||||
GITEA_USER:
|
PORTAINER_URL:
|
||||||
from_secret: gitea_username
|
from_secret: portainer_url
|
||||||
GITEA_TOKEN:
|
PORTAINER_API_KEY:
|
||||||
from_secret: gitea_token
|
from_secret: portainer_api_key
|
||||||
commands:
|
commands:
|
||||||
- apk add --no-cache openssh-client
|
- apk add --no-cache curl openssh-client
|
||||||
- |
|
- |
|
||||||
set -e
|
set -e
|
||||||
# Setup SSH
|
echo "🚀 Deploying to Docker Swarm..."
|
||||||
|
|
||||||
|
# Setup SSH for fallback
|
||||||
mkdir -p ~/.ssh
|
mkdir -p ~/.ssh
|
||||||
echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
|
echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
|
||||||
chmod 600 ~/.ssh/known_hosts
|
chmod 600 ~/.ssh/known_hosts
|
||||||
echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_ed25519
|
echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_ed25519
|
||||||
chmod 600 ~/.ssh/id_ed25519
|
chmod 600 ~/.ssh/id_ed25519
|
||||||
|
|
||||||
# Deploy to swarm - force update to pull new images
|
# Force service updates (images are pulled from public registry)
|
||||||
echo "🚀 Deploying to Docker Swarm..."
|
|
||||||
ssh -o StrictHostKeyChecking=no localadmin@10.1.1.45 \
|
ssh -o StrictHostKeyChecking=no localadmin@10.1.1.45 \
|
||||||
"docker login git.mosaicstack.dev -u \$GITEA_USER -p \$GITEA_TOKEN && \
|
"docker service update --with-registry-auth --force mosaic-stack-api && \
|
||||||
docker service update --force mosaic_api && \
|
docker service update --with-registry-auth --force mosaic-stack-web && \
|
||||||
docker service update --force mosaic_web && \
|
docker service update --with-registry-auth --force mosaic-stack-orchestrator && \
|
||||||
docker service update --force mosaic_orchestrator && \
|
docker service update --with-registry-auth --force mosaic-stack-coordinator && \
|
||||||
docker service update --force mosaic_coordinator && \
|
|
||||||
echo '✅ All services updated'"
|
echo '✅ All services updated'"
|
||||||
when:
|
when:
|
||||||
- branch: [main]
|
- branch: [main]
|
||||||
|
|||||||
@@ -601,9 +601,21 @@ class TestCoordinatorIntegration:
|
|||||||
coordinator = Coordinator(queue_manager=queue_manager, poll_interval=0.02)
|
coordinator = Coordinator(queue_manager=queue_manager, poll_interval=0.02)
|
||||||
|
|
||||||
task = asyncio.create_task(coordinator.start())
|
task = asyncio.create_task(coordinator.start())
|
||||||
await asyncio.sleep(0.5) # Allow time for processing
|
|
||||||
await coordinator.stop()
|
|
||||||
|
|
||||||
|
# Poll for completion with timeout instead of fixed sleep
|
||||||
|
deadline = asyncio.get_event_loop().time() + 5.0 # 5 second timeout
|
||||||
|
while asyncio.get_event_loop().time() < deadline:
|
||||||
|
all_completed = True
|
||||||
|
for i in range(157, 162):
|
||||||
|
item = queue_manager.get_item(i)
|
||||||
|
if item is None or item.status != QueueItemStatus.COMPLETED:
|
||||||
|
all_completed = False
|
||||||
|
break
|
||||||
|
if all_completed:
|
||||||
|
break
|
||||||
|
await asyncio.sleep(0.05)
|
||||||
|
|
||||||
|
await coordinator.stop()
|
||||||
task.cancel()
|
task.cancel()
|
||||||
try:
|
try:
|
||||||
await task
|
await task
|
||||||
|
|||||||
Reference in New Issue
Block a user