Compare commits

...

50 Commits

Author SHA1 Message Date
Ramon Roche 094849511f ci: no docker instead install python deps 2024-08-14 10:47:49 -07:00
Ramon Roche 2e5c3d9e2e ci: more permission stuff 2024-08-14 10:45:04 -07:00
Ramon Roche 96853557a9 ci: play around with permissions 2024-08-14 10:41:11 -07:00
Ramon Roche ca6649e27f ci: tmate v3 2024-08-14 10:35:59 -07:00
Ramon Roche b68001685d ci: no sudo debug 2024-08-14 10:32:45 -07:00
Ramon Roche 809d63bbf5 ci: debug on a single matrix element 2024-08-14 10:23:13 -07:00
Ramon Roche ae6fdde07a ci: try with uid 1001 2024-08-14 07:57:56 -07:00
Ramon Roche 54d7c9cbbe ci: move debug up 2024-08-13 11:28:27 -07:00
Ramon Roche 871befd148 ci: fix yaml 2024-08-13 11:24:10 -07:00
Ramon Roche 7a6301a9d7 ci: debug container ownership 2024-08-13 11:23:02 -07:00
Ramon Roche 2181e0eb8a ci: turns out we do need the container 2024-08-13 11:14:12 -07:00
Ramon Roche 7b6db68974 tools: stranded group 2024-08-13 11:08:41 -07:00
Ramon Roche 23d36fdbd8 ci: we dont need container for first step 2024-08-13 11:04:00 -07:00
Ramon Roche 722f084a5b Tools: verbose debugging 2024-08-13 11:02:11 -07:00
Ramon Roche 8fef52c473 ci: add debug step with tmate 2024-08-13 10:56:02 -07:00
Ramon Roche b00a8de83a tools: debug grouping py script 2024-08-13 09:35:18 -07:00
Ramon Roche 746c3994d3 ci: debug target tool 2024-08-13 09:29:20 -07:00
Ramon Roche 81da3c0931 ci: i dont know anymore 2024-08-13 07:38:54 -07:00
Ramon Roche 3c3bf192b9 ci: dont specify token use default 2024-08-13 07:21:56 -07:00
Ramon Roche abafd089fd ci: rollback checkout to v3 2024-08-13 07:19:39 -07:00
Ramon Roche 385d38d566 ci: fix user id shenanigans 2024-08-13 07:16:48 -07:00
Ramon Roche d5ef958740 ci: roll back checkout v3 with user 1001 2024-08-13 07:14:49 -07:00
Ramon Roche 7c90d5ffb8 ci: comment user id 2024-08-13 07:12:42 -07:00
Ramon Roche b24db4d516 tools: update grouping lenghts 2024-08-13 07:06:50 -07:00
Ramon Roche c1c923d663 ci: update action versions 2024-08-13 07:06:33 -07:00
Ramon Roche f4e0abc700 ci: swap user to 1001 2024-08-13 06:36:25 -07:00
Ramon Roche e89e67b3bc ci: fix runs-on label 2024-08-12 14:30:54 -07:00
Ramon Roche b006a913c2 ci: test new infra 2024-08-12 14:28:06 -07:00
Ramon Roche fa570974a7 ci: go back to self hosted only 2024-08-09 12:57:28 -07:00
Ramon Roche 9b2be5c287 ci: update cache action and also use ubuntu runner 2024-08-09 12:52:50 -07:00
Ramon Roche c39c6898cd ci: fix target to platform map in groups 2024-08-09 10:43:12 -07:00
Ramon Roche 7d578aefe7 ci: shared cache key 2024-08-09 10:17:40 -07:00
Ramon Roche 4ebd4e75ad ci: use the proper containers and job names 2024-08-09 10:08:16 -07:00
Ramon Roche 8b758efa44 tools: build tool fail 2024-08-09 09:12:02 -07:00
Ramon Roche 4d5c4b53ee Toosls: fix aarch 2024-08-09 09:06:00 -07:00
Ramon Roche 2f31c07abe ci: silence fix 2024-08-09 09:03:33 -07:00
Ramon Roche 21e882eefc ci: set container user 2024-08-09 09:00:14 -07:00
Ramon Roche 01666ae613 ci: grouped output 2024-08-09 08:34:20 -07:00
Ramon Roche fa8c4ff7c9 ci: run make on external script 2024-08-09 08:26:53 -07:00
Ramon Roche 166bf22cb7 ci: fix runs-on 2024-08-09 08:04:34 -07:00
Ramon Roche 5d2968c582 ci: fix substitution 2024-08-09 07:50:27 -07:00
Ramon Roche be63f06fd3 ci: runs on self hosted 2024-08-08 11:42:20 -07:00
Ramon Roche c15a2a03be ci: fix run make build 2024-08-08 10:34:11 -07:00
Ramon Roche 43481ccc77 ci: build all action fix output 2024-08-07 18:50:19 -07:00
Ramon Roche 602657b72f ci: remove manual compile actions
in favor of new build all
2024-08-07 18:49:53 -07:00
Ramon Roche 226bde5925 ci: build groups workflow 2024-08-07 10:13:18 -07:00
Ramon Roche 8f7345f6e2 ci: stop nuttx compile for now 2024-08-07 10:12:50 -07:00
Ramon Roche 1fb2992f17 Tools: boards group targets as trings 2024-08-07 10:09:25 -07:00
Ramon Roche 7c9217921c Tools: generate build groups for CI 2024-08-06 12:01:33 -07:00
Ramon Roche d51556dec4 editorconfig: yaml, yml settings 2024-08-06 07:16:22 -07:00
7 changed files with 204 additions and 250 deletions
+1 -1
View File
@@ -9,6 +9,6 @@ tab_width = 8
# Not in the official standard, but supported by many editors
max_line_length = 120
[*.yaml]
[*.yaml, *.yml]
indent_style = space
indent_size = 2
+89
View File
@@ -0,0 +1,89 @@
name: Build all targets
on:
push:
branches:
- 'mrpollo/ci_runner_groups'
jobs:
group_targets:
runs-on: [runs-on,runner=2cpu-linux-x64,image=ubuntu22-full-x64,"run-id=${{ github.run_id }}"]
# container:
# image: px4io/px4-dev-base-focal:2021-09-08
# options: --user 1001
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
timestamp: ${{ steps.set-timestamp.outputs.timestamp }}
steps:
- uses: actions/checkout@v4
# token: ${{ secrets.ACCESS_TOKEN }}
- name: Install Python dependencies
uses: py-actions/py-dependency-install@v4
with:
path: "./Tools/setup/requirements.txt"
- id: set-matrix
run: echo "::set-output name=matrix::$(./Tools/generate_board_targets_json.py --group)"
# - name: debug groups
# run: |
# echo "::group::DebugTargets"
# ./Tools/generate_board_targets_json.py --group --verbose
# echo "::endgroup::"
- id: set-timestamp
run: echo "::set-output name=timestamp::$(date +"%Y%m%d%H%M%S")"
setup:
name: ${{ matrix.group }}
runs-on: [runs-on,runner=8cpu-linux-x64,image=ubuntu22-full-x64,"run-id=${{ github.run_id }}"]
needs: group_targets
strategy:
# matrix: ${{ fromJson(needs.group_targets.outputs.matrix) }}
matrix:
include:
- group: 'nuttx-px4'
targets: 'px4_fmu-v5x_default,px4_fmu-v6x_default'
container: 'px4io/px4-dev-nuttx-focal:2022-08-12'
arch: 'nuttx'
container:
image: ${{ matrix.container }}
# options: --user 1001
steps:
- uses: actions/checkout@v4
with:
submodules: true
# token: ${{ secrets.ACCESS_TOKEN }}
- name: debug permissions
run: |
echo "::group::DebugPermissions"
echo $UID
echo $PATH
echo "::endgroup::"
- name: ccache setup keys
uses: actions/cache@v4
with:
path: ~/.ccache
key: ${{ matrix.arch }}-ccache-${{ needs.group_targets.outputs.timestamp }}
restore-keys: ${{ matrix.arch }}-ccache-${{ needs.group_targets.outputs.timestamp }}
- name: setup ccache
run: |
mkdir -p ~/.ccache
echo "base_dir = ${GITHUB_WORKSPACE}" > ~/.ccache/ccache.conf
echo "compression = true" >> ~/.ccache/ccache.conf
echo "compression_level = 6" >> ~/.ccache/ccache.conf
echo "max_size = 120M" >> ~/.ccache/ccache.conf
echo "hash_dir = false" >> ~/.ccache/ccache.conf
ccache -s
ccache -z
- name: Debug with tmate session
uses: mxschmitt/action-tmate@v3
with:
detached: true
# sudo: false
- name: build target group
run: |
./Tools/ci_build_all_runner.sh ${{matrix.targets}}
- name: ccache post-run
run: ccache -s
-58
View File
@@ -1,58 +0,0 @@
name: Compile Linux Targets
on:
push:
branches:
- 'main'
- 'stable'
- 'beta'
- 'release/*'
pull_request:
branches:
- '*'
jobs:
build:
runs-on: ubuntu-latest
container: px4io/px4-dev-armhf:2023-06-26
strategy:
matrix:
config: [
beaglebone_blue_default,
emlid_navio2_default,
px4_raspberrypi_default,
scumaker_pilotpi_default,
]
steps:
- uses: actions/checkout@v1
with:
token: ${{secrets.ACCESS_TOKEN}}
- name: ownership workaround
run: git config --system --add safe.directory '*'
- name: Prepare ccache timestamp
id: ccache_cache_timestamp
shell: cmake -P {0}
run: |
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
message("::set-output name=timestamp::${current_date}")
- name: ccache cache files
uses: actions/cache@v2
with:
path: ~/.ccache
key: ${{matrix.config}}-ccache-${{steps.ccache_cache_timestamp.outputs.timestamp}}
restore-keys: ${{matrix.config}}-ccache-
- name: setup ccache
run: |
mkdir -p ~/.ccache
echo "base_dir = ${GITHUB_WORKSPACE}" > ~/.ccache/ccache.conf
echo "compression = true" >> ~/.ccache/ccache.conf
echo "compression_level = 6" >> ~/.ccache/ccache.conf
echo "max_size = 100M" >> ~/.ccache/ccache.conf
echo "hash_dir = false" >> ~/.ccache/ccache.conf
ccache -s
ccache -z
- name: make ${{matrix.config}}
run: make ${{matrix.config}}
- name: ccache post-run
run: ccache -s
-54
View File
@@ -1,54 +0,0 @@
name: Compile Linux ARM64 Targets
on:
push:
branches:
- 'main'
- 'stable'
- 'beta'
- 'release/*'
pull_request:
branches:
- '*'
jobs:
build:
runs-on: ubuntu-latest
container: px4io/px4-dev-aarch64:2022-08-12
strategy:
matrix:
config: [
scumaker_pilotpi_arm64,
]
steps:
- uses: actions/checkout@v1
with:
token: ${{secrets.ACCESS_TOKEN}}
- name: Prepare ccache timestamp
id: ccache_cache_timestamp
shell: cmake -P {0}
run: |
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
message("::set-output name=timestamp::${current_date}")
- name: ccache cache files
uses: actions/cache@v2
with:
path: ~/.ccache
key: ${{matrix.config}}-ccache-${{steps.ccache_cache_timestamp.outputs.timestamp}}
restore-keys: ${{matrix.config}}-ccache-
- name: setup ccache
run: |
mkdir -p ~/.ccache
echo "base_dir = ${GITHUB_WORKSPACE}" > ~/.ccache/ccache.conf
echo "compression = true" >> ~/.ccache/ccache.conf
echo "compression_level = 6" >> ~/.ccache/ccache.conf
echo "max_size = 100M" >> ~/.ccache/ccache.conf
echo "hash_dir = false" >> ~/.ccache/ccache.conf
ccache -s
ccache -z
- name: make ${{matrix.config}}
run: make ${{matrix.config}}
- name: ccache post-run
run: ccache -s
-136
View File
@@ -1,136 +0,0 @@
name: Compile Nuttx Targets
on:
push:
branches:
- 'main'
- 'stable'
- 'beta'
- 'release/*'
pull_request:
branches:
- '*'
jobs:
build:
runs-on: ubuntu-latest
container: px4io/px4-dev-nuttx-focal:2022-08-12
strategy:
fail-fast: false
matrix:
config: [
airmind_mindpx-v2,
ark_can-flow,
ark_can-gps,
ark_can-rtk-gps,
ark_cannode,
ark_fmu-v6x,
ark_pi6x,
ark_septentrio-gps,
atl_mantis-edu,
av_x-v1,
bitcraze_crazyflie,
bitcraze_crazyflie21,
cuav_can-gps-v1,
cuav_nora,
cuav_x7pro,
cubepilot_cubeorange,
cubepilot_cubeorangeplus,
cubepilot_cubeyellow,
diatone_mamba-f405-mk2,
freefly_can-rtk-gps,
holybro_can-gps-v1,
holybro_durandal-v1,
holybro_kakutef7,
holybro_kakuteh7,
holybro_pix32v5,
matek_gnss-m9n-f4,
matek_h743,
matek_h743-mini,
matek_h743-slim,
modalai_fc-v1,
modalai_fc-v2,
mro_ctrl-zero-classic,
mro_ctrl-zero-f7,
mro_ctrl-zero-f7-oem,
mro_ctrl-zero-h7,
mro_ctrl-zero-h7-oem,
mro_pixracerpro,
mro_x21,
mro_x21-777,
nxp_fmuk66-e,
nxp_fmuk66-v3,
nxp_mr-canhubk3,
nxp_ucans32k146,
omnibus_f4sd,
px4_fmu-v2,
px4_fmu-v3,
px4_fmu-v4,
px4_fmu-v4pro,
px4_fmu-v5,
px4_fmu-v5x,
px4_fmu-v6c,
px4_fmu-v6u,
px4_fmu-v6x,
px4_fmu-v6xrt,
raspberrypi_pico,
sky-drones_smartap-airlink,
spracing_h7extreme,
uvify_core,
siyi_n7
]
steps:
- uses: actions/checkout@v1
with:
token: ${{secrets.ACCESS_TOKEN}}
- name: Prepare ccache timestamp
id: ccache_cache_timestamp
shell: cmake -P {0}
run: |
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
message("::set-output name=timestamp::${current_date}")
- name: ccache cache files
uses: actions/cache@v2
with:
path: ~/.ccache
key: ${{matrix.config}}-ccache-${{steps.ccache_cache_timestamp.outputs.timestamp}}
restore-keys: ${{matrix.config}}-ccache-
- name: setup ccache
run: |
mkdir -p ~/.ccache
echo "base_dir = ${GITHUB_WORKSPACE}" > ~/.ccache/ccache.conf
echo "compression = true" >> ~/.ccache/ccache.conf
echo "compression_level = 6" >> ~/.ccache/ccache.conf
echo "max_size = 120M" >> ~/.ccache/ccache.conf
echo "hash_dir = false" >> ~/.ccache/ccache.conf
ccache -s
ccache -z
- name: make all_variants_${{matrix.config}}
run: make all_variants_${{matrix.config}}
timeout-minutes: 45
- name: make ${{matrix.config}} bloaty_compileunits
run: make ${{matrix.config}} bloaty_compileunits || true
- name: make ${{matrix.config}} bloaty_inlines
run: make ${{matrix.config}} bloaty_inlines || true
- name: make ${{matrix.config}} bloaty_segments
run: make ${{matrix.config}} bloaty_segments || true
- name: make ${{matrix.config}} bloaty_symbols
run: make ${{matrix.config}} bloaty_symbols || true
- name: make ${{matrix.config}} bloaty_templates
run: make ${{matrix.config}} bloaty_templates || true
- name: make ${{matrix.config}} bloaty_ram
run: make ${{matrix.config}} bloaty_ram || true
- name: make ${{matrix.config}} bloaty_compare_master
run: make ${{matrix.config}} bloaty_compare_master || true
- name: ccache post-run
run: ccache -s
- name: Upload px4 package
uses: actions/upload-artifact@v2
with:
name: px4_package_${{matrix.config}}
path: |
build/**/*.px4
build/**/*.bin
+12
View File
@@ -0,0 +1,12 @@
#!/bin/bash
# This script is meant to be used by the build_all.yml workflow in a github runner
# Please only modify if you know what you are doing
set -e
targets=$1
for target in ${targets//,/ }
do
echo "::group::Building: [${target}]"
make $target
echo "::endgroup::"
done
+102 -1
View File
@@ -23,11 +23,14 @@ parser.add_argument('-v', '--verbose', dest='verbose', action='store_true',
help='Verbose Output')
parser.add_argument('-p', '--pretty', dest='pretty', action='store_true',
help='Pretty output instead of a single line')
parser.add_argument('-g', '--groups', dest='group', action='store_true',
help='Groups targets')
args = parser.parse_args()
verbose = args.verbose
build_configs = []
grouped_targets = {}
excluded_boards = ['modalai_voxl2', 'px4_ros2'] # TODO: fix and enable
excluded_manufacturers = ['atlflight']
excluded_platforms = ['qurt']
@@ -41,6 +44,7 @@ def process_target(px4board_file, target_name):
ret = None
platform = None
toolchain = None
group = None
if px4board_file.endswith("default.px4board") or \
px4board_file.endswith("recovery.px4board") or \
@@ -63,19 +67,25 @@ def process_target(px4board_file, target_name):
# get the container based on the platform and toolchain
if platform == 'posix':
container = 'px4io/px4-dev-base-focal:2021-09-08'
group = 'base'
if toolchain:
if toolchain.startswith('aarch64'):
container = 'px4io/px4-dev-aarch64:2022-08-12'
group = 'aarch64'
elif toolchain == 'arm-linux-gnueabihf':
container = 'px4io/px4-dev-armhf:2023-06-26'
group = 'armhf'
else:
if verbose: print(f'unmatched toolchain: {toolchain}')
elif platform == 'nuttx':
container = 'px4io/px4-dev-nuttx-focal:2022-08-12'
group = 'nuttx'
else:
if verbose: print(f'unmatched platform: {platform}')
ret = {'target': target_name, 'container': container}
if(args.group):
ret['arch'] = group
return ret
@@ -105,12 +115,103 @@ for manufacturer in os.scandir(os.path.join(source_dir, 'boards')):
if verbose: print(f'excluding label {label} ({target_name})')
continue
target = process_target(files.path, target_name)
if (args.group and target is not None):
if (target['arch'] not in grouped_targets):
grouped_targets[target['arch']] = {}
grouped_targets[target['arch']]['container'] = target['container']
grouped_targets[target['arch']]['manufacturers'] = {}
if(manufacturer.name not in grouped_targets[target['arch']]['manufacturers']):
grouped_targets[target['arch']]['manufacturers'][manufacturer.name] = {}
grouped_targets[target['arch']]['manufacturers'][manufacturer.name] = []
grouped_targets[target['arch']]['manufacturers'][manufacturer.name].append(target_name)
if target is not None:
build_configs.append(target)
def comma_targets(targets):
return ",".join(targets)
github_action_config = { 'include': build_configs }
extra_args = {}
if args.pretty:
extra_args['indent'] = 2
print(json.dumps(github_action_config, **extra_args))
if (args.group):
if(verbose):
import pprint
pprint.pp(grouped_targets)
final_groups = []
temp_group = []
group_number = {}
last_man = ''
last_arch = ''
for arch in grouped_targets:
if(last_arch == ''):
last_arch = arch
if(arch not in group_number):
group_number[arch] = 0
if verbose: print('arch:', arch, ' - last_arch:', last_arch)
if(last_arch != arch and len(temp_group) > 0):
group_name = last_arch + "-" + str(group_number[last_arch])
group_number[last_arch] += 1
targets = comma_targets(temp_group)
if verbose: print("Append-1: [", group_name, "]", targets)
final_groups.append({
"container": grouped_targets[last_arch]['container'],
"targets": targets,
"arch": last_arch,
"group": group_name
})
last_arch = arch
temp_group = []
for man in grouped_targets[arch]['manufacturers']:
for tar in grouped_targets[arch]['manufacturers'][man]:
if(last_man != man):
if(len(grouped_targets[arch]['manufacturers'][man]) > 5):
group_name = arch + "-" + man
targets = comma_targets(grouped_targets[arch]['manufacturers'][man])
last_man = man
if verbose: print("Append-2: [", group_name , "]", " - ", targets)
final_groups.append({
"container": grouped_targets[arch]['container'],
"targets": targets,
"arch": arch,
"group": group_name
})
else:
temp_group.append(tar)
if verbose: print('Temp(', len(temp_group), '):[', man, '][', arch, ':', last_arch, ']: ', tar)
if(last_arch != arch and len(temp_group) > 0):
group_name = last_arch + "-" + str(group_number[last_arch])
group_number[last_arch] += 1
targets = comma_targets(temp_group)
if verbose: print("Append-4: [", group_name, "]", targets)
final_groups.append({
"container": grouped_targets[last_arch]['container'],
"targets": targets,
"arch": last_arch,
"group": group_name
})
last_arch = arch
temp_group = []
if(len(temp_group) > 4):
group_name = arch + "-" + str(group_number[arch])
last_arch = arch
group_number[arch] += 1
targets = comma_targets(temp_group)
if verbose: print("Append-3: [", group_name, "]", " - ", targets)
final_groups.append({
"container": grouped_targets[arch]['container'],
"targets": targets,
"arch": arch,
"group": group_name
})
temp_group = []
if(verbose):
import pprint
pprint.pp(final_groups)
print(json.dumps({ "include": final_groups }, **extra_args))
else:
print(json.dumps(github_action_config, **extra_args))