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

hack: expand snapshots inside docker #205

Merged
merged 2 commits into from
Jan 5, 2021

Conversation

ffromani
Copy link
Collaborator

@ffromani ffromani commented Jan 4, 2021

GHW gained support to consume snapshot programmatically.
This means there is no need anymore to expand the snapshot before
mount it in docker, which greatly simplifies the
run-against-snapshot.sh scripts.

We just need to pass the snapshot and a bunch of environment variables.

Additionally, start document describing how a GHW compliant snapshot
should look like, and why things are the way they are.

Signed-off-by: Francesco Romani [email protected]

@ffromani
Copy link
Collaborator Author

ffromani commented Jan 4, 2021

@jaypipes and me talked a bit offline about how snapshots should look like, which the challenges are with symlinks, and in short why run-against-snapshot.sh looks the way it looks. So I started documenting the history in SNAPSHOT.md (see commit) and along the way I come together with this simple idea. So I packed all together in this simple PR which I want to push as conversation starter. Not sure this is the way forward but it seems the simplest way to link all the piaces together, and works as expected on

$ docker info
Client:
 Context:    default
 Debug Mode: false
 Plugins:
  app: Docker App (Docker Inc., v0.9.1-beta3)
  buildx: Build with BuildKit (Docker Inc., v0.5.0-docker)

Server:
 Containers: 16
  Running: 0
  Paused: 0
  Stopped: 16
 Images: 96
 Server Version: 20.10.1

so let's discuss! worst case we can have a great reference to document why should NOT go this way :)

@ffromani ffromani force-pushed the run-against-snapshot-updates branch from 0e004a4 to c17aa01 Compare January 4, 2021 14:05
@ffromani
Copy link
Collaborator Author

ffromani commented Jan 4, 2021

and with my latest commit works as well with

 /usr/bin/podman version
Version:      2.2.1
API Version:  2.1.0

Copy link
Owner

@jaypipes jaypipes left a comment

Choose a reason for hiding this comment

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

Really nice, @fromanirh! Just a few nits and suggestions inline, but overall I think this is great. Really cleans up the snapshot experience.

SNAPSHOT.md Outdated
For GHW, snapshots are partial clones of the `/proc`, `/sys` (et. al.) subtrees taken into arbitrary
machines, which GHW can consume later. "partial" is because the snapshot doesn't need to contain a
complete copy of all the filesystem subtree (that is doable but inpractical). It only needs to contain
the paths GHW cares about. The snapshot concept was introduced [to make GHW easier to test](https://github.com/jaypipes/ghw/issues/66).
Copy link
Owner

Choose a reason for hiding this comment

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

👍

GHW gained support to consume snapshot programmatically.
This means there is no need anymore to expand the snapshot before
mount it in docker, which greatly simplifies the
`run-against-snapshot.sh` scripts.

We just need to pass the snapshot and a bunch of environment variables.

Additionally, start document describing how a GHW compliant snapshot
should look like, and why things are the way they are.

Signed-off-by: Francesco Romani <[email protected]>
add minimal changes to be able to use podman. Default is still docker.
Example:

CONTAINER_RUNTIME=podman ./hack/run-against-snapshot.sh ...

Signed-off-by: Francesco Romani <[email protected]>
Copy link
Owner

@jaypipes jaypipes left a comment

Choose a reason for hiding this comment

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

w00t! :)

@jaypipes jaypipes merged commit cd8bac9 into jaypipes:master Jan 5, 2021
@jaypipes jaypipes added this to the v0.7 milestone Jan 12, 2021
@ffromani ffromani deleted the run-against-snapshot-updates branch May 24, 2021 06:52
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