From f56e1efae8d1549b22db98a57998a315d4b8d07a Mon Sep 17 00:00:00 2001 From: "Daniel A. Wozniak" Date: Thu, 6 Feb 2025 17:35:27 -0700 Subject: [PATCH 01/16] Use the ip6netnetwork we created --- .github/workflows/test-action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test-action.yml b/.github/workflows/test-action.yml index 6ac1fdccba2..992626672a4 100644 --- a/.github/workflows/test-action.yml +++ b/.github/workflows/test-action.yml @@ -476,6 +476,7 @@ jobs: --workdir /__w/salt/salt \ --privileged \ --ulimit="nofile=262144:262144" \ + --network ip6net \ -e "HOME=/github/home" \ -e GITHUB_ACTIONS=true \ -e CI=true \ From e149f7d0a9f8f481ced8950feacbd9724a2e8d91 Mon Sep 17 00:00:00 2001 From: "Daniel A. Wozniak" Date: Fri, 7 Feb 2025 14:44:22 -0700 Subject: [PATCH 02/16] Cleanly exit rtcforward --- .github/actions/ssh-tunnel/rtcforward.py | 83 +++++++++++++++--------- 1 file changed, 54 insertions(+), 29 deletions(-) diff --git a/.github/actions/ssh-tunnel/rtcforward.py b/.github/actions/ssh-tunnel/rtcforward.py index a0972d300db..460bd5c8488 100644 --- a/.github/actions/ssh-tunnel/rtcforward.py +++ b/.github/actions/ssh-tunnel/rtcforward.py @@ -6,6 +6,7 @@ import json import logging import os +import signal import sys import textwrap import time @@ -77,6 +78,42 @@ def print_pastable(data, message="offer"): sys.stdout.flush() +async def read_from_stdin(): + loop = asyncio.get_event_loop() + line = await loop.run_in_executor( + None, input, "-- Please enter a message from remote party --\n" + ) + data = line + while line: + try: + line = await loop.run_in_executor(None, input) + except EOFError: + break + data += line + print("-- Message received --") + return data + + +class Channels: + def __init__(self, channels=None): + if channels is None: + channels = [] + self.channels = channels + + def add(self, channel): + self.channels.append(channel) + + def close(self): + for channel in self.channels: + channel.close() + + +class ProxyConnection: + def __init__(self, pc, channel): + self.pc = pc + self.channel = channel + + class ProxyClient: def __init__(self, args, channel): @@ -219,29 +256,7 @@ def on_message(message): log.exception("WTF") -class ProxyConnection: - def __init__(self, pc, channel): - self.pc = pc - self.channel = channel - - -async def read_from_stdin(): - loop = asyncio.get_event_loop() - line = await loop.run_in_executor( - None, input, "-- Please enter a message from remote party --\n" - ) - data = line - while line: - try: - line = await loop.run_in_executor(None, input) - except EOFError: - break - data += line - print("-- Message received --") - return data - - -async def run_answer(pc, args): +async def run_answer(stop, pc, args): """ Top level offer answer server. """ @@ -270,11 +285,11 @@ def on_datachannel(channel): elif obj is BYE: print("Exiting") - while True: + while not stop.is_set(): await asyncio.sleep(0.3) -async def run_offer(pc, args): +async def run_offer(stop, pc, args): """ Top level offer server this will estabilsh a data channel and start a tcp server on the port provided. New connections to the server will start the @@ -324,10 +339,14 @@ def on_open(): elif obj is BYE: print("Exiting") - while True: + while not stop.is_set(): await asyncio.sleep(0.3) +async def signal_handler(stop, pc): + stop.set() + + if __name__ == "__main__": if sys.platform == "win32": asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy()) @@ -343,16 +362,22 @@ def on_open(): logging.basicConfig(level=logging.DEBUG) else: logging.basicConfig(level=logging.INFO) - + stop = asyncio.Event() pc = RTCPeerConnection() if args.role == "offer": - coro = run_offer(pc, args) + coro = run_offer(stop, pc, args) else: - coro = run_answer(pc, args) + coro = run_answer(stop, pc, args) # run event loop loop = asyncio.new_event_loop() asyncio.set_event_loop(loop) + for signame in ("SIGINT", "SIGTERM"): + loop.add_signal_handler( + getattr(signal, signame), + lambda: asyncio.create_task(signal_handler(stop, pc)), + ) + try: loop.run_until_complete(coro) except KeyboardInterrupt: From d4312d93a4f266deac2afed3998b4ce3aae9af3f Mon Sep 17 00:00:00 2001 From: "Daniel A. Wozniak" Date: Fri, 7 Feb 2025 15:23:13 -0700 Subject: [PATCH 03/16] Add container tool --- .github/workflows/ssh-debug.yml | 14 +++++ tools/__init__.py | 1 + tools/container.py | 106 ++++++++++++++++++++++++++++++++ 3 files changed, 121 insertions(+) create mode 100644 tools/container.py diff --git a/.github/workflows/ssh-debug.yml b/.github/workflows/ssh-debug.yml index 212e31c3e57..2decf646fe6 100644 --- a/.github/workflows/ssh-debug.yml +++ b/.github/workflows/ssh-debug.yml @@ -30,6 +30,20 @@ jobs: environment: ci steps: + - name: Set up Python 3.10 + uses: actions/setup-python@v5 + with: + python-version: 3.10 + + - name: Setup Python Tools Scripts + uses: ./.github/actions/setup-python-tools-scripts + + - name: Install Nox + run: | + python3 -m pip install 'nox==2022.8.7' + env: + PIP_INDEX_URL: https://pypi.org/simple + - name: Checkout Source Code uses: actions/checkout@v4 diff --git a/tools/__init__.py b/tools/__init__.py index af50a06ef47..9fc43adbf12 100644 --- a/tools/__init__.py +++ b/tools/__init__.py @@ -31,6 +31,7 @@ ptscripts.set_default_config(DEFAULT_REQS_CONFIG) ptscripts.register_tools_module("tools.changelog") ptscripts.register_tools_module("tools.ci") +ptscripts.register_tools_module("tools.container") ptscripts.register_tools_module("tools.docs") ptscripts.register_tools_module("tools.gh") ptscripts.register_tools_module("tools.pkg") diff --git a/tools/container.py b/tools/container.py new file mode 100644 index 00000000000..8fbef761d62 --- /dev/null +++ b/tools/container.py @@ -0,0 +1,106 @@ +import os + +from ptscripts import Context, command_group + +cmd = command_group(name="container", help="Container Commands", description=__doc__) + + +def has_network(ctx, name): + p = ctx.run("docker", "network", "ls", capture=True) + return name in p.stdout.decode() + + +def create_network(ctx, name): + p = ctx.run( + "docker", + "network", + "create", + "-o", + "com.docker.network.driver.mtu=1500", + "--ipv6", + "--subnet", + "2001:db8::/64", + name, + ) + if p.returncode != 0: + raise RuntimeError(f"docker network create returned {p.returncode}") + + +@cmd.command( + name="create", + arguments={ + "image": {"help": "Name the container image to use."}, + "name": {"help": "Name the container being created.", "default": ""}, + }, +) +def create(ctx: Context, image: str, name: str = ""): + onci = "GITHUB_WORKFLOW" in os.environ + workdir = "/salt" + home = "/root" + network = "ip6net" + if not has_network(ctx, network): + ctx.info(f"Creating docker network: {network}") + create_network(ctx, network) + if onci: + workdir = "/__w/salt/salt" + home = "/github/home" + env = { + "HOME": home, + "SKIP_REQUIREMENTS_INSTALL": "1", + "PRINT_TEST_SELECTION": "0", + "PRINT_TEST_PLAN_ONLY": "0", + "PRINT_SYSTEM_INFO": "0", + "RERUN_FEAILURES": "0", + "SKIP_INITIAL_ONEDIR_FAILURES": "1", + "SKIP_INITIAL_GH_ACTIONS_FAILURES": "1", + "RAISE_DEPRECATIONS_RUNTIME_ERRORS": "1", + "LANG": "en_US.UTF-8", + "SHELL": "/bin/bash", + } + for var in [ + "PIP_INDEX_URL", + "PIP_EXTRA_INDEX_URL", + "PIP_TRUSTED_HOST", + "PIP_DISABLE_PIP_VERSION_CHECK", + "SALT_TRANSPORT", + # Are both of these really needed? + "GITHUB_ACTIONS", + "GITHUB_ACTIONS_PIPELINE", + "CI", + "SKIP_CODE_COVERAGE", + "COVERAGE_CONTEXT", + "RERUN_FEAILURES", + ]: + if var in os.environ: + env[var] = os.environ[var] + cmd = [ + "/usr/bin/docker", + "create", + "--privileged", + # "--ulimit", + # "\"nofile=262144:262144\"", + f"--workdir={workdir}", + "-v", + "/tmp/:/var/lib/docker", + ] + for key in env: + cmd.extend(["-e", f"{key}={env[key]}"]) + if onci: + cmd.extend(["-v", "/home/runner/work:/__w"]) + else: + cmd.extend(["-v", f"{os.getcwd()}:/salt"]) + if name: + cmd.extend(["--name", name]) + cmd.extend( + [ + "--entrypoint", + "/usr/lib/systemd/systemd", + image, + "--systemd", + "--unit", + "rescue.target", + ], + ) + ret = ctx.run(*cmd, capture=True, check=False) + if ret.returncode != 0: + ctx.warn(ret.stderr.decode()) From 1966cdf23066089b3d47394e082ee0e33ca17659 Mon Sep 17 00:00:00 2001 From: "Daniel A. Wozniak" Date: Fri, 7 Feb 2025 16:11:14 -0700 Subject: [PATCH 04/16] Add cache prefix --- .github/workflows/ssh-debug.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ssh-debug.yml b/.github/workflows/ssh-debug.yml index 2decf646fe6..992f6b6a7b2 100644 --- a/.github/workflows/ssh-debug.yml +++ b/.github/workflows/ssh-debug.yml @@ -30,13 +30,18 @@ jobs: environment: ci steps: + - name: Checkout Source Code + uses: actions/checkout@v4 + - name: Set up Python 3.10 uses: actions/setup-python@v5 with: - python-version: 3.10 + python-version: "3.10" - name: Setup Python Tools Scripts uses: ./.github/actions/setup-python-tools-scripts + with: + cache-prefix: ssh-debug - name: Install Nox run: | @@ -44,9 +49,6 @@ jobs: env: PIP_INDEX_URL: https://pypi.org/simple - - name: Checkout Source Code - uses: actions/checkout@v4 - - uses: ./.github/actions/ssh-tunnel with: public_key: ${{ inputs.public_key }} From 72f19bef29d27a56ad19eacf953158cbdc867189 Mon Sep 17 00:00:00 2001 From: "Daniel A. Wozniak" Date: Sat, 8 Feb 2025 16:03:26 -0700 Subject: [PATCH 05/16] use tools to create container --- .github/workflows/test-action.yml | 53 +++++++++------------- .github/workflows/test-packages-action.yml | 24 +++++++++- 2 files changed, 43 insertions(+), 34 deletions(-) diff --git a/.github/workflows/test-action.yml b/.github/workflows/test-action.yml index 992626672a4..f8c875ec7fe 100644 --- a/.github/workflows/test-action.yml +++ b/.github/workflows/test-action.yml @@ -154,39 +154,28 @@ jobs: free -h - name: "Create container ${{ matrix.container }}" + env: + GITHUB_ACTIONS: true + CI: true + SKIP_REQUIREMENTS_INSTALL: 1 + PRINT_TEST_SELECTION: 0 + PRINT_TEST_PLAN_ONLY: 0 + PRINT_SYSTEM_INFO: 0 + RERUN_FAILURES: 1 + GITHUB_ACTIONS_PIPELINE: 1 + SKIP_INITIAL_ONEDIR_FAILURES: 1 + SKIP_INITIAL_GH_ACTIONS_FAILURES: 1 + SKIP_CODE_COVERAGE: ${{ inputs.skip-code-coverage && '1' || '0' }} + CONVERAGE_CONTEXT: ${{ matrix.slug }} + COLUMNS: 190 + PIP_INDEX_URL: ${{ vars.PIP_INDEX_URL }} + PIP_TRUSTED_HOST: ${{ vars.PIP_TRUSTED_HOST }} + PIP_EXTRA_INDEX_URL: ${{ vars.PIP_EXTRA_INDEX_URL }} + PIP_DISABLE_PIP_VERSION_CHECK: "1" + RAISE_DEPRECATIONS_RUNTIME_ERRORS: "1" + SALT_TRANSPORT: ${{ matrix.transport }} run: | - /usr/bin/docker \ - create --name ${{ github.run_id }}_salt-test \ - --workdir /__w/salt/salt \ - --privileged \ - --ulimit="nofile=262144:262144" \ - -e "HOME=/github/home" \ - -e GITHUB_ACTIONS=true \ - -e CI=true \ - -e SKIP_REQUIREMENTS_INSTALL=1 \ - -e PRINT_TEST_SELECTION=0 \ - -e PRINT_TEST_PLAN_ONLY=0 \ - -e PRINT_SYSTEM_INFO=0 \ - -e RERUN_FAILURES=1 \ - -e GITHUB_ACTIONS_PIPELINE=1 \ - -e SKIP_INITIAL_ONEDIR_FAILURES=1 \ - -e SKIP_INITIAL_GH_ACTIONS_FAILURES=1 \ - -e SKIP_CODE_COVERAGE=${{ inputs.skip-code-coverage && '1' || '0' }} \ - -e CONVERAGE_CONTEXT=${{ matrix.slug }} \ - -e COLUMNS=190 \ - -e PIP_INDEX_URL=${{ vars.PIP_INDEX_URL }} \ - -e PIP_TRUSTED_HOST=${{ vars.PIP_TRUSTED_HOST }} \ - -e PIP_EXTRA_INDEX_URL=${{ vars.PIP_EXTRA_INDEX_URL }} \ - -e PIP_DISABLE_PIP_VERSION_CHECK="1" \ - -e RAISE_DEPRECATIONS_RUNTIME_ERRORS="1" \ - -e SALT_TRANSPORT=${{ matrix.transport }} \ - -e LANG="en_US.UTF-8" \ - -e SHELL=/bin/bash \ - -v "/home/runner/work":"/__w" \ - -v "/tmp/":"/var/lib/docker" \ - --entrypoint "/usr/lib/systemd/systemd" \ - ${{ matrix.container }} \ - --systemd --unit rescue.target + tools create ${{ matrix.container }} --name ${{ github.run_id }}_salt-test - name: "Start container ${{ matrix.container }}" run: | diff --git a/.github/workflows/test-packages-action.yml b/.github/workflows/test-packages-action.yml index 870ebbda321..bcd7c4a6d14 100644 --- a/.github/workflows/test-packages-action.yml +++ b/.github/workflows/test-packages-action.yml @@ -134,8 +134,28 @@ jobs: docker pull ${{ matrix.container }} - name: "Create container ${{ matrix.container }}" - run: | - /usr/bin/docker create --name ${{ github.run_id }}_salt-test-pkg --workdir /__w/salt/salt --privileged -e "HOME=/github/home" -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work":"/__w" -v "/home/runner/work/_temp":"/__w/_temp" -v "/home/runner/work/_actions":"/__w/_actions" -v "/opt/hostedtoolcache":"/__t" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" --entrypoint "/usr/lib/systemd/systemd" ${{ matrix.container }} --systemd --unit rescue.target + env: + GITHUB_ACTIONS: true + CI: true + SKIP_REQUIREMENTS_INSTALL: 1 + PRINT_TEST_SELECTION: 0 + PRINT_TEST_PLAN_ONLY: 0 + PRINT_SYSTEM_INFO: 0 + RERUN_FAILURES: 1 + GITHUB_ACTIONS_PIPELINE: 1 + SKIP_INITIAL_ONEDIR_FAILURES: 1 + SKIP_INITIAL_GH_ACTIONS_FAILURES: 1 + SKIP_CODE_COVERAGE: ${{ inputs.skip-code-coverage && '1' || '0' }} + CONVERAGE_CONTEXT: ${{ matrix.slug }} + COLUMNS: 190 + PIP_INDEX_URL: ${{ vars.PIP_INDEX_URL }} + PIP_TRUSTED_HOST: ${{ vars.PIP_TRUSTED_HOST }} + PIP_EXTRA_INDEX_URL: ${{ vars.PIP_EXTRA_INDEX_URL }} + PIP_DISABLE_PIP_VERSION_CHECK: "1" + RAISE_DEPRECATIONS_RUNTIME_ERRORS: "1" + SALT_TRANSPORT: ${{ matrix.transport }} + run: | + tools create ${{ matrix.container }} --name ${{ github.run_id }}_salt-test - name: "Start container ${{ matrix.container }}" run: | From aa9b2b11a338d0264fd23af6b33ced447d5497fd Mon Sep 17 00:00:00 2001 From: "Daniel A. Wozniak" Date: Sat, 8 Feb 2025 21:20:09 -0700 Subject: [PATCH 06/16] Setup python tools before creating container --- .github/workflows/test-action.yml | 51 ++++++++++++++-------- .github/workflows/test-packages-action.yml | 22 +++++----- 2 files changed, 45 insertions(+), 28 deletions(-) diff --git a/.github/workflows/test-action.yml b/.github/workflows/test-action.yml index f8c875ec7fe..682e7a96972 100644 --- a/.github/workflows/test-action.yml +++ b/.github/workflows/test-action.yml @@ -80,10 +80,6 @@ jobs: matrix: include: ${{ fromJSON(inputs.matrix)['linux-x86_64'] }} steps: - - name: Set up Python ${{ inputs.python-version }} - uses: actions/setup-python@v5 - with: - python-version: "${{ inputs.python-version }}" - name: "Throttle Builds" shell: bash @@ -98,6 +94,16 @@ jobs: - name: Checkout Source Code uses: actions/checkout@v4 + - name: Setup Python ${{ inputs.python-version }} + uses: actions/setup-python@v5 + with: + python-version: "${{ inputs.python-version }}" + + - name: Setup Python Tools Scripts + uses: ./.github/actions/setup-python-tools-scripts + with: + cache-prefix: ${{ inputs.cache-prefix }} + - name: Free Disk Space Before Build run: | echo "Disk space before cleanup:" @@ -175,7 +181,7 @@ jobs: RAISE_DEPRECATIONS_RUNTIME_ERRORS: "1" SALT_TRANSPORT: ${{ matrix.transport }} run: | - tools create ${{ matrix.container }} --name ${{ github.run_id }}_salt-test + tools container create ${{ matrix.container }} --name ${{ github.run_id }}_salt-test - name: "Start container ${{ matrix.container }}" run: | @@ -385,10 +391,6 @@ jobs: matrix: include: ${{ fromJSON(inputs.matrix)['linux-arm64'] }} steps: - - name: Set up Python ${{ inputs.python-version }} - uses: actions/setup-python@v5 - with: - python-version: "${{ inputs.python-version }}" - name: "Throttle Builds" shell: bash @@ -400,9 +402,25 @@ jobs: run: | echo "TIMESTAMP=$(date +%s)" | tee -a "$GITHUB_ENV" + - name: Checkout Source Code uses: actions/checkout@v4 + - name: Setup Python ${{ inputs.python-version }} + uses: actions/setup-python@v5 + with: + python-version: "${{ inputs.python-version }}" + + - name: Setup Python Tools Scripts + uses: ./.github/actions/setup-python-tools-scripts + with: + cache-prefix: ${{ inputs.cache-prefix }} + + - name: "Set `TIMESTAMP` environment variable" + shell: bash + run: | + echo "TIMESTAMP=$(date +%s)" | tee -a "$GITHUB_ENV" + - name: Free Disk Space Before Build run: | echo "Disk space before cleanup:" @@ -716,6 +734,11 @@ jobs: - name: Checkout Source Code uses: actions/checkout@v4 + - name: Setup Python ${{ inputs.python-version }} + uses: actions/setup-python@v5 + with: + python-version: "${{ inputs.python-version }}" + - name: Setup Salt Version run: | echo "${{ inputs.salt-version }}" > salt/_version.txt @@ -741,12 +764,6 @@ jobs: uses: actions/download-artifact@v4 with: name: nox-macos-${{ matrix.arch }}-${{ inputs.nox-session }} - - - name: Set up Python ${{ inputs.python-version }} - uses: actions/setup-python@v5 - with: - python-version: "${{ inputs.python-version }}" - - name: Install Nox run: | python3 -m pip install 'nox==${{ inputs.nox-version }}' @@ -1021,7 +1038,7 @@ jobs: run: | echo true - - name: Set up Python ${{ inputs.python-version }} + - name: Setup Python ${{ inputs.python-version }} uses: actions/setup-python@v5 with: python-version: "${{ inputs.python-version }}" @@ -1339,7 +1356,7 @@ jobs: run: | tree -a artifacts - - name: Set up Python ${{ inputs.python-version }} + - name: Setup Python ${{ inputs.python-version }} uses: actions/setup-python@v5 with: python-version: "${{ inputs.python-version }}" diff --git a/.github/workflows/test-packages-action.yml b/.github/workflows/test-packages-action.yml index bcd7c4a6d14..95801864c3b 100644 --- a/.github/workflows/test-packages-action.yml +++ b/.github/workflows/test-packages-action.yml @@ -86,6 +86,16 @@ jobs: - name: Checkout Source Code uses: actions/checkout@v4 + - name: Set up Python ${{ inputs.python-version }} + uses: actions/setup-python@v5 + with: + python-version: "${{ inputs.python-version }}" + + - name: Setup Python Tools Scripts + uses: ./.github/actions/setup-python-tools-scripts + with: + cache-prefix: ${{ inputs.cache-prefix }} + - name: Download Packages uses: actions/download-artifact@v4 with: @@ -105,11 +115,6 @@ jobs: cd artifacts tar xvf ${{ inputs.package-name }}-${{ inputs.salt-version }}-onedir-${{ matrix.platform }}-${{ matrix.arch }}.tar.xz - - name: Set up Python ${{ inputs.python-version }} - uses: actions/setup-python@v5 - with: - python-version: "${{ inputs.python-version }}" - - name: Install Nox run: | python3 -m pip install 'nox==${{ inputs.nox-version }}' @@ -155,7 +160,7 @@ jobs: RAISE_DEPRECATIONS_RUNTIME_ERRORS: "1" SALT_TRANSPORT: ${{ matrix.transport }} run: | - tools create ${{ matrix.container }} --name ${{ github.run_id }}_salt-test + tools container create ${{ matrix.container }} --name ${{ github.run_id }}_salt-test - name: "Start container ${{ matrix.container }}" run: | @@ -165,11 +170,6 @@ jobs: run: | docker exec ${{ github.run_id}}_salt-test-pkg python3 -m nox --force-color -e decompress-dependencies -- linux ${{ matrix.arch }} - - name: Setup Python Tools Scripts - uses: ./.github/actions/setup-python-tools-scripts - with: - cache-prefix: ${{ inputs.cache-prefix }} - - name: List Free Space run: | df -h || true From 8cb29ab5faf4ae3e0a7fbab7cc07967a616d2650 Mon Sep 17 00:00:00 2001 From: "Daniel A. Wozniak" Date: Sun, 9 Feb 2025 02:19:00 -0700 Subject: [PATCH 07/16] use name --- tools/container.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/container.py b/tools/container.py index 8fbef761d62..626c1762de7 100644 --- a/tools/container.py +++ b/tools/container.py @@ -76,6 +76,7 @@ def create(ctx: Context, image: str, name: str = ""): cmd = [ "/usr/bin/docker", "create", + f"--name={name}", "--privileged", # "--ulimit", # "\"nofile=262144:262144\"", @@ -101,6 +102,7 @@ def create(ctx: Context, image: str, name: str = ""): "rescue.target", ], ) + ctx.info(f"command is: {cmd}") ret = ctx.run(*cmd, capture=True, check=False) if ret.returncode != 0: ctx.warn(ret.stderr.decode()) From 8f0a5325053519800b549bf3e983c337d558c54e Mon Sep 17 00:00:00 2001 From: "Daniel A. Wozniak" Date: Sun, 9 Feb 2025 15:41:53 -0700 Subject: [PATCH 08/16] Fix container name for package tests --- .github/workflows/test-action.yml | 34 +--------------------- .github/workflows/test-packages-action.yml | 2 +- tools/container.py | 3 +- 3 files changed, 4 insertions(+), 35 deletions(-) diff --git a/.github/workflows/test-action.yml b/.github/workflows/test-action.yml index 682e7a96972..6e23db2a60c 100644 --- a/.github/workflows/test-action.yml +++ b/.github/workflows/test-action.yml @@ -478,39 +478,7 @@ jobs: - name: "Create container ${{ matrix.container }}" run: | - /usr/bin/docker \ - create --name ${{ github.run_id }}_salt-test \ - --workdir /__w/salt/salt \ - --privileged \ - --ulimit="nofile=262144:262144" \ - --network ip6net \ - -e "HOME=/github/home" \ - -e GITHUB_ACTIONS=true \ - -e CI=true \ - -e SKIP_REQUIREMENTS_INSTALL=1 \ - -e PRINT_TEST_SELECTION=0 \ - -e PRINT_TEST_PLAN_ONLY=0 \ - -e PRINT_SYSTEM_INFO=0 \ - -e RERUN_FAILURES=1 \ - -e GITHUB_ACTIONS_PIPELINE=1 \ - -e SKIP_INITIAL_ONEDIR_FAILURES=1 \ - -e SKIP_INITIAL_GH_ACTIONS_FAILURES=1 \ - -e SKIP_CODE_COVERAGE=${{ inputs.skip-code-coverage && '1' || '0' }} \ - -e CONVERAGE_CONTEXT=${{ matrix.slug }} \ - -e COLUMNS=190 \ - -e PIP_INDEX_URL=${{ vars.PIP_INDEX_URL }} \ - -e PIP_TRUSTED_HOST=${{ vars.PIP_TRUSTED_HOST }} \ - -e PIP_EXTRA_INDEX_URL=${{ vars.PIP_EXTRA_INDEX_URL }} \ - -e PIP_DISABLE_PIP_VERSION_CHECK="1" \ - -e RAISE_DEPRECATIONS_RUNTIME_ERRORS="1" \ - -e SALT_TRANSPORT=${{ matrix.transport }} \ - -e LANG="en_US.UTF-8" \ - -e SHELL=/bin/bash \ - -v "/home/runner/work":"/__w" \ - -v "/tmp/":"/var/lib/docker" \ - --entrypoint "/usr/lib/systemd/systemd" \ - ${{ matrix.container }} \ - --systemd --unit rescue.target + tools container create ${{ matrix.container }} --name ${{ github.run_id }}_salt-test - name: "Start container ${{ matrix.container }}" run: | diff --git a/.github/workflows/test-packages-action.yml b/.github/workflows/test-packages-action.yml index 95801864c3b..9e482959e8e 100644 --- a/.github/workflows/test-packages-action.yml +++ b/.github/workflows/test-packages-action.yml @@ -160,7 +160,7 @@ jobs: RAISE_DEPRECATIONS_RUNTIME_ERRORS: "1" SALT_TRANSPORT: ${{ matrix.transport }} run: | - tools container create ${{ matrix.container }} --name ${{ github.run_id }}_salt-test + tools container create ${{ matrix.container }} --name ${{ github.run_id }}_salt-test-pkg - name: "Start container ${{ matrix.container }}" run: | diff --git a/tools/container.py b/tools/container.py index 626c1762de7..99748d23996 100644 --- a/tools/container.py +++ b/tools/container.py @@ -38,7 +38,7 @@ def create(ctx: Context, image: str, name: str = ""): workdir = "/salt" home = "/root" network = "ip6net" - if not has_network(ctx, network): + if not onci and not has_network(ctx, network): ctx.info(f"Creating docker network: {network}") create_network(ctx, network) if onci: @@ -90,6 +90,7 @@ def create(ctx: Context, image: str, name: str = ""): cmd.extend(["-v", "/home/runner/work:/__w"]) else: cmd.extend(["-v", f"{os.getcwd()}:/salt"]) + cmd.extend(["--network", network]) if name: cmd.extend(["--name", name]) cmd.extend( From 1325d459017676ffdc57742b68eb2adaf280db28 Mon Sep 17 00:00:00 2001 From: "Daniel A. Wozniak" Date: Mon, 10 Feb 2025 16:57:50 -0700 Subject: [PATCH 09/16] Fix up container create --- .github/workflows/test-action.yml | 6 +++--- tools/container.py | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test-action.yml b/.github/workflows/test-action.yml index 6e23db2a60c..15d6ff70a5c 100644 --- a/.github/workflows/test-action.yml +++ b/.github/workflows/test-action.yml @@ -174,9 +174,9 @@ jobs: SKIP_CODE_COVERAGE: ${{ inputs.skip-code-coverage && '1' || '0' }} CONVERAGE_CONTEXT: ${{ matrix.slug }} COLUMNS: 190 - PIP_INDEX_URL: ${{ vars.PIP_INDEX_URL }} - PIP_TRUSTED_HOST: ${{ vars.PIP_TRUSTED_HOST }} - PIP_EXTRA_INDEX_URL: ${{ vars.PIP_EXTRA_INDEX_URL }} + PIP_INDEX_URL: "${{ vars.PIP_INDEX_URL }}" + PIP_TRUSTED_HOST: "${{ vars.PIP_TRUSTED_HOST }}" + PIP_EXTRA_INDEX_URL: "${{ vars.PIP_EXTRA_INDEX_URL }}" PIP_DISABLE_PIP_VERSION_CHECK: "1" RAISE_DEPRECATIONS_RUNTIME_ERRORS: "1" SALT_TRANSPORT: ${{ matrix.transport }} diff --git a/tools/container.py b/tools/container.py index 99748d23996..537d49f2cd5 100644 --- a/tools/container.py +++ b/tools/container.py @@ -50,7 +50,7 @@ def create(ctx: Context, image: str, name: str = ""): "PRINT_TEST_SELECTION": "0", "PRINT_TEST_PLAN_ONLY": "0", "PRINT_SYSTEM_INFO": "0", - "RERUN_FEAILURES": "0", + "RERUN_FAILURES": "0", "SKIP_INITIAL_ONEDIR_FAILURES": "1", "SKIP_INITIAL_GH_ACTIONS_FAILURES": "1", "RAISE_DEPRECATIONS_RUNTIME_ERRORS": "1", @@ -69,7 +69,8 @@ def create(ctx: Context, image: str, name: str = ""): "CI", "SKIP_CODE_COVERAGE", "COVERAGE_CONTEXT", - "RERUN_FEAILURES", + "RERUN_FAILURES", + "COLUMNS", ]: if var in os.environ: env[var] = os.environ[var] From e82909fb114a75728deb1238e95d42adeec68545 Mon Sep 17 00:00:00 2001 From: "Daniel A. Wozniak" Date: Mon, 10 Feb 2025 17:01:01 -0700 Subject: [PATCH 10/16] Fix environment for arm linux --- .github/workflows/test-action.yml | 24 ++++++++++++++++++++-- .github/workflows/test-packages-action.yml | 10 ++++----- 2 files changed, 27 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test-action.yml b/.github/workflows/test-action.yml index 15d6ff70a5c..499a43b2c89 100644 --- a/.github/workflows/test-action.yml +++ b/.github/workflows/test-action.yml @@ -177,8 +177,8 @@ jobs: PIP_INDEX_URL: "${{ vars.PIP_INDEX_URL }}" PIP_TRUSTED_HOST: "${{ vars.PIP_TRUSTED_HOST }}" PIP_EXTRA_INDEX_URL: "${{ vars.PIP_EXTRA_INDEX_URL }}" - PIP_DISABLE_PIP_VERSION_CHECK: "1" - RAISE_DEPRECATIONS_RUNTIME_ERRORS: "1" + PIP_DISABLE_PIP_VERSION_CHECK: 1 + RAISE_DEPRECATIONS_RUNTIME_ERRORS: 1 SALT_TRANSPORT: ${{ matrix.transport }} run: | tools container create ${{ matrix.container }} --name ${{ github.run_id }}_salt-test @@ -477,6 +477,26 @@ jobs: free -h - name: "Create container ${{ matrix.container }}" + env: + GITHUB_ACTIONS: true + CI: true + SKIP_REQUIREMENTS_INSTALL: 1 + PRINT_TEST_SELECTION: 0 + PRINT_TEST_PLAN_ONLY: 0 + PRINT_SYSTEM_INFO: 0 + RERUN_FAILURES: 1 + GITHUB_ACTIONS_PIPELINE: 1 + SKIP_INITIAL_ONEDIR_FAILURES: 1 + SKIP_INITIAL_GH_ACTIONS_FAILURES: 1 + SKIP_CODE_COVERAGE: ${{ inputs.skip-code-coverage && '1' || '0' }} + CONVERAGE_CONTEXT: ${{ matrix.slug }} + COLUMNS: 190 + PIP_INDEX_URL: "${{ vars.PIP_INDEX_URL }}" + PIP_TRUSTED_HOST: "${{ vars.PIP_TRUSTED_HOST }}" + PIP_EXTRA_INDEX_URL: "${{ vars.PIP_EXTRA_INDEX_URL }}" + PIP_DISABLE_PIP_VERSION_CHECK: 1 + RAISE_DEPRECATIONS_RUNTIME_ERRORS: 1 + SALT_TRANSPORT: ${{ matrix.transport }} run: | tools container create ${{ matrix.container }} --name ${{ github.run_id }}_salt-test diff --git a/.github/workflows/test-packages-action.yml b/.github/workflows/test-packages-action.yml index 9e482959e8e..9c7c1f90940 100644 --- a/.github/workflows/test-packages-action.yml +++ b/.github/workflows/test-packages-action.yml @@ -153,11 +153,11 @@ jobs: SKIP_CODE_COVERAGE: ${{ inputs.skip-code-coverage && '1' || '0' }} CONVERAGE_CONTEXT: ${{ matrix.slug }} COLUMNS: 190 - PIP_INDEX_URL: ${{ vars.PIP_INDEX_URL }} - PIP_TRUSTED_HOST: ${{ vars.PIP_TRUSTED_HOST }} - PIP_EXTRA_INDEX_URL: ${{ vars.PIP_EXTRA_INDEX_URL }} - PIP_DISABLE_PIP_VERSION_CHECK: "1" - RAISE_DEPRECATIONS_RUNTIME_ERRORS: "1" + PIP_INDEX_URL: "{{ vars.PIP_INDEX_URL }}" + PIP_TRUSTED_HOST: "${{ vars.PIP_TRUSTED_HOST }}" + PIP_EXTRA_INDEX_URL: "${{ vars.PIP_EXTRA_INDEX_URL }}" + PIP_DISABLE_PIP_VERSION_CHECK: 1 + RAISE_DEPRECATIONS_RUNTIME_ERRORS: 1 SALT_TRANSPORT: ${{ matrix.transport }} run: | tools container create ${{ matrix.container }} --name ${{ github.run_id }}_salt-test-pkg From 5a10d4e28197c439eb2177d4f2dcbbe6043d3101 Mon Sep 17 00:00:00 2001 From: "Daniel A. Wozniak" Date: Mon, 10 Feb 2025 17:58:24 -0700 Subject: [PATCH 11/16] Add ssh command --- .github/actions/ssh-tunnel/README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/actions/ssh-tunnel/README.md b/.github/actions/ssh-tunnel/README.md index f6f03e5b2d5..b88b4e233f6 100644 --- a/.github/actions/ssh-tunnel/README.md +++ b/.github/actions/ssh-tunnel/README.md @@ -92,3 +92,9 @@ OkZFOjhCOjI3OjFDOjFBOkJEOjUxOjQ2OjE4OjBBOjhFOjVBOjI1OjQzOjQzOjZGOkRBXHJcbmE9c2V0 dXA6YWN0aXZlXHJcbiIsICJ0eXBlIjogImFuc3dlciJ9 -- Message received -- ``` + +SSH to your local port. + +``` +ssh -o StrictHostKeychecking=no -o TCPKeepAlive=no -o StrictHostKeyChecking=no -vv -p 5222 runner@localhost +``` From be5b3076d3367aa87ede92dc7b68624a22ac1642 Mon Sep 17 00:00:00 2001 From: "Daniel A. Wozniak" Date: Tue, 11 Feb 2025 14:31:27 -0700 Subject: [PATCH 12/16] test reverted change --- .github/workflows/test-packages-action.yml | 46 +++++++++++----------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/.github/workflows/test-packages-action.yml b/.github/workflows/test-packages-action.yml index 9c7c1f90940..e73bb5798de 100644 --- a/.github/workflows/test-packages-action.yml +++ b/.github/workflows/test-packages-action.yml @@ -139,28 +139,30 @@ jobs: docker pull ${{ matrix.container }} - name: "Create container ${{ matrix.container }}" - env: - GITHUB_ACTIONS: true - CI: true - SKIP_REQUIREMENTS_INSTALL: 1 - PRINT_TEST_SELECTION: 0 - PRINT_TEST_PLAN_ONLY: 0 - PRINT_SYSTEM_INFO: 0 - RERUN_FAILURES: 1 - GITHUB_ACTIONS_PIPELINE: 1 - SKIP_INITIAL_ONEDIR_FAILURES: 1 - SKIP_INITIAL_GH_ACTIONS_FAILURES: 1 - SKIP_CODE_COVERAGE: ${{ inputs.skip-code-coverage && '1' || '0' }} - CONVERAGE_CONTEXT: ${{ matrix.slug }} - COLUMNS: 190 - PIP_INDEX_URL: "{{ vars.PIP_INDEX_URL }}" - PIP_TRUSTED_HOST: "${{ vars.PIP_TRUSTED_HOST }}" - PIP_EXTRA_INDEX_URL: "${{ vars.PIP_EXTRA_INDEX_URL }}" - PIP_DISABLE_PIP_VERSION_CHECK: 1 - RAISE_DEPRECATIONS_RUNTIME_ERRORS: 1 - SALT_TRANSPORT: ${{ matrix.transport }} - run: | - tools container create ${{ matrix.container }} --name ${{ github.run_id }}_salt-test-pkg + #env: + # GITHUB_ACTIONS: true + # CI: true + # SKIP_REQUIREMENTS_INSTALL: 1 + # PRINT_TEST_SELECTION: 0 + # PRINT_TEST_PLAN_ONLY: 0 + # PRINT_SYSTEM_INFO: 0 + # RERUN_FAILURES: 1 + # GITHUB_ACTIONS_PIPELINE: 1 + # SKIP_INITIAL_ONEDIR_FAILURES: 1 + # SKIP_INITIAL_GH_ACTIONS_FAILURES: 1 + # SKIP_CODE_COVERAGE: ${{ inputs.skip-code-coverage && '1' || '0' }} + # CONVERAGE_CONTEXT: ${{ matrix.slug }} + # COLUMNS: 190 + # PIP_INDEX_URL: "{{ vars.PIP_INDEX_URL }}" + # PIP_TRUSTED_HOST: "${{ vars.PIP_TRUSTED_HOST }}" + # PIP_EXTRA_INDEX_URL: "${{ vars.PIP_EXTRA_INDEX_URL }}" + # PIP_DISABLE_PIP_VERSION_CHECK: 1 + # RAISE_DEPRECATIONS_RUNTIME_ERRORS: 1 + # SALT_TRANSPORT: ${{ matrix.transport }} + #run: | + # tools container create ${{ matrix.container }} --name ${{ github.run_id }}_salt-test-pkg + run: | + /usr/bin/docker create --name ${{ github.run_id }}_salt-test-pkg --workdir /__w/salt/salt --privileged -e "HOME=/github/home" -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work":"/__w" -v "/home/runner/work/_temp":"/__w/_temp" -v "/home/runner/work/_actions":"/__w/_actions" -v "/opt/hostedtoolcache":"/__t" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" --entrypoint "/usr/lib/systemd/systemd" ${{ matrix.container }} --systemd --unit rescue.target- - name: "Start container ${{ matrix.container }}" run: | From 2dd29540a65034dbf7f321b7d538f481a187ed8d Mon Sep 17 00:00:00 2001 From: "Daniel A. Wozniak" Date: Tue, 11 Feb 2025 17:16:34 -0700 Subject: [PATCH 13/16] Fix environment variables when using docker exec --- .github/workflows/test-packages-action.yml | 68 +++++++++++----------- 1 file changed, 33 insertions(+), 35 deletions(-) diff --git a/.github/workflows/test-packages-action.yml b/.github/workflows/test-packages-action.yml index e73bb5798de..fc15db38551 100644 --- a/.github/workflows/test-packages-action.yml +++ b/.github/workflows/test-packages-action.yml @@ -139,30 +139,28 @@ jobs: docker pull ${{ matrix.container }} - name: "Create container ${{ matrix.container }}" - #env: - # GITHUB_ACTIONS: true - # CI: true - # SKIP_REQUIREMENTS_INSTALL: 1 - # PRINT_TEST_SELECTION: 0 - # PRINT_TEST_PLAN_ONLY: 0 - # PRINT_SYSTEM_INFO: 0 - # RERUN_FAILURES: 1 - # GITHUB_ACTIONS_PIPELINE: 1 - # SKIP_INITIAL_ONEDIR_FAILURES: 1 - # SKIP_INITIAL_GH_ACTIONS_FAILURES: 1 - # SKIP_CODE_COVERAGE: ${{ inputs.skip-code-coverage && '1' || '0' }} - # CONVERAGE_CONTEXT: ${{ matrix.slug }} - # COLUMNS: 190 - # PIP_INDEX_URL: "{{ vars.PIP_INDEX_URL }}" - # PIP_TRUSTED_HOST: "${{ vars.PIP_TRUSTED_HOST }}" - # PIP_EXTRA_INDEX_URL: "${{ vars.PIP_EXTRA_INDEX_URL }}" - # PIP_DISABLE_PIP_VERSION_CHECK: 1 - # RAISE_DEPRECATIONS_RUNTIME_ERRORS: 1 - # SALT_TRANSPORT: ${{ matrix.transport }} - #run: | - # tools container create ${{ matrix.container }} --name ${{ github.run_id }}_salt-test-pkg - run: | - /usr/bin/docker create --name ${{ github.run_id }}_salt-test-pkg --workdir /__w/salt/salt --privileged -e "HOME=/github/home" -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work":"/__w" -v "/home/runner/work/_temp":"/__w/_temp" -v "/home/runner/work/_actions":"/__w/_actions" -v "/opt/hostedtoolcache":"/__t" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" --entrypoint "/usr/lib/systemd/systemd" ${{ matrix.container }} --systemd --unit rescue.target- + env: + GITHUB_ACTIONS: true + CI: true + SKIP_REQUIREMENTS_INSTALL: 1 + PRINT_TEST_SELECTION: 0 + PRINT_TEST_PLAN_ONLY: 0 + PRINT_SYSTEM_INFO: 0 + RERUN_FAILURES: 1 + GITHUB_ACTIONS_PIPELINE: 1 + SKIP_INITIAL_ONEDIR_FAILURES: 1 + SKIP_INITIAL_GH_ACTIONS_FAILURES: 1 + SKIP_CODE_COVERAGE: ${{ inputs.skip-code-coverage && '1' || '0' }} + CONVERAGE_CONTEXT: ${{ matrix.slug }} + COLUMNS: 190 + PIP_INDEX_URL: "{{ vars.PIP_INDEX_URL }}" + PIP_TRUSTED_HOST: "${{ vars.PIP_TRUSTED_HOST }}" + PIP_EXTRA_INDEX_URL: "${{ vars.PIP_EXTRA_INDEX_URL }}" + PIP_DISABLE_PIP_VERSION_CHECK: 1 + RAISE_DEPRECATIONS_RUNTIME_ERRORS: 1 + SALT_TRANSPORT: ${{ matrix.transport }} + run: | + tools container create ${{ matrix.container }} --name ${{ github.run_id }}_salt-test-pkg - name: "Start container ${{ matrix.container }}" run: | @@ -177,21 +175,21 @@ jobs: df -h || true - name: Show System Info - env: - SKIP_REQUIREMENTS_INSTALL: "1" - PRINT_SYSTEM_INFO_ONLY: "1" run: | - docker exec ${{ github.run_id }}_salt-test-pkg python3 -m nox --force-color -e ${{ inputs.nox-session }}-pkgs -- ${{ matrix.tests-chunk }} + docker exec \ + -e SKIP_REQUIREMENTS_INSTALL=1 \ + -e PRINT_SYSTEM_INFO_ONLY=1 \ + ${{ github.run_id }}_salt-test-pkg python3 -m nox --force-color -e ${{ inputs.nox-session }}-pkgs -- ${{ matrix.tests-chunk }} - name: Run Package Tests - env: - SKIP_REQUIREMENTS_INSTALL: "1" - RERUN_FAILURES: "1" - GITHUB_ACTIONS_PIPELINE: "1" - SKIP_INITIAL_GH_ACTIONS_FAILURES: "1" - COVERAGE_CONTEXT: ${{ matrix.slug }} run: | - /usr/bin/docker exec ${{ github.run_id }}_salt-test-pkg \ + docker exec \ + -e SKIP_REQUIREMENTS_INSTALL=1 \ + -e RERUN_FAILURES=1 \ + -e GITHUB_ACTIONS_PIPELINE=1 \ + -e SKIP_INITIAL_GH_ACTIONS_FAILURES=1 \ + -e COVERAGE_CONTEXT=${{ matrix.slug }} \ + ${{ github.run_id }}_salt-test-pkg \ python3 -m nox --force-color -e ${{ inputs.nox-session }}-pkgs -- ${{ matrix.tests-chunk }} \ ${{ matrix.version && format('--prev-version={0}', matrix.version) || ''}} From d6eafd395efa666f6086e6d4bd066261f15fd2d5 Mon Sep 17 00:00:00 2001 From: "Daniel A. Wozniak" Date: Wed, 12 Feb 2025 02:35:45 -0700 Subject: [PATCH 14/16] remove pip env vars --- .github/workflows/test-packages-action.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/test-packages-action.yml b/.github/workflows/test-packages-action.yml index fc15db38551..b8bb5f8b682 100644 --- a/.github/workflows/test-packages-action.yml +++ b/.github/workflows/test-packages-action.yml @@ -153,9 +153,6 @@ jobs: SKIP_CODE_COVERAGE: ${{ inputs.skip-code-coverage && '1' || '0' }} CONVERAGE_CONTEXT: ${{ matrix.slug }} COLUMNS: 190 - PIP_INDEX_URL: "{{ vars.PIP_INDEX_URL }}" - PIP_TRUSTED_HOST: "${{ vars.PIP_TRUSTED_HOST }}" - PIP_EXTRA_INDEX_URL: "${{ vars.PIP_EXTRA_INDEX_URL }}" PIP_DISABLE_PIP_VERSION_CHECK: 1 RAISE_DEPRECATIONS_RUNTIME_ERRORS: 1 SALT_TRANSPORT: ${{ matrix.transport }} From 073fd3c5f6293d3f16e10e351257e6c45c23277b Mon Sep 17 00:00:00 2001 From: "Daniel A. Wozniak" Date: Wed, 12 Feb 2025 14:37:17 -0700 Subject: [PATCH 15/16] Try removing some environment variables --- .github/workflows/test-packages-action.yml | 24 +++++----------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/.github/workflows/test-packages-action.yml b/.github/workflows/test-packages-action.yml index b8bb5f8b682..8241a4630ed 100644 --- a/.github/workflows/test-packages-action.yml +++ b/.github/workflows/test-packages-action.yml @@ -139,25 +139,11 @@ jobs: docker pull ${{ matrix.container }} - name: "Create container ${{ matrix.container }}" - env: - GITHUB_ACTIONS: true - CI: true - SKIP_REQUIREMENTS_INSTALL: 1 - PRINT_TEST_SELECTION: 0 - PRINT_TEST_PLAN_ONLY: 0 - PRINT_SYSTEM_INFO: 0 - RERUN_FAILURES: 1 - GITHUB_ACTIONS_PIPELINE: 1 - SKIP_INITIAL_ONEDIR_FAILURES: 1 - SKIP_INITIAL_GH_ACTIONS_FAILURES: 1 - SKIP_CODE_COVERAGE: ${{ inputs.skip-code-coverage && '1' || '0' }} - CONVERAGE_CONTEXT: ${{ matrix.slug }} - COLUMNS: 190 - PIP_DISABLE_PIP_VERSION_CHECK: 1 - RAISE_DEPRECATIONS_RUNTIME_ERRORS: 1 - SALT_TRANSPORT: ${{ matrix.transport }} - run: | - tools container create ${{ matrix.container }} --name ${{ github.run_id }}_salt-test-pkg + #run: | + # tools container create ${{ matrix.container }} --name ${{ github.run_id }}_salt-test-pkg + run: | + /usr/bin/docker create --name ${{ github.run_id }}_salt-test-pkg --workdir /__w/salt/salt --privileged -e "HOME=/github/home" -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work":"/__w" -v "/home/runner/work/_temp":"/__w/_temp" -v "/home/runner/work/_actions":"/__w/_actions" -v "/opt/hostedtoolcache":"/__t" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" --entrypoint "/usr/lib/systemd/systemd" ${{ matrix.container }} --systemd --unit rescue.target + - name: "Start container ${{ matrix.container }}" run: | From 517a790805cd082e78c7c876cb6b3bdd1f135a0a Mon Sep 17 00:00:00 2001 From: "Daniel A. Wozniak" Date: Mon, 17 Feb 2025 21:14:32 -0700 Subject: [PATCH 16/16] Remove environment variables --- .github/workflows/test-packages-action.yml | 10 +--------- tools/container.py | 2 -- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/.github/workflows/test-packages-action.yml b/.github/workflows/test-packages-action.yml index 8241a4630ed..ed41b1e787a 100644 --- a/.github/workflows/test-packages-action.yml +++ b/.github/workflows/test-packages-action.yml @@ -139,11 +139,8 @@ jobs: docker pull ${{ matrix.container }} - name: "Create container ${{ matrix.container }}" - #run: | - # tools container create ${{ matrix.container }} --name ${{ github.run_id }}_salt-test-pkg run: | - /usr/bin/docker create --name ${{ github.run_id }}_salt-test-pkg --workdir /__w/salt/salt --privileged -e "HOME=/github/home" -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work":"/__w" -v "/home/runner/work/_temp":"/__w/_temp" -v "/home/runner/work/_actions":"/__w/_actions" -v "/opt/hostedtoolcache":"/__t" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" --entrypoint "/usr/lib/systemd/systemd" ${{ matrix.container }} --systemd --unit rescue.target - + tools container create ${{ matrix.container }} --name ${{ github.run_id }}_salt-test-pkg - name: "Start container ${{ matrix.container }}" run: | @@ -167,11 +164,6 @@ jobs: - name: Run Package Tests run: | docker exec \ - -e SKIP_REQUIREMENTS_INSTALL=1 \ - -e RERUN_FAILURES=1 \ - -e GITHUB_ACTIONS_PIPELINE=1 \ - -e SKIP_INITIAL_GH_ACTIONS_FAILURES=1 \ - -e COVERAGE_CONTEXT=${{ matrix.slug }} \ ${{ github.run_id }}_salt-test-pkg \ python3 -m nox --force-color -e ${{ inputs.nox-session }}-pkgs -- ${{ matrix.tests-chunk }} \ ${{ matrix.version && format('--prev-version={0}', matrix.version) || ''}} diff --git a/tools/container.py b/tools/container.py index 537d49f2cd5..43c8c11dbf4 100644 --- a/tools/container.py +++ b/tools/container.py @@ -79,8 +79,6 @@ def create(ctx: Context, image: str, name: str = ""): "create", f"--name={name}", "--privileged", - # "--ulimit", - # "\"nofile=262144:262144\"", f"--workdir={workdir}", "-v", "/tmp/:/var/lib/docker",