diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5783a47..a025b6d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,7 +21,7 @@ jobs: matrix: include: - runner: ubuntu-24.04 - - runner: ubuntu-24.04-arm64 + - runner: ubuntu-24.04-arm64-core permissions: contents: read @@ -58,6 +58,7 @@ jobs: - name: Build container id: build run: | + set -o pipefail python3 build.py galaxy_ng ${{ steps.determine-tag.outputs.tag }} | tee /dev/stderr >> $GITHUB_OUTPUT - name: Log in to GitHub Container Registry diff --git a/build.py b/build.py index c4b1f09..e9eb6fe 100644 --- a/build.py +++ b/build.py @@ -75,7 +75,12 @@ def run_compose(tag: str, src: str) -> None: dc_command(['up', '-d'], env=os.environ | {'TAG': tag, 'GALAXY_NG_SRC': src}) print('Prepopulate galaxy...', file=sys.stderr) - dc_command(['wait', 'setup_collections']) + try: + dc_command(['wait', 'setup_collections']) + except subprocess.CalledProcessError: + print('Setup collections failed, dumping logs:', file=sys.stderr) + dc_command(['logs', 'setup_collections'], check=False) + raise print('Stop compose...', file=sys.stderr) dc_command(['stop']) @@ -104,7 +109,7 @@ def create_data_archive(tmpdir: str) -> str: archive = 'galaxy-archive.tar' print('Make volume tarball...', file=sys.stderr) docker_command( - ['exec', '-ti', alpine_id] + [ + ['exec', alpine_id] + [ 'tar', '-cf', f'/{archive}', '/var/lib/pulp', '/etc/pulp/certs', '/var/lib/postgresql/data', '/artifacts', diff --git a/playbooks/collections/ansible_collections/local/galaxy_ng/plugins/modules/setup_collections.py b/playbooks/collections/ansible_collections/local/galaxy_ng/plugins/modules/setup_collections.py index d117413..12914b4 100644 --- a/playbooks/collections/ansible_collections/local/galaxy_ng/plugins/modules/setup_collections.py +++ b/playbooks/collections/ansible_collections/local/galaxy_ng/plugins/modules/setup_collections.py @@ -100,9 +100,6 @@ from multiprocessing import TimeoutError -COLLECTIONS_BUILD_AND_PUBLISH_TIMEOUT = 300 - - def publish_collection(module, collection): output_dir = module.params['output_dir'] @@ -260,6 +257,7 @@ def run_module(): ), gpg_homedir=dict(type='path', default=None), output_dir=dict(type='path', default=None), + timeout=dict(type='int', default=300), ) module = AnsibleModule( @@ -275,7 +273,7 @@ def run_module(): try: result['results'] = pool.map_async( publish_func, module.params['collections'] - ).get(timeout=COLLECTIONS_BUILD_AND_PUBLISH_TIMEOUT) + ).get(timeout=module.params['timeout']) except TimeoutError as timeout_err: module.fail_json( 'Timed out waiting for collections to be provisioned.', diff --git a/playbooks/playbook.yml b/playbooks/playbook.yml index 2c36410..091d76e 100644 --- a/playbooks/playbook.yml +++ b/playbooks/playbook.yml @@ -330,6 +330,7 @@ collections: '{{ primary_collections }}' gpg_homedir: '{{ gpg_homedir }}' output_dir: '{{ temp_root }}/primary_collections' + timeout: 500 environment: ANSIBLE_CONFIG: '{{ playbook_dir }}/ansible.cfg' register: setup_collections