Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,27 @@ The requested operating system and architecture combination is not available in
**Resolution:**
Confirm that the specified OS and architecture are supported by **image-garden**, and update your inputs as needed.

### Trouble accessing repositories using `apt`

**Cause:**
Image-garden bundles **apt-cacher-ng**, which acts as a caching proxy for apt
repositories. This improves performance by caching downloaded packages across
workflow runs, but may mask issues related to accessing said repositories in
environments with strict policies for outgoing network connections.

**Resolution:**
Disable apt-cacher-ng by setting the `cache-deb-packages` input to `false` in your workflow:

```yaml
- name: Run integration tests
uses: zyga/image-garden-action@v0
with:
garden-system: debian-cloud-12
cache-deb-packages: "false"
```

This will stop the apt-cacher-ng service and remove its socket, allowing direct access to apt repositories.

## Further reading

Consult documentation of [spread](https://github.com/canonical/spread) and
Expand Down
11 changes: 11 additions & 0 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ inputs:
cache-prepared-images:
description: Use GitHub cache to store project-specific images (cache-intensive, scales poorly with number of systems)
default: "false"
cache-deb-packages:
description: Use apt-cacher for caching deb packages
default: "true"
spread-variant:
description: Variant of spread to use
default: ""
Expand Down Expand Up @@ -132,6 +135,14 @@ runs:
shell: bash
if: ${{ inputs.spread-variant != '' }}
run: sudo snap set image-garden spread-variant=${{ inputs.spread-variant }}
- name: Disable apt-cacher-ng
shell: bash
if: ${{ !fromJSON(inputs.cache-deb-packages) }}
run: |
echo "::group::Disable apt-cacher-ng"
sudo snap stop image-garden.apt-cacher-ng
sudo rm -fv /var/snap/image-garden/common/apt-cacher-ng.sock
echo "::endgroup::"
- name: Make the virtual machine image (dry run)
shell: bash
working-directory: ${{ inputs.spread-subdir }}
Expand Down