Skip to content

Commit

Permalink
build(deps): update dependency molecule to v24 (#425)
Browse files Browse the repository at this point in the history
Co-authored-by: aki-bot <103840025+aki-bot[bot]@users.noreply.github.com>
Co-authored-by: Aki Kanellis <[email protected]>
  • Loading branch information
aki-bot[bot] and akikanellis authored Apr 5, 2024
1 parent 5c9340e commit 97c7d2f
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 26 deletions.
49 changes: 41 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,45 @@ name: Test
default: false

jobs:
set-platforms:
name: Set platforms
runs-on: ubuntu-latest

outputs:
platforms: ${{ steps.set-platforms.outputs.result }}

steps:
- name: Checkout
# yamllint disable-line rule:line-length
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Set platforms
id: set-platforms
uses: mikefarah/yq@c35ec752e38ea0c096d3c44e13cfc0797ac394d8 # v4.43.1
with:
cmd: >
yq --output-format=json --indent=0
'[.platforms[].name]'
ansible/molecule/default/molecule.yml
test:
name: Test
runs-on: macos-12
runs-on: ubuntu-latest
needs: set-platforms
continue-on-error: ${{ inputs.continue-on-error }}
strategy:
matrix:
platform: ${{ fromJson(needs.set-platforms.outputs.platforms) }}

steps:
# GitHub Actions hosted runners provide around 21GB of free storage, but
# the instances need around 25GB. This action frees up an additional
# 24GB, giving us a total of 45GB, which is enough disk space to run each
# VM.
- name: Free disk space
# yamllint disable-line rule:line-length
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1

- name: Checkout
# yamllint disable-line rule:line-length
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
Expand All @@ -38,8 +71,13 @@ jobs:
python-version: 3.12.2
cache: pip

- name: Update apt
run: sudo apt update

- name: Install dependencies
run: just install-dependencies
run: |
sudo apt install vagrant virtualbox
just install-dependencies
- name: Cache Vagrant boxes
# yamllint disable-line rule:line-length
Expand All @@ -52,9 +90,4 @@ jobs:
restore-keys: ${{ runner.os }}-vagrant-

- name: Test
run: >
echo "Tests are temporarily disabled.
See:
- https://github.com/actions/runner-images/issues/8730
- https://github.com/actions/runner-images/issues/8642
"
run: just test --platform-name=${{ matrix.platform }}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ Install the following software

- [just](https://github.com/casey/just)
- [mise](https://github.com/jdx/mise)
- [![Vagrant](docs/images/vagrant.svg) Vagrant](https://www.vagrantup.com)
- [![VirtualBox](docs/images/virtualbox.svg) VirtualBox](https://www.virtualbox.org)

### Usage
Expand Down
2 changes: 0 additions & 2 deletions ansible/ansible.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ inventory=inventories/prod

remote_user=ansible

roles_path=galaxy/roles:roles
collections_path=galaxy/collections:collections
inventory_plugins=inventory_plugins

vault_identity_list = [email protected], [email protected]
Expand Down
14 changes: 7 additions & 7 deletions ansible/justfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,37 +18,37 @@ install-dependencies:
test *extra_args:
#!/usr/bin/env bash
source env/bin/activate
molecule {{extra_args}} test
molecule test {{extra_args}}
# Create hosts locally
up *extra_args:
#!/usr/bin/env bash
source env/bin/activate
molecule {{extra_args}} create
molecule create {{extra_args}}
# Create and configure hosts locally
run *extra_args:
#!/usr/bin/env bash
source env/bin/activate
molecule {{extra_args}} converge
molecule converge {{extra_args}}
# Create and configure hosts locally for `test` tags
run-test *extra_args:
#!/usr/bin/env bash
source env/bin/activate
molecule {{extra_args}} converge -- --tags test -vv
molecule converge {{extra_args}} -- --tags test -vv
# Create and configure hosts locally with debug logs
run-debug *extra_args:
#!/usr/bin/env bash
source env/bin/activate
molecule --debug {{extra_args}} converge -- -vvv
molecule --debug converge {{extra_args}} -- -vvv
# Create and configure hosts locally for `test` tags with debug logs
run-test-debug *extra_args:
#!/usr/bin/env bash
source env/bin/activate
molecule {{extra_args}} converge -- --tags test -vvv
molecule converge {{extra_args}} -- --tags test -vvv
# Log in to a locally created host
login host:
Expand All @@ -60,7 +60,7 @@ login host:
down *extra_args:
#!/usr/bin/env bash
source env/bin/activate
molecule {{extra_args}} destroy
molecule destroy {{extra_args}}
# Edit dev vault
edit-dev-vault:
Expand Down
17 changes: 10 additions & 7 deletions ansible/molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,31 @@ driver:
name: vagrant
default_box: ubuntu/jammy64

# We currently use a 4-core ubuntu-latest instance in the
# '.github/workflows/test.yml' workflow. After performance testing the runners
# with different platform core and memory allocations, we found that 2-core
# platforms with 2GB of memory were the optimal configurations for test
# runtime. Higher core counts were slower, most likely due to inefficient
# virtualisation in GitHub Action runners, which led to increased resource
# contention and I/O overhead.
#
# See:
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
platforms:
- name: workstation-pop-os
groups: [workstations]
# `cpus` need to roughly match the core count used by the CI. Currently, we
# are using a 3-core macos-12 instance in '.github/workflows/test.yml',
# therefore we are using 2x 2-core instances with vagrant.
# See:
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
cpus: 2
memory: 2048

- name: server-nas
groups: [servers]
# See note on `cpus` above
cpus: 2
# server-nas needs extra memory primarily due to the amount of docker apps
# that are running
memory: 4096

- name: server-pi
groups: [servers]
# See note on `cpus` above
cpus: 2
memory: 2048

Expand Down
4 changes: 2 additions & 2 deletions ansible/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ansible-core==2.16.5
molecule==5.1.0
molecule-plugins[vagrant]==23.5.0
molecule==24.2.0
molecule-plugins[vagrant]==23.5.3
netaddr==1.2.1
1 change: 1 addition & 0 deletions docs/DEVELOPERS_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Install the following software

- [just](https://github.com/casey/just)
- [mise](https://github.com/jdx/mise)
- [![Vagrant](images/vagrant.svg) Vagrant](https://www.vagrantup.com)
- [![VirtualBox](images/virtualbox.svg) VirtualBox](https://www.virtualbox.org)

## Useful Commands
Expand Down

0 comments on commit 97c7d2f

Please sign in to comment.