Skip to content

Commit

Permalink
Merge pull request #24 from changweige/make-install
Browse files Browse the repository at this point in the history
Provide make install to facilitate configuring nydus-snapshotter
  • Loading branch information
changweige authored Feb 14, 2022
2 parents 38b23bc + 72719d9 commit cc06993
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 3 deletions.
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ clear:
rm -f bin/*
rm -rf _out


.PHONY: install
install: static-release
sudo install -D -m 755 bin/containerd-nydus-grpc /usr/local/bin/containerd-nydus-grpc
sudo install -D -m 755 misc/snapshotter/nydusd-config.json /etc/nydus/config.json
sudo install -D -m 644 misc/snapshotter/nydus-snapshotter.service /etc/systemd/system/nydus-snapshotter.service
sudo systemctl enable /etc/systemd/system/nydus-snapshotter.service

.PHONY: vet
vet:
go vet $(PACKAGES)
Expand Down
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,14 @@ Please follow instructions to [configure nydus](./docs/configure_nydus.md) confi

Nydus-snapshotter is implemented as a [proxy plugin](https://github.com/containerd/containerd/blob/04985039cede6aafbb7dfb3206c9c4d04e2f924d/PLUGINS.md#proxy-plugins) (`containerd-nydus-grpc`) for containerd.

A example of starting nydus-snapshotter:
Assume your server systemd based, install nydus-snapshotter:
Note: `nydusd` and `nydus-image` should be found from $PATH.
```bash
make install
systemctl restart containerd
```

Or you can start nydus-snapshotter manually.
```bash
# `nydusd-path` is the path to nydusd binary
# `address` is the domain socket that you configured in containerd configuration file
Expand All @@ -62,7 +68,7 @@ $ ./containerd-nydus-grpc \
--log-level info \
--root /var/lib/containerd/io.containerd.snapshotter.v1.nydus \
--cache-dir /var/lib/nydus/cache \
--address /run/containerd/containerd-nydus-grpc.sock \
--address /run/containerd-nydus/containerd-nydus-grpc.sock \
--nydusd-path /usr/local/bin/nydusd \
--nydusimg-path /usr/local/bin/nydus-image \
--log-to-stdout
Expand Down
2 changes: 1 addition & 1 deletion cmd/containerd-nydus-grpc/pkg/command/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
)

const (
defaultAddress = "/run/containerd-nydus-grpc/containerd-nydus-grpc.sock"
defaultAddress = "/run/containerd-nydus/containerd-nydus-grpc.sock"
defaultLogLevel = logrus.InfoLevel
defaultRootDir = "/var/lib/containerd-nydus-grpc"
defaultGCPeriod = "24h"
Expand Down
14 changes: 14 additions & 0 deletions misc/snapshotter/nydus-snapshotter.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[Unit]
Description=nydus snapshotter
After=network.target
Before=containerd.service

[Service]
Type=simple
Environment=HOME=/root
ExecStart=/usr/local/bin/containerd-nydus-grpc --config-path /etc/nydus/config.json
Restart=always
RestartSec=1

[Install]
WantedBy=multi-user.target

0 comments on commit cc06993

Please sign in to comment.