Skip to content

Commit 6ff547e

Browse files
Update MacOS version on GH Actions (#6187)
* actions: patch DNS issues on Mac OS runners * Small fix for host info logic * GH Actions: update MacOS version * Reduce test flakiness --------- Co-authored-by: Oliver Sanders <[email protected]>
1 parent ba57e88 commit 6ff547e

File tree

17 files changed

+91
-73
lines changed

17 files changed

+91
-73
lines changed

.github/workflows/test_fast.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ jobs:
2323
python-version: ['3.7', '3.8', '3.10', '3.11', '3']
2424
include:
2525
# mac os test
26-
- os: 'macos-11'
27-
python-version: '3.7' # oldest supported version
26+
- os: 'macos-latest'
27+
python-version: '3.9' # oldest supported version
2828
# non-utc timezone test
2929
- os: 'ubuntu-latest'
3030
python-version: '3.9' # not the oldest, not the most recent version
@@ -49,6 +49,9 @@ jobs:
4949
sudo apt-get update
5050
sudo apt-get install -y sqlite3
5151
52+
- name: Patch DNS
53+
uses: cylc/release-actions/patch-dns@v1
54+
5255
- name: Install
5356
run: |
5457
pip install -e ."[all]"

.github/workflows/test_functional.yml

Lines changed: 37 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,14 @@ jobs:
7474
platform: '_remote_background_indep_tcp _remote_at_indep_tcp'
7575
# macos
7676
- name: 'macos 1/5'
77-
os: 'macos-11'
78-
python-version: '3.7'
77+
os: 'macos-latest'
78+
python-version: '3.9'
7979
test-base: 'tests/f'
8080
chunk: '1/5'
8181
platform: '_local_background*'
8282
- name: 'macos 2/5'
83-
os: 'macos-11'
84-
python-version: '3.7'
83+
os: 'macos-latest'
84+
python-version: '3.9'
8585
test-base: 'tests/f'
8686
chunk: '2/5'
8787
platform: '_local_background*'
@@ -103,6 +103,29 @@ jobs:
103103
with:
104104
python-version: ${{ matrix.python-version }}
105105

106+
- name: Create global config
107+
run: |
108+
CONF_PATH="$HOME/.cylc/flow/8"
109+
mkdir -p "$CONF_PATH"
110+
touch "$CONF_PATH/global.cylc"
111+
ln -s "$CONF_PATH/global.cylc" "$CONF_PATH/global-tests.cylc"
112+
echo "GLOBAL_CFG_PATH=${CONF_PATH}/global.cylc" >> "$GITHUB_ENV"
113+
114+
- name: Patch DNS
115+
uses: cylc/release-actions/patch-dns@v1
116+
117+
- name: Add localhost entries to global config
118+
if: startsWith(runner.os, 'macos')
119+
run: |
120+
cat >> "$GLOBAL_CFG_PATH" <<__HERE__
121+
[platforms]
122+
[[localhost, $(hostname -f), $(hostname -s)]]
123+
hosts = localhost
124+
install target = localhost
125+
ssh command = ssh -oBatchMode=yes -oConnectTimeout=8 -oStrictHostKeyChecking=no
126+
__HERE__
127+
cat "$GLOBAL_CFG_PATH"
128+
106129
- name: Brew Install
107130
if: startsWith(matrix.os, 'macos')
108131
run: |
@@ -112,19 +135,15 @@ jobs:
112135
113136
# add GNU coreutils and sed to the user PATH
114137
# (see instructions in brew install output)
115-
echo \
116-
"$(brew --prefix)/opt/coreutils/libexec/gnubin" \
117-
>> "${GITHUB_PATH}"
118-
echo \
119-
"/usr/local/opt/gnu-sed/libexec/gnubin" \
120-
>> "${GITHUB_PATH}"
121-
echo \
122-
"/usr/local/opt/grep/libexec/gnubin" \
123-
>> "${GITHUB_PATH}"
138+
echo "$(brew --prefix)/opt/coreutils/libexec/gnubin" >> "${GITHUB_PATH}"
139+
echo "$(brew --prefix)/opt/grep/libexec/gnubin" >> "${GITHUB_PATH}"
140+
echo "$(brew --prefix)/opt/gnu-sed/libexec/gnubin" >> "${GITHUB_PATH}"
124141
125142
# add coreutils to the bashrc too (for jobs)
126143
cat >> "${HOME}/.bashrc" <<__HERE__
127-
PATH="$(brew --prefix)/opt/coreutils/libexec/gnubin:/usr/local/opt/gnu-sed/libexec/gnubin:$PATH"
144+
PATH="$(brew --prefix)/opt/coreutils/libexec/gnubin:$PATH"
145+
PATH="$(brew --prefix)/opt/grep/libexec/gnubin:$PATH"
146+
PATH="$(brew --prefix)/opt/gnu-sed/libexec/gnubin:$PATH"
128147
export PATH
129148
__HERE__
130149
@@ -146,16 +165,13 @@ jobs:
146165
- name: Configure Atrun
147166
if: contains(matrix.platform, '_local_at')
148167
run: |
149-
PTH="$HOME/.cylc/flow/"
150-
mkdir -p "${PTH}"
151-
cat > "${PTH}/global.cylc" << __HERE__
168+
cat >> "$GLOBAL_CFG_PATH" << __HERE__
152169
[platforms]
153170
[[_local_at_indep_tcp]]
154171
hosts = localhost
155172
install target = localhost
156173
job runner = at
157174
__HERE__
158-
cp "${PTH}/global.cylc" "${PTH}/global-tests.cylc"
159175
160176
- name: Swarm Configure
161177
run: |
@@ -244,11 +260,11 @@ jobs:
244260
timeout-minutes: 1
245261
run: |
246262
find "$HOME/cylc-run" -name '*.err' -type f \
247-
-exec echo '====== {} ======' \; -exec cat '{}' \;
263+
-exec echo \; -exec echo '====== {} ======' \; -exec cat '{}' \;
248264
find "$HOME/cylc-run" -name '*.log' -type f \
249-
-exec echo '====== {} ======' \; -exec cat '{}' \;
265+
-exec echo \; -exec echo '====== {} ======' \; -exec cat '{}' \;
250266
find "${TMPDIR:-/tmp}/${USER}/cylctb-"* -type f \
251-
-exec echo '====== {} ======' \; -exec cat '{}' \;
267+
-exec echo \; -exec echo '====== {} ======' \; -exec cat '{}' \;
252268
253269
- name: Set artifact upload name
254270
if: always()

cylc/flow/hostuserutil.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
import socket
5151
import sys
5252
from time import time
53+
from typing import List, Optional, Tuple
5354

5455
from cylc.flow.cfgspec.glbl_cfg import glbl_cfg
5556

@@ -113,25 +114,24 @@ def get_host_ip_by_name(target):
113114
"""Return internal IP address of target."""
114115
return socket.gethostbyname(target)
115116

116-
def _get_host_info(self, target=None):
117+
def _get_host_info(
118+
self, target: Optional[str] = None
119+
) -> Tuple[str, List[str], List[str]]:
117120
"""Return the extended info of the current host."""
121+
if target is None:
122+
target = socket.getfqdn()
123+
if IS_MAC_OS and target in {
124+
'1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.'
125+
'0.0.0.0.0.0.ip6.arpa',
126+
'1.0.0.127.in-addr.arpa',
127+
}:
128+
# Python's socket bindings don't play nicely with mac os
129+
# so by default we get the above ip6.arpa address from
130+
# socket.getfqdn, note this does *not* match `hostname -f`.
131+
# https://github.com/cylc/cylc-flow/issues/2689
132+
# https://github.com/cylc/cylc-flow/issues/3595
133+
target = socket.gethostname()
118134
if target not in self._host_exs:
119-
if target is None:
120-
target = socket.getfqdn()
121-
if (
122-
IS_MAC_OS
123-
and target in {
124-
'1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.'
125-
'0.0.0.0.0.0.ip6.arpa',
126-
'1.0.0.127.in-addr.arpa'
127-
}
128-
):
129-
# Python's socket bindings don't play nicely with mac os
130-
# so by default we get the above ip6.arpa address from
131-
# socket.getfqdn, note this does *not* match `hostname -f`.
132-
# https://github.com/cylc/cylc-flow/issues/2689
133-
# https://github.com/cylc/cylc-flow/issues/3595
134-
target = socket.gethostname()
135135
try:
136136
self._host_exs[target] = socket.gethostbyname_ex(target)
137137
except IOError as exc:

tests/functional/cylc-set/00-set-succeeded/flow.cylc

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,23 @@
1515
[[graph]]
1616
R1 = """
1717
foo & bar => post<m>
18-
setter
18+
foo:started & bar:started => setter
1919
"""
2020
[runtime]
2121
[[post<m>]]
2222
[[foo, bar]]
2323
script = false
2424
[[setter]]
25-
script = """
26-
# wait for foo and bar to fail.
27-
for TASK in foo bar
28-
do
29-
cylc workflow-state \
25+
script = """
26+
# wait for foo and bar to fail.
27+
for TASK in foo bar
28+
do
29+
cylc workflow-state \
3030
${CYLC_WORKFLOW_ID}//${CYLC_TASK_CYCLE_POINT}/${TASK}:failed \
31-
--max-polls=10 --interval=1
32-
done
33-
# set foo succeeded (via --output)
34-
cylc set -o succeeded $CYLC_WORKFLOW_ID//$CYLC_TASK_CYCLE_POINT/foo
35-
# set bar succeeded (via default)
36-
cylc set $CYLC_WORKFLOW_ID//$CYLC_TASK_CYCLE_POINT/bar
37-
"""
31+
--max-polls=20 --interval=1
32+
done
33+
# set foo succeeded (via --output)
34+
cylc set -o succeeded $CYLC_WORKFLOW_ID//$CYLC_TASK_CYCLE_POINT/foo
35+
# set bar succeeded (via default)
36+
cylc set $CYLC_WORKFLOW_ID//$CYLC_TASK_CYCLE_POINT/bar
37+
"""

tests/functional/cylc-set/00-set-succeeded/reference.log

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
1/setter -triggered off [] in flow 1
1+
1/setter -triggered off ['1/bar', '1/foo'] in flow 1
22
1/foo -triggered off [] in flow 1
33
1/bar -triggered off [] in flow 1
44
1/post_m1 -triggered off ['1/bar', '1/foo'] in flow 1

tests/functional/cylc-set/03-set-failed/flow.cylc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[scheduler]
44
[[events]]
5-
inactivity timeout = PT20S
5+
inactivity timeout = PT1M
66
abort on inactivity timeout = True
77

88
[scheduling]

tests/functional/cylc-set/04-switch/flow.cylc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[scheduler]
44
[[events]]
5-
inactivity timeout = PT20S
5+
inactivity timeout = PT1M
66
abort on inactivity timeout = True
77
stall timeout = PT0S
88
abort on stall timeout = True

tests/functional/cylc-set/05-expire/flow.cylc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[scheduler]
44
[[events]]
5-
inactivity timeout = PT20S
5+
inactivity timeout = PT1M
66
abort on inactivity timeout = True
77
stall timeout = PT0S
88
abort on stall timeout = True

tests/functional/cylc-trigger/06-already-active/flow.cylc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# test triggering an already active task
22
[scheduler]
33
[[events]]
4-
inactivity timeout = PT20S
4+
inactivity timeout = PT1M
55
abort on inactivity timeout = True
66
[scheduling]
77
[[graph]]
@@ -19,4 +19,3 @@
1919
cylc__job__poll_grep_workflow_log \
2020
"1/triggeree.* ignoring trigger - already active" -E
2121
"""
22-

tests/functional/job-submission/15-garbage-platform-command-2/flow.cylc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[scheduler]
22
[[events]]
3-
inactivity timeout = PT20S
3+
inactivity timeout = PT1M
44
abort on inactivity timeout = True
55
stall timeout = PT20S
66
abort on stall timeout = True

0 commit comments

Comments
 (0)