Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/workflows/build-deps-ci-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ jobs:

macos-dependencies:
name: MacOS
runs-on: ${{ matrix.arch == 'x86_64' && 'macos-13' || 'macos-14' }}
runs-on: ${{ matrix.arch == 'x86_64' && 'macos-15-intel' || 'macos-14' }}
if: ${{ toJSON(fromJSON(inputs.matrix)['macos']) != '[]' }}
timeout-minutes: 90
strategy:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ jobs:
env:
PIP_INDEX_URL: https://pypi.org/simple
runs-on:
- ${{ matrix.arch == 'arm64' && 'macos-14' || 'macos-13' }}
- ${{ matrix.arch == 'arm64' && 'macos-14' || 'macos-15-intel' }}

steps:
- name: Check Package Signing Enabled
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-salt-onedir.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ jobs:
matrix:
include: ${{ fromJSON(inputs.matrix)['macos'] }}
runs-on:
- ${{ matrix.arch == 'arm64' && 'macos-14' || 'macos-13' }}
- ${{ matrix.arch == 'arm64' && 'macos-14' || 'macos-15-intel' }}
env:
PIP_INDEX_URL: https://pypi.org/simple
USE_S3_CACHE: 'false'
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ jobs:
with:
cache-seed: ${{ needs.prepare-workflow.outputs.cache-seed }}
salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}"
relenv-version: "0.21.1"
relenv-version: "0.21.2"
python-version: "3.11.14"
ci-python-version: "3.11"
matrix: ${{ toJSON(fromJSON(needs.prepare-workflow.outputs.config)['build-matrix']) }}
Expand All @@ -456,7 +456,7 @@ jobs:
with:
salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}"
cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}
relenv-version: "0.21.1"
relenv-version: "0.21.2"
python-version: "3.11.14"
ci-python-version: "3.11"
source: "onedir"
Expand All @@ -473,7 +473,7 @@ jobs:
with:
salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}"
cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}
relenv-version: "0.21.1"
relenv-version: "0.21.2"
python-version: "3.11.14"
ci-python-version: "3.11"
source: "src"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ jobs:
with:
cache-seed: ${{ needs.prepare-workflow.outputs.cache-seed }}
salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}"
relenv-version: "0.21.1"
relenv-version: "0.21.2"
python-version: "3.11.14"
ci-python-version: "3.11"
matrix: ${{ toJSON(fromJSON(needs.prepare-workflow.outputs.config)['build-matrix']) }}
Expand All @@ -451,7 +451,7 @@ jobs:
with:
salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}"
cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}
relenv-version: "0.21.1"
relenv-version: "0.21.2"
python-version: "3.11.14"
ci-python-version: "3.11"
source: "onedir"
Expand All @@ -472,7 +472,7 @@ jobs:
with:
salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}"
cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}
relenv-version: "0.21.1"
relenv-version: "0.21.2"
python-version: "3.11.14"
ci-python-version: "3.11"
source: "src"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/scheduled.yml
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ jobs:
with:
cache-seed: ${{ needs.prepare-workflow.outputs.cache-seed }}
salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}"
relenv-version: "0.21.1"
relenv-version: "0.21.2"
python-version: "3.11.14"
ci-python-version: "3.11"
matrix: ${{ toJSON(fromJSON(needs.prepare-workflow.outputs.config)['build-matrix']) }}
Expand All @@ -499,7 +499,7 @@ jobs:
with:
salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}"
cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}
relenv-version: "0.21.1"
relenv-version: "0.21.2"
python-version: "3.11.14"
ci-python-version: "3.11"
source: "onedir"
Expand All @@ -516,7 +516,7 @@ jobs:
with:
salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}"
cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}
relenv-version: "0.21.1"
relenv-version: "0.21.2"
python-version: "3.11.14"
ci-python-version: "3.11"
source: "src"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ jobs:
with:
cache-seed: ${{ needs.prepare-workflow.outputs.cache-seed }}
salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}"
relenv-version: "0.21.1"
relenv-version: "0.21.2"
python-version: "3.11.14"
ci-python-version: "3.11"
matrix: ${{ toJSON(fromJSON(needs.prepare-workflow.outputs.config)['build-matrix']) }}
Expand All @@ -484,7 +484,7 @@ jobs:
with:
salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}"
cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}
relenv-version: "0.21.1"
relenv-version: "0.21.2"
python-version: "3.11.14"
ci-python-version: "3.11"
source: "onedir"
Expand All @@ -506,7 +506,7 @@ jobs:
with:
salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}"
cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}
relenv-version: "0.21.1"
relenv-version: "0.21.2"
python-version: "3.11.14"
ci-python-version: "3.11"
source: "src"
Expand Down
2 changes: 1 addition & 1 deletion cicd/shared-gh-workflows-context.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
nox_version: "2022.8.7"
python_version: "3.11.14"
relenv_version: "0.21.1"
relenv_version: "0.21.2"
release_branches:
- "3006.x"
- "3007.x"
Expand Down
6 changes: 3 additions & 3 deletions salt/channel/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import salt.utils.stringutils
import salt.utils.verify
import salt.utils.versions
from salt.utils.asynchronous import SyncWrapper
from salt.utils.asynchronous import SyncWrapper, aioloop

log = logging.getLogger(__name__)

Expand Down Expand Up @@ -422,7 +422,7 @@ def factory(cls, opts, **kwargs):

def __init__(self, opts, transport, auth, io_loop=None):
self.opts = opts
self.io_loop = io_loop
self.io_loop = aioloop(io_loop)
self.auth = auth
try:
# This loads or generates the minion's public key.
Expand Down Expand Up @@ -636,7 +636,7 @@ def __enter__(self):
return self

def __exit__(self, *args):
self.io_loop.spawn_callback(self.close)
self.io_loop.call_soon(self.close)

async def __aenter__(self):
return self
Expand Down
11 changes: 7 additions & 4 deletions salt/channel/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -1156,10 +1156,13 @@ def _publish_daemon(self, **kwargs):
payload_handler=self.handle_pool_publish,
)
self.pool_puller.start()
self.io_loop.add_callback(
self.transport.publisher,
self.publish_payload,
io_loop=self.io_loop,
# Extract asyncio loop for create_task
aio_loop = salt.utils.asynchronous.aioloop(self.io_loop)
aio_loop.create_task(
self.transport.publisher(
self.publish_payload,
io_loop=self.io_loop,
)
)
# run forever
try:
Expand Down
12 changes: 9 additions & 3 deletions salt/crypt.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import salt.channel.client
import salt.defaults.exitcodes
import salt.payload
import salt.utils.asynchronous
import salt.utils.crypt
import salt.utils.decorators
import salt.utils.event
Expand Down Expand Up @@ -766,7 +767,12 @@ def __singleton_init__(self, opts, io_loop=None):
self.mpub = "minion_master.pub"
if not os.path.isfile(self.pub_path):
self.get_keys()
self.io_loop = io_loop or tornado.ioloop.IOLoop.current()
if io_loop is None:
self.io_loop = salt.utils.asynchronous.aioloop(
tornado.ioloop.IOLoop.current()
)
else:
self.io_loop = salt.utils.asynchronous.aioloop(io_loop)
key = self.__key(self.opts)
# TODO: if we already have creds for this key, lets just re-use
if key in AsyncAuth.creds_map:
Expand Down Expand Up @@ -833,13 +839,13 @@ def authenticate(self, callback=None):
else:
future = tornado.concurrent.Future()
self._authenticate_future = future
self.io_loop.add_callback(self._authenticate)
self.io_loop.create_task(self._authenticate())

if callback is not None:

def handle_future(future):
response = future.result()
self.io_loop.add_callback(callback, response)
self.io_loop.call_soon(callback, response)

future.add_done_callback(handle_future)

Expand Down
22 changes: 14 additions & 8 deletions salt/master.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
import threading
import time

import tornado.gen

import salt.acl
import salt.auth
import salt.channel.server
Expand Down Expand Up @@ -951,7 +949,7 @@ def start(self):
if self.opts.get("cluster_id", None):
# Notify the rest of the cluster we're starting.
ipc_publisher.send_aes_key_event()
self.process_manager.run()
asyncio.run(self.process_manager.run())

def _handle_signals(self, signum, sigframe):
# escalate the signals to the process manager
Expand Down Expand Up @@ -1008,13 +1006,19 @@ async def handle_event(self, package):
log.trace("Ignore tag %s", tag)

def run(self):
io_loop = tornado.ioloop.IOLoop()
io_loop = asyncio.new_event_loop()
asyncio.set_event_loop(io_loop)
with salt.utils.event.get_master_event(
self.opts, self.opts["sock_dir"], io_loop=io_loop, listen=True
) as event_bus:
event_bus.subscribe("")
event_bus.set_event_handler(self.handle_event)
io_loop.start()
try:
io_loop.run_forever()
except (KeyboardInterrupt, SystemExit):
pass
finally:
io_loop.close()


class ReqServer(salt.utils.process.SignalHandlingProcess):
Expand Down Expand Up @@ -1175,16 +1179,18 @@ def __bind(self):
"""
Bind to the local port
"""
self.io_loop = tornado.ioloop.IOLoop()
self.io_loop = asyncio.new_event_loop()
asyncio.set_event_loop(self.io_loop)
for req_channel in self.req_channels:
req_channel.post_fork(
self._handle_payload, io_loop=self.io_loop
) # TODO: cleaner? Maybe lazily?
try:
self.io_loop.start()
self.io_loop.run_forever()
except (KeyboardInterrupt, SystemExit):
# Tornado knows what to do
pass
finally:
self.io_loop.close()

async def _handle_payload(self, payload):
"""
Expand Down
10 changes: 8 additions & 2 deletions salt/metaproxy/deltaproxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import asyncio
import concurrent.futures
import copy
import functools
import logging
import os
import signal
Expand Down Expand Up @@ -164,8 +165,13 @@ async def post_master_init(self, master):
# Start engines here instead of in the Minion superclass __init__
# This is because we need to inject the __proxy__ variable but
# it is not setup until now.
self.io_loop.spawn_callback(
salt.engines.start_engines, self.opts, self.process_manager, proxy=self.proxy
self.io_loop.call_soon(
functools.partial(
salt.engines.start_engines,
self.opts,
self.process_manager,
proxy=self.proxy,
)
)

proxy_init_func_name = f"{fq_proxyname}.init"
Expand Down
10 changes: 8 additions & 2 deletions salt/metaproxy/proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import asyncio
import copy
import functools
import logging
import os
import signal
Expand Down Expand Up @@ -160,8 +161,13 @@ async def post_master_init(self, master):
# Start engines here instead of in the Minion superclass __init__
# This is because we need to inject the __proxy__ variable but
# it is not setup until now.
self.io_loop.spawn_callback(
salt.engines.start_engines, self.opts, self.process_manager, proxy=self.proxy
self.io_loop.call_soon(
functools.partial(
salt.engines.start_engines,
self.opts,
self.process_manager,
proxy=self.proxy,
)
)

if (
Expand Down
Loading