Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
1ec1a76
feat: added new alpha github run
CodeMaster4711 Mar 8, 2026
dd5d522
fix: manifest build
CodeMaster4711 Mar 8, 2026
8374e07
Merge pull request #89 from CS-Foundry/main
CodeMaster4711 Mar 8, 2026
5b72069
Merge pull request #90 from CS-Foundry/main
CodeMaster4711 Mar 11, 2026
d951bf8
Merge pull request #91 from CS-Foundry/main
CodeMaster4711 Mar 11, 2026
0a33b2b
feat: added update mech
CodeMaster4711 Mar 12, 2026
fa07190
fix: repo
CodeMaster4711 Mar 12, 2026
988342b
feat(api-gateway): restrict system update endpoint to admin-only via …
CodeMaster4711 Mar 12, 2026
13e9fdf
fix(csf-updater): validate version string from etcd before executing …
CodeMaster4711 Mar 12, 2026
22cf1e5
fix(csf-updater): run as dedicated system user with docker group inst…
CodeMaster4711 Mar 12, 2026
ba2a887
feat(etcd): enable authentication and restrict access to csf service …
CodeMaster4711 Mar 12, 2026
f791f42
feat(csf-updater): verify image digests against GHCR before applying …
CodeMaster4711 Mar 12, 2026
34e1cd2
fix(etcd): block etcd ports from external access via firewall rules i…
CodeMaster4711 Mar 12, 2026
4de4223
Merge pull request #106 from CSFX-cloud/feat/atomic-update-mechanism-#94
CodeMaster4711 Mar 12, 2026
7900bdf
test: new test release version
CodeMaster4711 Mar 12, 2026
db4cd80
chore: trigger pre-release build
CodeMaster4711 Mar 12, 2026
b5a21c4
Merge pull request #107 from CSFX-cloud/feat/atomic-update-mechanism-#94
CodeMaster4711 Mar 12, 2026
eb065a0
feat(csf-updater): implement secure rust-based updater daemon with ni…
CodeMaster4711 Mar 12, 2026
73d7ed3
chore: remove etcd auth setup from docker-compose and services
CodeMaster4711 Mar 12, 2026
fd06098
Merge pull request #108 from CSFX-cloud/feat/atomic-update-mechanism-#94
CodeMaster4711 Mar 12, 2026
c71c60f
fix: workflow
CodeMaster4711 Mar 12, 2026
eb3df31
feat: build csf-updater locally via nix and publish alpha binaries to…
CodeMaster4711 Mar 14, 2026
3d759e1
Merge pull request #109 from CSFX-cloud/ci/fix_agnet_and_updater_binary
CodeMaster4711 Mar 14, 2026
50a89e8
fix: resolve musl build failure for csf-updater binary
CodeMaster4711 Mar 14, 2026
8d18efb
feat: inject CSF_BUILD_VERSION into binaries at compile time via bui…
CodeMaster4711 Mar 14, 2026
4ebd5f2
Merge pull request #110 from CSFX-cloud/ci/fix_agnet_and_updater_binary
CodeMaster4711 Mar 14, 2026
cbf629f
ci: fix open ssl dep build error
CodeMaster4711 Mar 14, 2026
f44e3be
Merge pull request #111 from CSFX-cloud/ci/fix_agnet_and_updater_binary
CodeMaster4711 Mar 14, 2026
478be75
ci: fix rm openssl dep
CodeMaster4711 Mar 14, 2026
797dbb5
Merge pull request #112 from CSFX-cloud/ci/fix_agnet_and_updater_binary
CodeMaster4711 Mar 14, 2026
03cb75e
ci: added new agent build workflow
CodeMaster4711 Mar 14, 2026
114aa40
ci: fix build error
CodeMaster4711 Mar 14, 2026
24c3840
Merge pull request #113 from CSFX-cloud/ci/fix_agnet_and_updater_binary
CodeMaster4711 Mar 14, 2026
15a9aba
ci: added amd64 build step
CodeMaster4711 Mar 14, 2026
7844ab0
Merge pull request #114 from CSFX-cloud/ci/fix_agnet_and_updater_binary
CodeMaster4711 Mar 14, 2026
9667a8d
ci: updated version nix config for testing
CodeMaster4711 Mar 15, 2026
0db6622
Merge pull request #115 from CSFX-cloud/ci/fix_agnet_and_updater_binary
CodeMaster4711 Mar 15, 2026
ebfdf55
fix: nix error
CodeMaster4711 Mar 15, 2026
48d2bde
fix: nix compile error
CodeMaster4711 Mar 15, 2026
8d6d32e
fix: nix compile error
CodeMaster4711 Mar 15, 2026
1a44dc1
fix: etcd connection error
CodeMaster4711 Mar 15, 2026
5bf29ab
fix: updater flow with api-gateway
CodeMaster4711 Mar 15, 2026
1de5b80
Merge pull request #116 from CSFX-cloud/fix/updater-flow-cli
CodeMaster4711 Mar 15, 2026
b240555
ci: fix nix docker version
CodeMaster4711 Mar 15, 2026
e10e08f
fix: path error in updater
CodeMaster4711 Mar 15, 2026
1d80789
fix: nix config with path
CodeMaster4711 Mar 15, 2026
b62b2d1
feat: added gh token for image pulling without rate limiting
CodeMaster4711 Mar 15, 2026
9a7950e
Merge pull request #117 from CSFX-cloud/fix/updater-flow-cli
CodeMaster4711 Mar 15, 2026
0230d7f
fix: nixos test version updated
CodeMaster4711 Mar 16, 2026
c60c68f
chore: fix nix os build error
CodeMaster4711 Mar 16, 2026
6b5adf7
fix: nix config error
CodeMaster4711 Mar 16, 2026
2b46867
fix: nixos updater error
CodeMaster4711 Mar 16, 2026
d8f7457
fix: docker updater error
CodeMaster4711 Mar 16, 2026
28c0247
fix: lock state when updater go into error
CodeMaster4711 Mar 16, 2026
f9fec00
Merge pull request #118 from CSFX-cloud/fix/updater-flow-cli
CodeMaster4711 Mar 16, 2026
324e49a
ci: fix docker build
CodeMaster4711 Mar 16, 2026
4651d33
Merge pull request #119 from CSFX-cloud/fix/updater-flow-cli
CodeMaster4711 Mar 16, 2026
fdd4d7e
fix: strip digest newlines to prevent invalid image reference in mani…
CodeMaster4711 Mar 16, 2026
5e3da00
ci: fix docker manifest error
CodeMaster4711 Mar 17, 2026
3d9b26c
fix: updater flow
CodeMaster4711 Mar 17, 2026
64cfcec
fix: nixos version
CodeMaster4711 Mar 17, 2026
ce45cba
fix: docker access in updater error
CodeMaster4711 Mar 17, 2026
fd01b36
feat: added update stop and resume
CodeMaster4711 Mar 17, 2026
64e4326
feat: use mutable binary paths for csf-agent and csf-updater to enabl…
CodeMaster4711 Mar 17, 2026
847dfe5
feat: add binary self-update for csf-agent and csf-updater via gith…
CodeMaster4711 Mar 17, 2026
ddc22b8
fix: remove NoNewPrivileges to allow sudo systemctl for binary restart
CodeMaster4711 Mar 17, 2026
08030a9
feat: expose agent and updater binary versions in update-status
CodeMaster4711 Mar 17, 2026
2b3260f
fix: restrict binary dir permissions and verify sha256 checksum on do…
CodeMaster4711 Mar 17, 2026
f874061
Merge pull request #120 from CSFX-cloud/fix/updater-small-bugs
CodeMaster4711 Mar 17, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,16 @@ POSTGRES_DB=csf_core

