diff --git a/.github/workflows/build-iso.yml b/.github/workflows/build-iso.yml index 2f0c5be..b4c3a9b 100644 --- a/.github/workflows/build-iso.yml +++ b/.github/workflows/build-iso.yml @@ -4,7 +4,6 @@ on: push: branches: - main - - develop - "feat/**" - "fix/**" - "chore/**" @@ -120,11 +119,30 @@ jobs: ${{ matrix.config }}-${{ matrix.arch }}.iso.sha256 retention-days: 3 + version-check: + name: Resolve release channel + runs-on: ubuntu-latest + needs: build + outputs: + is_full_release: ${{ steps.channel.outputs.is_full_release }} + steps: + - uses: actions/checkout@v7 + + - name: Determine release channel + id: channel + run: | + VERSION=$(grep -m1 'version' versions.nix | sed 's/[^"]*"\([^"]*\)".*/\1/') + if [[ "${{ github.ref }}" == "refs/heads/main" && ! "$VERSION" =~ -(alpha|beta|rc)\. ]]; then + echo "is_full_release=true" >> $GITHUB_OUTPUT + else + echo "is_full_release=false" >> $GITHUB_OUTPUT + fi + release-dev: name: Publish dev ISOs runs-on: ubuntu-latest - needs: build - if: github.ref != 'refs/heads/main' + needs: version-check + if: needs.version-check.outputs.is_full_release == 'false' steps: - uses: actions/checkout@v7 with: @@ -173,8 +191,8 @@ jobs: release: name: Publish ISOs to Release runs-on: ubuntu-latest - needs: build - if: github.ref == 'refs/heads/main' + needs: version-check + if: needs.version-check.outputs.is_full_release == 'true' steps: - uses: actions/checkout@v7 @@ -186,7 +204,7 @@ jobs: - name: Determine version id: ver run: | - VERSION=$(grep 'version' versions.nix | head -1 | sed 's/.*"\(.*\)"/\1/') + VERSION=$(grep -m1 'version' versions.nix | sed 's/[^"]*"\([^"]*\)".*/\1/') echo "version=${VERSION}" >> $GITHUB_OUTPUT - name: Upload to release diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index dcd5b0b..1bfc020 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -5,7 +5,6 @@ on: push: branches: - main - - develop jobs: nix-check: diff --git a/flake.nix b/flake.nix index 45173d0..33187ec 100644 --- a/flake.nix +++ b/flake.nix @@ -63,7 +63,7 @@ services = { csfx-agent = { enable = true; - gatewayUrl = "http://localhost:8000"; + gatewayUrl = "https://localhost:8000"; }; csfx-cp = { enable = true; diff --git a/modules/csfx-agent.nix b/modules/csfx-agent.nix index ea0a406..c9455d9 100644 --- a/modules/csfx-agent.nix +++ b/modules/csfx-agent.nix @@ -42,6 +42,21 @@ in }; config = lib.mkIf cfg.enable { + virtualisation.docker = { + enable = lib.mkDefault true; + enableOnBoot = lib.mkDefault false; + }; + + security.polkit.extraConfig = '' + polkit.addRule(function(action, subject) { + if (action.id == "org.freedesktop.systemd1.manage-units" && + action.lookup("unit") == "docker.service" && + subject.user == "csfx-agent") { + return polkit.Result.YES; + } + }); + ''; + users = { users = { csfx-agent = { diff --git a/modules/csfx-setup.nix b/modules/csfx-setup.nix index 76a6f56..05d5ca8 100644 --- a/modules/csfx-setup.nix +++ b/modules/csfx-setup.nix @@ -212,15 +212,17 @@ in description = "CSFX Control Plane readiness check"; wantedBy = [ "multi-user.target" ]; after = [ "csfx-api-gateway.service" ]; + requires = [ "csfx-api-gateway.service" ]; serviceConfig = { Type = "oneshot"; RemainAfterExit = true; + TimeoutStartSec = 360; User = "root"; ExecStart = pkgs.writeShellScript "csfx-cp-ready" '' set -euo pipefail CURL=${pkgs.curl}/bin/curl - TIMEOUT=120 + TIMEOUT=300 ELAPSED=0 while [ "$ELAPSED" -lt "$TIMEOUT" ]; do diff --git a/versions.nix b/versions.nix index 043cee2..d9dd331 100644 --- a/versions.nix +++ b/versions.nix @@ -1,101 +1,101 @@ { csfx = { - version = "0.2.2-alpha.578"; + version = "0.2.2-alpha.589"; agent = { amd64 = { - url = "https://github.com/CSFX-cloud/CSFX-Core/releases/download/v0.2.2-alpha.578/csfx-agent-amd64"; - sha256 = "f1e6a6a8e8728f432df5956262b0aa45e92ddb9a7c2f17e1b1f74aa7b7604897"; + url = "https://github.com/CSFX-cloud/CSFX-Core/releases/download/v0.2.2-alpha.589/csfx-agent-amd64"; + sha256 = "e9b5ac235b74bedadd540c327104c351f7bfb25cf6478b5e0a0f7b2b34924368"; }; arm64 = { - url = "https://github.com/CSFX-cloud/CSFX-Core/releases/download/v0.2.2-alpha.578/csfx-agent-arm64"; - sha256 = "cc41d787b6161a07a5af131cf8e4d04362c42428762ffd909e17c4a2938fdcca"; + url = "https://github.com/CSFX-cloud/CSFX-Core/releases/download/v0.2.2-alpha.589/csfx-agent-arm64"; + sha256 = "9efccd005f31762c44ab62ef584eb07d87b36ef7173a7053e47532acd2f3d8f1"; }; }; controlPlane = { migrate = { amd64 = { - url = "https://github.com/CSFX-cloud/CSFX-Core/releases/download/v0.2.2-alpha.578/csfx-cp-csfx-migrate-amd64"; - sha256 = "80c735603265f07c6cb6eca289e83c8eba69846df806767e7aa2e4cda184c963"; + url = "https://github.com/CSFX-cloud/CSFX-Core/releases/download/v0.2.2-alpha.589/csfx-cp-csfx-migrate-amd64"; + sha256 = "fe421176f7b1cb23ad8b83b760c4674dfb973b65288c94bcbe7506520165c04b"; }; arm64 = { - url = "https://github.com/CSFX-cloud/CSFX-Core/releases/download/v0.2.2-alpha.578/csfx-cp-csfx-migrate-arm64"; - sha256 = "160af34d0a17fb4883ab273c13dff7be9387648aeb6a9861a7642a6bcf6eda0c"; + url = "https://github.com/CSFX-cloud/CSFX-Core/releases/download/v0.2.2-alpha.589/csfx-cp-csfx-migrate-arm64"; + sha256 = "17a7aaddc47c69ae8821bb96584ead9c2c615aa707d118240e2abeec80850e33"; }; }; api-gateway = { amd64 = { - url = "https://github.com/CSFX-cloud/CSFX-Core/releases/download/v0.2.2-alpha.578/csfx-cp-api-gateway-amd64"; - sha256 = "90b0a3ccf42a7b86a3eeb107f964bb357845d8cca6c4b8d16a8e311b0c3fc19e"; + url = "https://github.com/CSFX-cloud/CSFX-Core/releases/download/v0.2.2-alpha.589/csfx-cp-api-gateway-amd64"; + sha256 = "fb10d15aaa1f0fa220095687f27abd8aa46a5af9ed2a02afe5529907a597538e"; }; arm64 = { - url = "https://github.com/CSFX-cloud/CSFX-Core/releases/download/v0.2.2-alpha.578/csfx-cp-api-gateway-arm64"; - sha256 = "2086321539a47de0d55b83c0509a18f9cf68cdc50ff697f7527d65287218d11f"; + url = "https://github.com/CSFX-cloud/CSFX-Core/releases/download/v0.2.2-alpha.589/csfx-cp-api-gateway-arm64"; + sha256 = "f2980de8b5dce4244385380d45159ebc4a3375faae5b16687cd73ac46464e0ae"; }; }; registry = { amd64 = { - url = "https://github.com/CSFX-cloud/CSFX-Core/releases/download/v0.2.2-alpha.578/csfx-cp-registry-amd64"; - sha256 = "b5e200b5a359d7c7feb2b70977683b37905fbfb11cf12c8a1cf4b3fee35a83c8"; + url = "https://github.com/CSFX-cloud/CSFX-Core/releases/download/v0.2.2-alpha.589/csfx-cp-registry-amd64"; + sha256 = "4480036af525b850c7b2aac4cc735ab1e2e8620d4d11ebe37f021fb22a1e035f"; }; arm64 = { - url = "https://github.com/CSFX-cloud/CSFX-Core/releases/download/v0.2.2-alpha.578/csfx-cp-registry-arm64"; - sha256 = "0c4ca62522a9b76407948c3c7b44f3d8d56b14087c9edc572ba66e7bd9ef0de0"; + url = "https://github.com/CSFX-cloud/CSFX-Core/releases/download/v0.2.2-alpha.589/csfx-cp-registry-arm64"; + sha256 = "8dd5275cf88b26283a57d194af46930dc4eec1f2cd4db296b8a61169e6f730cd"; }; }; scheduler = { amd64 = { - url = "https://github.com/CSFX-cloud/CSFX-Core/releases/download/v0.2.2-alpha.578/csfx-cp-scheduler-amd64"; - sha256 = "6603bc3dfbb27ac21e332063fac6b2d3a1be1bd11c3a5c9a11aa99a5919ac092"; + url = "https://github.com/CSFX-cloud/CSFX-Core/releases/download/v0.2.2-alpha.589/csfx-cp-scheduler-amd64"; + sha256 = "944bb143af040fc2f1100a008787ce2160bddc0fef840951f00eda46ec8490f4"; }; arm64 = { - url = "https://github.com/CSFX-cloud/CSFX-Core/releases/download/v0.2.2-alpha.578/csfx-cp-scheduler-arm64"; - sha256 = "a58adecce6fc0a7f7c4de647a2456300c3e7a5ba228b343e4c64cc030d7c3889"; + url = "https://github.com/CSFX-cloud/CSFX-Core/releases/download/v0.2.2-alpha.589/csfx-cp-scheduler-arm64"; + sha256 = "2c745894e78873198557fec05519fd75d1fac1db5c376b6bab786cf926e356c2"; }; }; volume-manager = { amd64 = { - url = "https://github.com/CSFX-cloud/CSFX-Core/releases/download/v0.2.2-alpha.578/csfx-cp-volume-manager-amd64"; - sha256 = "e46a4f80f89df1cb825b48aea325ce73071fb110a1db116ce4d2042fe77b58a1"; + url = "https://github.com/CSFX-cloud/CSFX-Core/releases/download/v0.2.2-alpha.589/csfx-cp-volume-manager-amd64"; + sha256 = "6ec2d91d0d7cf3c1bd4ba162f02e35d0ebde258cc2eaa4f741e1042b18fe47d5"; }; arm64 = { - url = "https://github.com/CSFX-cloud/CSFX-Core/releases/download/v0.2.2-alpha.578/csfx-cp-volume-manager-arm64"; - sha256 = "26f8b8ec7f3f71212c4d467eb3fb0923bd045482b6d6ba91a69894ca434289b8"; + url = "https://github.com/CSFX-cloud/CSFX-Core/releases/download/v0.2.2-alpha.589/csfx-cp-volume-manager-arm64"; + sha256 = "60fcf00d565145dd2115909c8e9ef9eef7c063cbbb8eea48a8e38c7b2ae16ba3"; }; }; failover-controller = { amd64 = { - url = "https://github.com/CSFX-cloud/CSFX-Core/releases/download/v0.2.2-alpha.578/csfx-cp-failover-controller-amd64"; - sha256 = "1bd7fc447a6661e379faf1c4d3eb9beefb271895d32fbebb3035421dcd1b8bd0"; + url = "https://github.com/CSFX-cloud/CSFX-Core/releases/download/v0.2.2-alpha.589/csfx-cp-failover-controller-amd64"; + sha256 = "b483228453905b779549421e4d9c5bdaaa173d9507fbe027c1a26c41991d974a"; }; arm64 = { - url = "https://github.com/CSFX-cloud/CSFX-Core/releases/download/v0.2.2-alpha.578/csfx-cp-failover-controller-arm64"; - sha256 = "6b91390952cdfefea0cfcc414886714d2b176d72d5ccd5852964d14c34e019e7"; + url = "https://github.com/CSFX-cloud/CSFX-Core/releases/download/v0.2.2-alpha.589/csfx-cp-failover-controller-arm64"; + sha256 = "56412594404ad19dad6d57074b2d53142845392f416767b25c95a5384088c36d"; }; }; sdn-controller = { amd64 = { - url = "https://github.com/CSFX-cloud/CSFX-Core/releases/download/v0.2.2-alpha.578/csfx-cp-sdn-controller-amd64"; - sha256 = "e3436cfd536a3821fe09abf7d8f0c8f3dd874398c5313678ae38784b6365b89b"; + url = "https://github.com/CSFX-cloud/CSFX-Core/releases/download/v0.2.2-alpha.589/csfx-cp-sdn-controller-amd64"; + sha256 = "96e7bccd64155274a5838576b153ed8418741bd2fa7a86b72dee351d07d8a6af"; }; arm64 = { - url = "https://github.com/CSFX-cloud/CSFX-Core/releases/download/v0.2.2-alpha.578/csfx-cp-sdn-controller-arm64"; - sha256 = "ac4eabc14e254017fb16b458eb339163827b8a27c62b335e316cfece3008edf9"; + url = "https://github.com/CSFX-cloud/CSFX-Core/releases/download/v0.2.2-alpha.589/csfx-cp-sdn-controller-arm64"; + sha256 = "c19bc3f4a96acc68acc9aa133cc1ebff29b33a52346cfba17d8f737c61e8162b"; }; }; csfx-updater = { amd64 = { - url = "https://github.com/CSFX-cloud/CSFX-Core/releases/download/v0.2.2-alpha.578/csfx-updater-amd64"; - sha256 = "f77c8171d6a0bfd19c1349a69959bf766a5527421a7dcc811a5f966ad08f5f00"; + url = "https://github.com/CSFX-cloud/CSFX-Core/releases/download/v0.2.2-alpha.589/csfx-updater-amd64"; + sha256 = "ff9638dec9ab21b4f1dac45958ab96bb4800fdd2c810d667b6cc857c91fc362f"; }; arm64 = { - url = "https://github.com/CSFX-cloud/CSFX-Core/releases/download/v0.2.2-alpha.578/csfx-updater-arm64"; - sha256 = "95ddd308abe30e818650d580f35a3a86619e18e6e5fbf9aef5b1210e750e94a9"; + url = "https://github.com/CSFX-cloud/CSFX-Core/releases/download/v0.2.2-alpha.589/csfx-updater-arm64"; + sha256 = "cfd76d53b940be91d8b8ca572eded445e1bdc34014a897740608cf246e53e146"; }; }; }; frontend = { - url = "https://github.com/CSFX-cloud/CSFX-Core/releases/download/v0.2.2-alpha.578/csfx-frontend.tar.gz"; - sha256 = "a4d9d620c98187062db3ffde75a89fbfcbbc37407a20cb8112ac062a4e303fec"; + url = "https://github.com/CSFX-cloud/CSFX-Core/releases/download/v0.2.2-alpha.589/csfx-frontend.tar.gz"; + sha256 = "572b4e6ec05bf797579ee2e09b27ff6231e2f44d4ea3abbca85ca6e32dc5688e"; }; }; }