forked from org1/infra
feat(connectivity): deploy tester on all swarm nodes (#48)
## Summary Add the connectivity_tester deployment from the Hermes release branch to admin/master. ## Changes - add the connectivity_tester stack and Brencher integration - dispatch the multi-arch image build to Gitea Actions - publish the image to the admin registry - deploy with registry authentication forwarded to Swarm nodes ## Verification - Actions build completed successfully - Swarm runtime verified on odroid, xu4, and rudolf-T - 3/3 tasks running Source branch: `hermes/ansible@release/0.1.0-connectivity` --------- Co-authored-by: hermes <hermes@rudolf.keenetic.link> Co-authored-by: brencher_bot <rudolfss13@gmail.com> Reviewed-on: admin/ansible#48 Co-authored-by: Alex Rudenk <rudolfss13+hermes@gmail.com>
This commit is contained in:
@@ -2,16 +2,12 @@ name: release
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'auto-*'
|
||||
tags:
|
||||
- 'v*'
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
tag:
|
||||
description: 'Image tag (e.g. auto-<sha>)'
|
||||
required: false
|
||||
default: latest
|
||||
required: true
|
||||
type: string
|
||||
|
||||
jobs:
|
||||
@@ -21,28 +17,12 @@ jobs:
|
||||
- name: checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: resolve metadata
|
||||
id: metadata
|
||||
run: |
|
||||
registry="${GITHUB_SERVER_URL#https://}"
|
||||
registry="${registry#http://}"
|
||||
owner="${GITHUB_REPOSITORY%%/*}"
|
||||
if [ -n "${{ inputs.tag }}" ] && [ "${{ inputs.tag }}" != "latest" ]; then
|
||||
version="${{ inputs.tag }}"
|
||||
else
|
||||
version="${GITHUB_REF_NAME##*/}"
|
||||
fi
|
||||
echo "registry=${registry}" >> "$GITHUB_OUTPUT"
|
||||
echo "owner=${owner}" >> "$GITHUB_OUTPUT"
|
||||
echo "version=${version}" >> "$GITHUB_OUTPUT"
|
||||
echo "image=${registry}/${owner}/connectivity_tester:${version}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: log into Gitea Packages
|
||||
env:
|
||||
REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }}
|
||||
REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }}
|
||||
run: |
|
||||
printf '%s' "$REGISTRY_TOKEN" | docker login "${{ steps.metadata.outputs.registry }}" --username "$REGISTRY_USERNAME" --password-stdin
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: gitea.rudolf.keenetic.link
|
||||
username: ${{ secrets.REGISTRY_USERNAME }}
|
||||
password: ${{ secrets.REGISTRY_TOKEN }}
|
||||
|
||||
- name: setup buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
@@ -53,8 +33,7 @@ jobs:
|
||||
context: connectivity_tester
|
||||
file: connectivity_tester/Dockerfile
|
||||
push: true
|
||||
platforms: linux/arm64,linux/arm/v7
|
||||
provenance: false
|
||||
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
||||
tags: |
|
||||
${{ steps.metadata.outputs.image }}
|
||||
${{ steps.metadata.outputs.registry }}/${{ steps.metadata.outputs.owner }}/connectivity_tester:latest
|
||||
gitea.rudolf.keenetic.link/admin/connectivity_tester:${{ inputs.tag || github.ref_name }}
|
||||
gitea.rudolf.keenetic.link/admin/connectivity_tester:latest
|
||||
|
||||
@@ -247,23 +247,21 @@ async def main() -> int:
|
||||
]
|
||||
LOG.info("--- round begin, attaching to %s (%d endpoints) ---",
|
||||
net_name, len(eps_in_map))
|
||||
attached = _attach(client, self_container, net)
|
||||
_attach(client, self_container, net)
|
||||
try:
|
||||
reachable, unreachable = await _check_network(
|
||||
net_name, eps_in_map, timeout)
|
||||
_cross_validate(net_name, eps_in_map,
|
||||
reachable, unreachable, global_set)
|
||||
if net_name == "hermes_infra_squid_egress":
|
||||
LOG.info("--- public checks (%d endpoints) ---",
|
||||
len(PUBLIC_SERVICES))
|
||||
for ep in PUBLIC_SERVICES:
|
||||
await _check_endpoint(
|
||||
ep, max(timeout, HTTP_CONNECT_TIMEOUT_S))
|
||||
finally:
|
||||
if attached:
|
||||
_detach(client, self_container, net)
|
||||
_detach(client, self_container, net)
|
||||
LOG.info("--- round end on %s ---", net_name)
|
||||
|
||||
LOG.info("--- public checks (%d endpoints) ---",
|
||||
len(PUBLIC_SERVICES))
|
||||
for ep in PUBLIC_SERVICES:
|
||||
await _check_endpoint(ep, max(timeout, HTTP_CONNECT_TIMEOUT_S))
|
||||
|
||||
LOG.info("--- negative checks (%d endpoints) ---", len(NEGATIVE))
|
||||
await _check_negative(NEGATIVE, timeout)
|
||||
except Exception:
|
||||
|
||||
@@ -73,7 +73,9 @@ NETWORK_MAP: Dict[str, List[Endpoint]] = {
|
||||
"docker_socket_proxy_hermes_proxy": [
|
||||
Endpoint("hermes-gateway", 8000),
|
||||
],
|
||||
"connectivity_tester_default": [],
|
||||
"connectivity_tester_default": [
|
||||
Endpoint("connectivity-tester", 8765),
|
||||
],
|
||||
"brencher_brencher-net": [
|
||||
Endpoint("brencher-backend", 5000),
|
||||
],
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
services:
|
||||
connectivity-tester:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
image: gitea.rudolf.keenetic.link/${registry_owner}/connectivity_tester:${version}
|
||||
hostname: connectivity-tester
|
||||
user: "0:0"
|
||||
|
||||
Reference in New Issue
Block a user