# Rust log level (trace, debug, info, warn, error)
RUST_LOG=info

# Docker image registry (GHCR org name, lowercase)
GHCR_ORG=local
# Image version tag — use "dev" for local builds, semver for prod (e.g. 0.2.2)
CSF_VERSION=dev

# etcd auth — generate with: openssl rand -hex 32
ETCD_ROOT_PASSWORD=
ETCD_CSF_PASSWORD=

# GHCR read token for image digest verification (csf-updater)
# generate at: https://github.com/settings/tokens — scope: read:packages
GHCR_TOKEN=
152 changes: 147 additions & 5 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@ on:
description: "Version tag (e.g. 1.2.3)"
required: true
type: string
push:
branches:
- develop

permissions:
contents: read
contents: write
packages: write

jobs:
Expand All @@ -21,10 +24,12 @@ jobs:
runs-on: ubuntu-latest
if: >
github.event_name == 'workflow_dispatch' ||
github.event_name == 'push' ||
(github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success')
outputs:
version: ${{ steps.version.outputs.version }}
should_build: ${{ steps.version.outputs.should_build }}
is_release: ${{ steps.version.outputs.is_release }}
steps:
- uses: actions/checkout@v4

Expand All @@ -34,13 +39,22 @@ jobs:
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
echo "version=${{ inputs.version }}" >> $GITHUB_OUTPUT
echo "should_build=true" >> $GITHUB_OUTPUT
echo "is_release=true" >> $GITHUB_OUTPUT
elif [ "${{ github.event_name }}" = "push" ]; then
VERSION=$(grep '^version' Cargo.toml | head -1 | sed 's/.*"\(.*\)".*/\1/')
RUN_NUM="${{ github.run_number }}"
echo "version=${VERSION}-alpha.${RUN_NUM}" >> $GITHUB_OUTPUT
echo "should_build=true" >> $GITHUB_OUTPUT
echo "is_release=false" >> $GITHUB_OUTPUT
else
TAG=$(gh release list --limit 1 --json tagName -q '.[0].tagName' 2>/dev/null || echo "")
if [ -z "$TAG" ]; then
echo "should_build=false" >> $GITHUB_OUTPUT
echo "is_release=false" >> $GITHUB_OUTPUT
else
echo "version=${TAG#v}" >> $GITHUB_OUTPUT
echo "should_build=true" >> $GITHUB_OUTPUT
echo "is_release=true" >> $GITHUB_OUTPUT
fi
fi
env:
Expand All @@ -61,6 +75,9 @@ jobs:
- volume-manager
- failover-controller
- sdn-controller
arch:
- amd64
- arm64
include:
- arch: amd64
runner: ubuntu-latest
Expand Down Expand Up @@ -96,6 +113,7 @@ jobs:
build-args: |
SERVICE_BIN=${{ matrix.service }}
BUILD_JOBS=2
CSF_BUILD_VERSION=${{ needs.prepare.outputs.version }}
push: true
outputs: type=registry,name=${{ steps.image.outputs.name }},push-by-digest=true
platforms: ${{ matrix.platform }}
Expand All @@ -114,6 +132,71 @@ jobs:
path: /tmp/digests/${{ matrix.service }}-${{ matrix.arch }}.txt
retention-days: 1

build-binaries:
name: Build ${{ matrix.binary }} (${{ matrix.arch }})
runs-on: ${{ matrix.runner }}
needs: prepare
if: needs.prepare.outputs.should_build == 'true'
strategy:
fail-fast: false
matrix:
binary:
- csf-updater
- csf-agent
arch:
- amd64
- arm64
include:
- arch: amd64
runner: ubuntu-latest
target: x86_64-unknown-linux-musl
- arch: arm64
runner: ubuntu-24.04-arm
target: aarch64-unknown-linux-musl
steps:
- uses: actions/checkout@v4

- name: Install build dependencies
run: |
sudo apt-get update
if [ "${{ matrix.arch }}" = "amd64" ]; then
sudo apt-get install -y musl-tools protobuf-compiler
else
sudo apt-get install -y gcc-aarch64-linux-gnu musl-tools protobuf-compiler
fi

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}

- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ matrix.binary }}-${{ matrix.arch }}-${{ hashFiles('**/Cargo.lock') }}

- name: Build
env:
CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_LINKER: musl-gcc
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER: aarch64-linux-gnu-gcc
CSF_BUILD_VERSION: ${{ needs.prepare.outputs.version }}
run: |
cargo build --release --bin ${{ matrix.binary }} --target ${{ matrix.target }}
cp target/${{ matrix.target }}/release/${{ matrix.binary }} ${{ matrix.binary }}-${{ matrix.arch }}
sha256sum ${{ matrix.binary }}-${{ matrix.arch }} > ${{ matrix.binary }}-${{ matrix.arch }}.sha256

- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.binary }}-${{ matrix.arch }}
path: |
${{ matrix.binary }}-${{ matrix.arch }}
${{ matrix.binary }}-${{ matrix.arch }}.sha256
retention-days: 7

manifest:
name: Manifest ${{ matrix.service }}
runs-on: ubuntu-latest
Expand Down Expand Up @@ -155,29 +238,88 @@ jobs:
run: |
VERSION="${{ needs.prepare.outputs.version }}"
IMAGE="${{ steps.image.outputs.name }}"
AMD64=$(cat /tmp/digests/${{ matrix.service }}-amd64.txt)
ARM64=$(cat /tmp/digests/${{ matrix.service }}-arm64.txt)

if [ -z "${VERSION}" ]; then
echo "VERSION is empty, aborting"
exit 1
fi

AMD64=$(tr -d '[:space:]' < /tmp/digests/${{ matrix.service }}-amd64.txt)
ARM64=$(tr -d '[:space:]' < /tmp/digests/${{ matrix.service }}-arm64.txt)

docker buildx imagetools create \
-t ${IMAGE}:${VERSION} \
-t ${IMAGE}:latest \
${IMAGE}@${AMD64} \
${IMAGE}@${ARM64}

attach-binaries-release:
name: Attach binaries to release
runs-on: ubuntu-latest
needs: [prepare, build-binaries]
steps:
- uses: actions/checkout@v4

- uses: actions/download-artifact@v4
with:
pattern: csf-*
merge-multiple: true

- name: Create or update release
run: |
VERSION="${{ needs.prepare.outputs.version }}"
TAG="v${VERSION}"
if gh release view "${TAG}" &>/dev/null; then
gh release upload "${TAG}" \
csf-updater-amd64 \
csf-updater-amd64.sha256 \
csf-updater-arm64 \
csf-updater-arm64.sha256 \
csf-agent-amd64 \
csf-agent-amd64.sha256 \
csf-agent-arm64 \
csf-agent-arm64.sha256 \
--clobber
else
gh release create "${TAG}" \
--title "v${VERSION}" \
--prerelease \
--notes "Alpha build ${VERSION}" \
csf-updater-amd64 \
csf-updater-amd64.sha256 \
csf-updater-arm64 \
csf-updater-arm64.sha256 \
csf-agent-amd64 \
csf-agent-amd64.sha256 \
csf-agent-arm64 \
csf-agent-arm64.sha256
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

summary:
name: Summary
runs-on: ubuntu-latest
needs: [prepare, manifest]
needs: [prepare, manifest, build-binaries]
if: always()
steps:
- name: Write summary
run: |
VERSION="${{ needs.prepare.outputs.version }}"
ORG=$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]')
echo "## Docker Build — v${VERSION}" >> $GITHUB_STEP_SUMMARY
echo "## Build — v${VERSION}" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Docker Images" >> $GITHUB_STEP_SUMMARY
echo "| Service | Image |" >> $GITHUB_STEP_SUMMARY
echo "|---------|-------|" >> $GITHUB_STEP_SUMMARY
for svc in api-gateway registry scheduler volume-manager failover-controller sdn-controller; do
echo "| ${svc} | \`ghcr.io/${ORG}/csf-ce-${svc}:${VERSION}\` |" >> $GITHUB_STEP_SUMMARY
done
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Binaries" >> $GITHUB_STEP_SUMMARY
echo "| Binary | Arch | Artifact |" >> $GITHUB_STEP_SUMMARY
echo "|--------|------|----------|" >> $GITHUB_STEP_SUMMARY
for bin in csf-updater csf-agent; do
echo "| ${bin} | amd64 | \`${bin}-amd64\` |" >> $GITHUB_STEP_SUMMARY
echo "| ${bin} | arm64 | \`${bin}-arm64\` |" >> $GITHUB_STEP_SUMMARY
done
Loading
Loading