Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DPE-5642: breaking(build_charm.yaml): Pack on self hosted runners #245

Closed
wants to merge 14 commits into from
7 changes: 5 additions & 2 deletions .github/workflows/build_charm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,11 @@ jobs:
runs-on: ${{ matrix.base.runner }}
timeout-minutes: 120
steps:
- name: (GitHub-hosted ARM runner) Install libpq-dev
if: ${{ matrix.base.runner == 'Ubuntu_ARM64_4C_16G_02' }}
- name: Install pipx
run: |
sudo apt-get update
sudo apt-get install pipx -y
Comment on lines +92 to +93
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pipx is missing from the IS runners and packages are not up to date.

- name: Install libpq-dev
# Needed for `charmcraftcache` to resolve dependencies (for postgresql charms with psycopg2)
run: sudo apt-get install libpq-dev -y
- name: Get workflow version
Expand Down
27 changes: 5 additions & 22 deletions .github/workflows/integration_test_charm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ jobs:
import os

DEFAULT_RUNNERS = {
"amd64": "ubuntu-latest",
"arm64": ["self-hosted", "data-platform", "ubuntu", "ARM64", "4cpu16ram"],
"amd64": ["self-hosted", "linux", "X64", "large", "jammy"],
"arm64": ["self-hosted", "linux", "ARM64", "large", "jammy"],
}
ARCHITECTURE = "${{ inputs.architecture }}"
try:
Expand Down Expand Up @@ -206,35 +206,18 @@ jobs:
run: |
mkdir ~/dpw/
echo 'Integration | ${{ inputs.juju-agent-version || inputs.juju-snap-channel }} | ${{ inputs.architecture }} / ${{ matrix.groups.job_name }}' > ~/dpw/job_name
- name: (GitHub hosted) Free up disk space
timeout-minutes: 1
# If not (IS hosted or Data Platform hosted)
# `inputs.architecture == 'arm64' && matrix.groups.runner == null` means Data Platform hosted (default runner)
if: ${{ !(matrix.groups.is_hosted || matrix.groups.data_platform_hosted || (inputs.architecture == 'arm64' && matrix.groups.runner == null)) }}
run: |
printf '\nDisk usage before cleanup\n'
df --human-readable
# Based on https://github.com/actions/runner-images/issues/2840#issuecomment-790492173
rm -r /usr/share/dotnet
rm -r /opt/hostedtoolcache/
printf '\nDisk usage after cleanup\n'
df --human-readable
- name: (self hosted) Disk usage
timeout-minutes: 1
# If IS hosted or Data Platform hosted
# `inputs.architecture == 'arm64' && matrix.groups.runner == null` means Data Platform hosted (default runner)
if: ${{ matrix.groups.is_hosted || matrix.groups.data_platform_hosted || (inputs.architecture == 'arm64' && matrix.groups.runner == null) }}
run: df --human-readable
- name: (IS hosted) Install pipx
- name: Install pipx
timeout-minutes: 3
if: ${{ matrix.groups.is_hosted }}
run: |
sudo apt-get update
# python3-pip recommends build-essential—a relatively large package we don't need
sudo apt-get install python3-pip python3-venv -y --no-install-recommends
python3 -m pip install --user pipx
python3 -m pipx ensurepath
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
sudo apt-get install pipx -y
sudo apt-get update
- name: Get workflow version
timeout-minutes: 2
id: workflow-version
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@

logging.basicConfig(level=logging.INFO, stream=sys.stdout)
RUNNERS = {
craft.Architecture.X64: "ubuntu-latest",
craft.Architecture.ARM64: "Ubuntu_ARM64_4C_16G_02",
craft.Architecture.X64: ["self-hosted", "linux", "X64", "large", "jammy"],
craft.Architecture.ARM64: ["self-hosted", "linux", "ARM64", "large", "jammy"],
Comment on lines +26 to +27
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can probably use other runner sizes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since charmcraft will spin lxd containers, we can also try using noble.

}


Expand Down