From fde778f8e059e9e9d97ad418b0fbc10a163a255f Mon Sep 17 00:00:00 2001 From: Nathan Klick Date: Thu, 29 Aug 2024 11:25:19 -0500 Subject: [PATCH] ci: update workflows to use latitude.sh based runners (#2495) * ci: update workflows to use latitude.sh based runners Signed-off-by: Nathan Klick * fix: remove cgroup support Signed-off-by: Nathan Klick --------- Signed-off-by: Nathan Klick --- .github/workflows/build.yml | 47 ++------------------------ .github/workflows/common_js.yml | 2 +- .github/workflows/pages.yml | 2 +- .github/workflows/publish_release.yaml | 6 ++-- .github/workflows/renovate.yml | 2 +- 5 files changed, 9 insertions(+), 50 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 224538d18..7831749fe 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,12 +20,12 @@ permissions: contents: read env: - CG_EXEC: export R_UID=$(id -u); CGROUP_LOGLEVEL=DEBUG cgexec -g cpu,memory:user.slice/user-${R_UID}.slice/user@${R_UID}.service/e2e-${{ github.run_id }} --sticky ionice -c 2 -n 2 nice -n 19 + CG_EXEC: ionice -c 2 -n 2 nice -n 19 jobs: build: name: Build using Node ${{ matrix.node }} - runs-on: [self-hosted, Linux, medium, ephemeral] + runs-on: client-sdk-linux-medium strategy: matrix: node: [ "16", "18" ] @@ -62,53 +62,12 @@ jobs: test: name: Test using Node ${{ matrix.node }} - runs-on: [self-hosted, Linux, large, ephemeral] + runs-on: client-sdk-linux-large strategy: matrix: node: [ "16" ] steps: - - name: Setup Control Groups - run: | - echo "::group::Get System Configuration" - USR_ID="$(id -un)" - GRP_ID="$(id -gn)" - E2E_MEM_LIMIT="30064771072" - AGENT_MEM_LIMIT="2147483648" - USER_SLICE="user.slice/user-$(id -u).slice" - USER_SERVICE="${USER_SLICE}/user@$(id -u).service" - E2E_GROUP_NAME="${USER_SERVICE}/e2e-${{ github.run_id }}" - AGENT_GROUP_NAME="${USER_SERVICE}/agent-${{ github.run_id }}" - echo "::endgroup::" - - echo "::group::Install Control Group Tools" - if ! command -v cgcreate >/dev/null 2>&1; then - sudo apt-get update - sudo apt-get install -y cgroup-tools - fi - echo "::endgroup::" - - echo "::group::Create Control Groups" - sudo cgcreate -g cpu,memory:${USER_SLICE} -a ${USR_ID}:${GRP_ID} -t ${USR_ID}:${GRP_ID} - sudo cgcreate -g cpu,memory:${USER_SERVICE} -a ${USR_ID}:${GRP_ID} -t ${USR_ID}:${GRP_ID} - sudo cgcreate -g cpu,memory:${E2E_GROUP_NAME} -a ${USR_ID}:${GRP_ID} -t ${USR_ID}:${GRP_ID} - sudo cgcreate -g cpu,memory:${AGENT_GROUP_NAME} -a ${USR_ID}:${GRP_ID} -t ${USR_ID}:${GRP_ID} - echo "::endgroup::" - - echo "::group::Set Control Group Limits" - cgset -r cpu.weight=768 ${E2E_GROUP_NAME} - cgset -r cpu.weight=500 ${AGENT_GROUP_NAME} - cgset -r memory.max=${E2E_MEM_LIMIT} ${E2E_GROUP_NAME} - cgset -r memory.max=${AGENT_MEM_LIMIT} ${AGENT_GROUP_NAME} - cgset -r memory.swap.max=${E2E_MEM_LIMIT} ${E2E_GROUP_NAME} - cgset -r memory.swap.max=${AGENT_MEM_LIMIT} ${AGENT_GROUP_NAME} - echo "::endgroup::" - - echo "::group::Move Runner Processes to Control Groups" - sudo cgclassify --sticky -g cpu,memory:${AGENT_GROUP_NAME} $(pgrep 'Runner.Listener' | tr '\n' ' ') - sudo cgclassify -g cpu,memory:${AGENT_GROUP_NAME} $(pgrep 'Runner.Worker' | tr '\n' ' ') - echo "::endgroup::" - - name: Harden Runner uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1 with: diff --git a/.github/workflows/common_js.yml b/.github/workflows/common_js.yml index 62e609a50..47b5a0baf 100644 --- a/.github/workflows/common_js.yml +++ b/.github/workflows/common_js.yml @@ -21,7 +21,7 @@ permissions: jobs: test-integration-node: name: Integration Tests on Node ${{ matrix.node }} - runs-on: [self-hosted, Linux, large, ephemeral] + runs-on: client-sdk-linux-large strategy: matrix: node: [ "16", "18" ] diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index d3883955c..eb8e059ea 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -16,7 +16,7 @@ permissions: jobs: build-and-deploy-docs: name: Documentation - runs-on: [self-hosted, Linux, medium, ephemeral] + runs-on: client-sdk-linux-medium steps: - name: Harden Runner uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1 diff --git a/.github/workflows/publish_release.yaml b/.github/workflows/publish_release.yaml index f8b26a253..c5089ceea 100644 --- a/.github/workflows/publish_release.yaml +++ b/.github/workflows/publish_release.yaml @@ -25,7 +25,7 @@ permissions: jobs: validate-release: name: Validate Release - runs-on: [self-hosted, Linux, medium, ephemeral] + runs-on: client-sdk-linux-medium outputs: # Project tag @@ -228,7 +228,7 @@ jobs: run-safety-checks: name: Safety Checks - runs-on: [self-hosted, Linux, medium, ephemeral] + runs-on: client-sdk-linux-medium steps: - name: Harden Runner uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1 @@ -262,7 +262,7 @@ jobs: publish-release: name: Publish Release - runs-on: [self-hosted, Linux, large, ephemeral] + runs-on: client-sdk-linux-large needs: - validate-release - run-safety-checks diff --git a/.github/workflows/renovate.yml b/.github/workflows/renovate.yml index 247994cfc..d167713ce 100644 --- a/.github/workflows/renovate.yml +++ b/.github/workflows/renovate.yml @@ -15,7 +15,7 @@ permissions: jobs: renovate: - runs-on: [ self-hosted, Linux, medium, ephemeral ] + runs-on: client-sdk-linux-medium steps: - name: Harden Runner uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1