From 00df4de8959dffe594238202b1d6bbe49933255c Mon Sep 17 00:00:00 2001 From: "Daniel A. Wozniak" Date: Sat, 9 Nov 2024 01:52:31 -0700 Subject: [PATCH] remove some debugging --- .github/workflows/build-deps-onedir.yml | 4 +- .github/workflows/build-packages.yml | 2 +- .github/workflows/build-salt-onedir.yml | 4 +- .../workflows/test-packages-action-linux.yml | 12 ++- tools/ci.py | 96 +------------------ 5 files changed, 17 insertions(+), 101 deletions(-) diff --git a/.github/workflows/build-deps-onedir.yml b/.github/workflows/build-deps-onedir.yml index 03eba539c17..faf82eb47e0 100644 --- a/.github/workflows/build-deps-onedir.yml +++ b/.github/workflows/build-deps-onedir.yml @@ -38,7 +38,7 @@ env: jobs: generate-matrix: - name: Test Matrix + name: Test Matrix (${{ inputs.kind }}) runs-on: ubuntu-latest outputs: matrix-include: ${{ steps.generate-matrix.outputs.matrix }} @@ -58,7 +58,7 @@ jobs: - name: Setup Python Tools Scripts uses: ./.github/actions/setup-python-tools-scripts with: - cache-prefix: ${{ inputs.cache-prefix }} + cache-prefix: ${{ inputs.cache-seed }} env: PIP_INDEX_URL: https://pypi.org/simple diff --git a/.github/workflows/build-packages.yml b/.github/workflows/build-packages.yml index 5b16b4c224a..f04478b2a00 100644 --- a/.github/workflows/build-packages.yml +++ b/.github/workflows/build-packages.yml @@ -51,7 +51,7 @@ env: jobs: generate-matrix: - name: Test Matrix + name: Test Matrix ${{ inputs.kind }} runs-on: ubuntu-latest outputs: matrix-include: ${{ steps.generate-matrix.outputs.matrix }} diff --git a/.github/workflows/build-salt-onedir.yml b/.github/workflows/build-salt-onedir.yml index a4cb0afb4bc..19e427dcd28 100644 --- a/.github/workflows/build-salt-onedir.yml +++ b/.github/workflows/build-salt-onedir.yml @@ -38,7 +38,7 @@ env: jobs: generate-matrix: - name: Test Matrix + name: Test Matrix (${{ inputs.kind }}) runs-on: ubuntu-latest outputs: matrix-include: ${{ steps.generate-matrix.outputs.matrix }} @@ -58,7 +58,7 @@ jobs: - name: Setup Python Tools Scripts uses: ./.github/actions/setup-python-tools-scripts with: - cache-prefix: ${{ inputs.cache-prefix }} + cache-prefix: ${{ inputs.cache-seed }} env: PIP_INDEX_URL: https://pypi.org/simple diff --git a/.github/workflows/test-packages-action-linux.yml b/.github/workflows/test-packages-action-linux.yml index f91b48780bf..cb2cb9f0769 100644 --- a/.github/workflows/test-packages-action-linux.yml +++ b/.github/workflows/test-packages-action-linux.yml @@ -191,16 +191,18 @@ jobs: run: | tools --timestamps vm ssh ${{ inputs.distro-slug }} -- df -h || true - - name: check systemd - run: systemctl +# - name: check systemd +# run: systemctl +# #- name: Mock systemd # run: | # wget https://raw.githubusercontent.com/gdraheim/docker-systemctl-replacement/refs/heads/master/files/docker/systemctl3.py # cp systemctl3.py /usr/bin/systemctl # chmod +x /usr/bin/systemctl - - name: install pkg test - run: | - dpkg -i ./artifacts/pkg/salt-common_${{ inputs.salt-version}}_${{ inputs.arch == 'x86_64' && 'amd64' || 'arm64' }}.deb ./artifacts/pkg/salt-master_${{ inputs.salt-version}}_${{ inputs.arch == 'x86_64' && 'amd64' || 'arm64' }}.deb + # + #- name: install pkg test + # run: | + # dpkg -i ./artifacts/pkg/salt-common_${{ inputs.salt-version}}_${{ inputs.arch == 'x86_64' && 'amd64' || 'arm64' }}.deb ./artifacts/pkg/salt-master_${{ inputs.salt-version}}_${{ inputs.arch == 'x86_64' && 'amd64' || 'arm64' }}.deb - name: Show System Info env: diff --git a/tools/ci.py b/tools/ci.py index 49f322f46e6..a649277b337 100644 --- a/tools/ci.py +++ b/tools/ci.py @@ -152,96 +152,6 @@ def process_changed_files(ctx: Context, event_name: str, changed_files: pathlib. ctx.exit(0) -@ci.command( - name="runner-types", - arguments={ - "event_name": { - "help": "The name of the GitHub event being processed.", - }, - }, -) -def runner_types(ctx: Context, event_name: str): - """ - Set GH Actions 'runners' output to know what can run where. - """ - gh_event_path = os.environ.get("GITHUB_EVENT_PATH") or None - if gh_event_path is None: - ctx.warn("The 'GITHUB_EVENT_PATH' variable is not set.") - ctx.exit(1) - - if TYPE_CHECKING: - assert gh_event_path is not None - - github_output = os.environ.get("GITHUB_OUTPUT") - if github_output is None: - ctx.warn("The 'GITHUB_OUTPUT' variable is not set.") - ctx.exit(1) - - if TYPE_CHECKING: - assert github_output is not None - - try: - gh_event = json.loads(open(gh_event_path, encoding="utf-8").read()) - except Exception as exc: - ctx.error(f"Could not load the GH Event payload from {gh_event_path!r}:\n", exc) - ctx.exit(1) - - ctx.info("GH Event Payload:") - ctx.print(gh_event, soft_wrap=True) - # Let's it print until the end - time.sleep(1) - - ctx.info("Selecting which type of runners(self hosted runners or not) to run") - runners = {"github-hosted": False, "self-hosted": False, "linux-arm64": False} - if "LINUX_ARM_RUNNER" in os.environ and os.environ["LINUX_ARM_RUNNER"] != "0": - runners["linux-arm64"] = True - if event_name == "pull_request": - ctx.info("Running from a pull request event") - pr_event_data = gh_event["pull_request"] - if ( - pr_event_data["head"]["repo"]["full_name"] - == pr_event_data["base"]["repo"]["full_name"] - ): - # If this is a pull request coming from the same repository, don't run anything - ctx.info("Pull request is coming from the same repository.") - ctx.info("Not running any jobs since they will run against the branch") - ctx.info("Writing 'runners' to the github outputs file:\n", runners) - with open(github_output, "a", encoding="utf-8") as wfh: - wfh.write(f"runners={json.dumps(runners)}\n") - ctx.exit(0) - - # This is a PR from a forked repository - ctx.info("Pull request is not comming from the same repository") - runners["github-hosted"] = runners["self-hosted"] = True - ctx.info("Writing 'runners' to the github outputs file:\n", runners) - with open(github_output, "a", encoding="utf-8") as wfh: - wfh.write(f"runners={json.dumps(runners)}\n") - ctx.exit(0) - - # This is a push or a scheduled event - ctx.info(f"Running from a {event_name!r} event") - if ( - gh_event["repository"]["fork"] is True - and os.environ.get("FORK_HAS_SELF_HOSTED_RUNNERS", "0") == "1" - ): - # This is running on a forked repository, don't run tests - ctx.info("The push event is on a forked repository") - if os.environ.get("FORK_HAS_SELF_HOSTED_RUNNERS", "0") == "1": - # This is running on a forked repository, don't run tests - runners["github-hosted"] = runners["self-hosted"] = True - ctx.info("Writing 'runners' to the github outputs file:\n", runners) - with open(github_output, "a", encoding="utf-8") as wfh: - wfh.write(f"runners={json.dumps(runners)}\n") - ctx.exit(0) - # Not running on a fork, or the fork has self hosted runners, run everything - ctx.info(f"The {event_name!r} event is from the main repository") - runners["github-hosted"] = runners["self-hosted"] = True - ctx.info("Writing 'runners' to the github outputs file:\n", runners) - with open(github_output, "a", encoding="utf-8") as wfh: - wfh.write(f"runners={json.dumps(runners)}") - ctx.exit(0) - - @ci.command( name="define-jobs", arguments={ @@ -659,7 +569,9 @@ def build_matrix( kind: str, ): """ - Generate the test matrix. + Generate matrix for onedir workflows. + + The build-onedir-deps and build-salt-onedir workflows call this method. """ github_output = os.environ.get("GITHUB_OUTPUT") if github_output is None: @@ -863,6 +775,8 @@ def pkg_matrix( else: arch = "x86_64" + ctx.info(f"Parsed linux slug parts {name} {version} {arch}") + if name == "amazonlinux": name = "amazon" elif name == "rockylinux":