-
Notifications
You must be signed in to change notification settings - Fork 114
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
[WIP] Add fuse-manager #324
base: main
Are you sure you want to change the base?
Conversation
This pr refers to issue #318 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much for PR!
7e7a0f0
to
ccd8af2
Compare
ca6c291
to
1745155
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- What's the purpose of this? Why not just reimplement reloading config?
- s/fuse-manager/stargz-fuse-manager/
- How is the fuse-manager daemon started?
As mentioned in #318 , reloading config needs a restart of snapshotter, so we need to restart all running containers and restore stargz layers. And a separate fuse daemon will focuse on fuse goroutines so snapshotter don't need to handle their lifecycles, a config update will be done quickly.
Its startup command is like
And with option |
Needs systemd unit |
Or can we let |
It makes sense, I'll try both and make an update |
SGTM about the shim-like approach. |
6233527
to
4f1e4c6
Compare
Now Please take a look if free @AkihiroSuda @ktock |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good but some minor nits
@AkihiroSuda PTAL when you have time Before we merge this, we need to
let me turn this PR into draft until we complete them for avoiding to accidentally merge this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we have a design doc to explain why we need this?
dca6dc9
to
33eaed8
Compare
@ktock seems like these have been completed, can draft be removed? |
ddfb938
to
d52ebb4
Compare
@ilyee Could you add changes for #324 (review) ? |
sure, I'll handle it |
0cdde0e
to
87101f6
Compare
@ktock related doc is added in doc/overview.md, PTAL if free, thx |
Needs rebase |
Signed-off-by: Zuti He <ilyeeelihe@gmail.com>
@AkihiroSuda done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please see comments.
We need to think about having tests for this.
@@ -58,14 +61,19 @@ const ( | |||
defaultLogLevel = logrus.InfoLevel | |||
defaultRootDir = "/var/lib/containerd-stargz-grpc" | |||
defaultImageServiceAddress = "/run/containerd/containerd.sock" | |||
defaultFuseManagerAddress = "/run/containerd-stargz-grpc/fuse-namanger.sock" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This typo doesn't seem to be fixed (/run/containerd-stargz-grpc/fuse-manager.sock
)
} | ||
return runtime.NewImageServiceClient(conn), nil | ||
} | ||
f, _ := cri.NewCRIKeychain(ctx, connectCRI) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why CRI server is ignored here? fuse-manager should provide CRI proxy as well.
if config.restoreSnapshots { | ||
if err := o.restoreRemoteSnapshot(ctx); err != nil { | ||
return nil, errors.Wrap(err, "failed to restore remote snapshot") | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should not change the default behaviour here. Restoring should be enabled by default and disabled by an option.
ctx := context.Background() | ||
if err := o.cleanup(ctx, cleanupCommitted); err != nil { | ||
if err := o.cleanup(ctx, o.cleanupCommitted); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should not change the default behaviour here. cleanupCommitted should be enabled by default and disabled by an option.
What is fusemanager
fuse-manager
is a fuse daemon that handles all fuse processes, so fuse goroutines won't get killed when we restartstargz-snapshotter
, and runnings containers don't need to be restarted.By separating out
fuse-manager
, filesystem operations will all be handed byfuse-manager
, andstargz-snapshotter
is only responsable of snapshot operations.How to run it
fuse-manager
with optionfusestore
(address for the fusemanager's store) andsocket
(address for the fusemanager's gRPC socket)stargz-snapshotter
with optionfusemanager-address
(same withsocket
), andenable-fusemanager
with 'true' to enable itHow it works
fuse-manager
interacts withstargz-snapshotter
through gRPC, its client implementsFilesystem
interface, so can be passed tosnbase.NewSnapshotter
to create a new snapshotter instance.After running grpc server,
fuse-manager
waits forInit
method to be called. Whenstargz-snapshotter
starts(or restarts),Init
will be called to pass fs related configs tofuse-manager
, which will create a new fs instance for handling new incomingMount
/Check
/Unmount
requests.