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

Add Podman option support #135

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dabreadman
Copy link

@dabreadman dabreadman commented Apr 13, 2021

Podman Support (Need help!)

Feature

Add optional parameter container that takes in docker or podman (defaults to docker).

Issue

Podman not using cache (even though Cache restored successfully), I suspect might be caused by a different cache location.
Refer to this read on Oracle.

Podman layer cache id isn't retrieved correctly.
Refer to this run.

Current Situation

Refer to this workflow run using this code.

TODO

  • Update documentation
  • Update CI tests

@rcowsill
Copy link
Contributor

rcowsill commented Apr 15, 2021

Do you have another workflow run showing the original error? https://github.com/Kutsuja/Node-Podman-OpenShift-CI-CD isn't a public repo, so the run logs aren't available.

Also, can you give an overview of the changes made to implement this feature? The formatting changes make it harder to spot the functional changes in the diffs.

Thanks!

async getExistingImages(container: "docker" | "podman"): Promise<string[]> {
const existingSet = new Set<string>([]);
const ids = (
await exec.exec(`${container} image ls -q`, [], {
Copy link
Author

Choose a reason for hiding this comment

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

Pin

Copy link
Author

@dabreadman dabreadman Apr 16, 2021

Choose a reason for hiding this comment

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

What we see is that we have replaced docker image ls -q with ${container} image ls -q, in which we can specify ${container} to be either docker or podman.

@dabreadman
Copy link
Author

dabreadman commented Apr 16, 2021

Oh yeah sorry, I overlooked that.

Changelog

What I did was to add an option to use either docker or podman.

Error Logs

  • Podman Fresh
  1. This is the first run, with no cache found, expected.
    Every layer shares the same layerId in Post Podman Layer Caching, a problem.
  2. This is the second run, loaded cache successfully, but didn't use cache when building.
  • Docker to Podman transition
  1. This is where docker caching is still working.
    This is both the original and expected behaviour, splendid.
  2. This is a run on podman right after docker .
    We see in Podman Layer Caching, it did .. podman load .. and loaded the cache successfully.
    However, it didn't use the cache.
  3. This is yet another podman run, same behaviour.

Noteworthy

Possible bug

We can see the coverage test drop from 100% to 50% in Build image, run lint/test (both Docker and Podman), I am not sure if this was due to the unit test.
Did limited testing and can't seem to replicate this with the old action, or without this action.

  1. This is the first run.
  2. This is the second run.

Other

Old log with same key as Docker to Podman transition

  • Fresh Podman run
  1. This is a fresh >run on podman, and there's no cache (yet), as expected.
    The problem being in the Post Podman Layer Caching, it failed to store layer caches as it failed to retrieve layerId.
  2. This is a >second run, it retrieved the caches, loads them successfully, then decided not to use them.

@rcowsill
Copy link
Contributor

I've been testing podman locally and it doesn't appear to be fully compatible with the docker CLI:

  • podman save requires an extra flag -m to permit saving multiple images in a single archive; without that it only includes the first tag/digest specified.
  • podman save fails if the output archive already exists.
  • podman history seems to omit the digests for some intermediate images.
  • podman load doesn't appear to populate the cache with the loaded images.

The first two can be worked around, but if the last is correct then this action can't be updated to support podman.

@dabreadman
Copy link
Author

Ah, what a shame :{

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants