Commit Graph

1288 Commits

Author SHA1 Message Date
Iceber Gu
a2df12d1a3 fix ctr tasks kill does not remove cni network under windows
Signed-off-by: Iceber Gu <wei.cai-nat@daocloud.io>
2022-12-23 14:51:49 +08:00
Fu Wei
12f30e6524
Merge pull request #7792 from mxpv/sb-shutdown 2022-12-15 13:37:35 +08:00
Maksym Pavlenko
a4d5c3e5cb Support sandboxed shims shutdown
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2022-12-14 18:22:52 -08:00
Phil Estes
133ddce7cf
Merge pull request #7651 from AkihiroSuda/custom-image-createdat
images: support specifying SourceDateEpoch via ctx
2022-12-12 12:59:38 -05:00
calvin0327
f219f7d1ea fix sdNotify func when debug level
Signed-off-by: wen chen <wen.chen@daocloud.io>
2022-12-12 10:06:35 +08:00
Akihiro Suda
dc48349248
epoch: propagate SOURCE_DATE_EPOCH via ctx
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2022-12-12 09:02:35 +09:00
Phil Estes
a7428f4473
Merge pull request #7732 from AkihiroSuda/sha256-simd
digest: use github.com/minio/sha256-simd
2022-12-09 09:37:37 -05:00
Maksym Pavlenko
e14753fc54 Respect no_cri constraint
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2022-12-08 09:36:23 -08:00
Maksym Pavlenko
3bc8fc4d30 Cleanup build constraints
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2022-12-08 09:36:20 -08:00
Maksym Pavlenko
c040f83825 Fix default config for Darwin
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2022-12-08 07:49:14 -08:00
Akihiro Suda
cde9490779
digest: use github.com/minio/sha256-simd
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2022-12-08 18:50:00 +09:00
Akihiro Suda
698622b89a
Merge pull request #7673 from turan18/ctr-restore
Refactor ctr restore to allow for tty allocation
2022-12-06 17:55:19 +09:00
yanggang
b0dd506553
fix panic when containerd-stress density --count 0
Signed-off-by: yanggang <gang.yang@daocloud.io>
2022-12-03 09:25:51 +08:00
Derek McGowan
42eedc0bc7
Update ctr to make local the default for distribution
Disable using transfer service by default for now

Signed-off-by: Derek McGowan <derek@mcg.dev>
2022-11-30 12:56:57 -08:00
Derek McGowan
ef61e13a6e
Update import cli to use transfer service
Signed-off-by: Derek McGowan <derek@mcg.dev>
2022-11-30 12:56:56 -08:00
Derek McGowan
b991c71e90
Update pull command to use filter arguments
Signed-off-by: Derek McGowan <derek@mcg.dev>
2022-11-30 12:56:56 -08:00
Derek McGowan
0aca4bb1f2
Update ctr commands to use transfer interface
Signed-off-by: Derek McGowan <derek@mcg.dev>
2022-11-30 12:56:54 -08:00
Derek McGowan
e506cd103f
Implement client interface for transfer service
Signed-off-by: Derek McGowan <derek@mcg.dev>
2022-11-30 12:56:53 -08:00
Derek McGowan
6f64cb8598
Transfer interface and plugin work in progress
Signed-off-by: Derek McGowan <derek@mcg.dev>

Transfer service implementation

Signed-off-by: Derek McGowan <derek@mcg.dev>
2022-11-30 12:56:50 -08:00
Derek McGowan
dcf5687cab
Add streaming service
Adds a service capable of streaming Any objects bi-directionally.
This can be used by services to send data, received data, or to
initiate requests from server to client.

Signed-off-by: Derek McGowan <derek@mcg.dev>
2022-11-30 12:55:56 -08:00
Derek McGowan
c469f67a2b
Merge pull request #6019 from klihub/pr/proto/nri
NRI: add support for NRI with extended scope.
2022-11-30 10:42:17 -08:00
Derek McGowan
763d4e1261
Merge pull request #7730 from djdongjin/ctr-prune
Add ctr image prune command
2022-11-29 15:39:42 -08:00
Derek McGowan
6f7ed272e8
Merge pull request #7694 from AkihiroSuda/introspection-pid
introspection: expose the daemon's PID and PIDNS
2022-11-29 11:41:14 -08:00
Jin Dong
8e0a3c51a5 Add ctr image prune
Signed-off-by: Jin Dong <jindon@amazon.com>
2022-11-29 18:11:34 +00:00
Krisztian Litkey
43704ca888 nri: add experimental NRI plugin.
Add a common NRI 'service' plugin. It takes care of relaying
requests and respones to and from NRI (external NRI plugins)
and the high-level containerd namespace-independent logic of
applying NRI container adjustments and updates to actual CRI
and other containers.

The namespace-dependent details of the necessary container
manipulation operations are to be implemented by namespace-
specific adaptations. This NRI plugin defines the API which
such adaptations need to implement.

Signed-off-by: Krisztian Litkey <krisztian.litkey@intel.com>
2022-11-28 21:51:06 +02:00
Fu Wei
24020812bb
Merge pull request #7669 from yanggangtony/status-clean
make status more readable and update easy.
2022-11-27 23:12:23 +08:00
Akihiro Suda
661aaae3bb
introspection: expose the daemon's PID and PIDNS
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2022-11-18 17:14:26 +09:00
Derek McGowan
223f67ccdb
Merge pull request #7601 from kzys/cgroups-upgrade
Upgrade github.com/containerd/cgroups from v1 to v3
2022-11-17 21:55:03 -08:00
Yasin Turan
5d0457df90 Refactored ctr to allow for tty allocation when container has {terminal:true} within Spec
Signed-off-by: Yasin Turan <turyasin@amazon.com>
2022-11-16 21:15:03 +00:00
Phil Estes
344da9edb2
Merge pull request #7670 from yanggangtony/fix-desc-for-containerd
complement sub-command note for containerd-main
2022-11-16 10:16:56 -05:00
yanggang
405024db0a
complement sub-command note for containerd-main
Signed-off-by: yanggang <gang.yang@daocloud.io>
2022-11-15 17:04:02 +08:00
yanggang
e38e2c8a4d
make status more readable and update easy.
Signed-off-by: yanggang <gang.yang@daocloud.io>
2022-11-15 15:48:01 +08:00
yanggang
3abcfb5c07
keep the lower case letter for flag info
Signed-off-by: yanggang <gang.yang@daocloud.io>
2022-11-15 14:09:55 +08:00
Kazuyoshi Kato
8bb5999738 Remove the outdated comment
While containerd/cgroups is only for Linux, the metrics subcommand works
on Windows.

Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2022-11-14 21:07:48 +00:00
Kazuyoshi Kato
dd86128e0d Convert hcsshim's stats to cgroups' stats
Since hcsshim still uses containerd/cgroups 1.x which uses
gogo/protobuf.

Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2022-11-14 21:07:48 +00:00
Fu Wei
9fffa8c712
Merge pull request #7629 from wzshiming/feat/pprof-debug
Add `--debug` args to all subcommands of `ctr pprof`
2022-11-11 11:47:57 +08:00
Shiming Zhang
91e295d766 Add --debug args
Signed-off-by: Shiming Zhang <wzshiming@foxmail.com>
2022-11-09 17:43:53 +08:00
Sebastiaan van Stijn
eaedadbed0
replace strings.Split(N) for strings.Cut() or alternatives
Go 1.18 and up now provides a strings.Cut() which is better suited for
splitting key/value pairs (and similar constructs), and performs better:

```go
func BenchmarkSplit(b *testing.B) {
        b.ReportAllocs()
        data := []string{"12hello=world", "12hello=", "12=hello", "12hello"}
        for i := 0; i < b.N; i++ {
                for _, s := range data {
                        _ = strings.SplitN(s, "=", 2)[0]
                }
        }
}

func BenchmarkCut(b *testing.B) {
        b.ReportAllocs()
        data := []string{"12hello=world", "12hello=", "12=hello", "12hello"}
        for i := 0; i < b.N; i++ {
                for _, s := range data {
                        _, _, _ = strings.Cut(s, "=")
                }
        }
}
```

    BenchmarkSplit
    BenchmarkSplit-10            8244206               128.0 ns/op           128 B/op          4 allocs/op
    BenchmarkCut
    BenchmarkCut-10             54411998                21.80 ns/op            0 B/op          0 allocs/op

While looking at occurrences of `strings.Split()`, I also updated some for alternatives,
or added some constraints; for cases where an specific number of items is expected, I used `strings.SplitN()`
with a suitable limit. This prevents (theoretical) unlimited splits.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-11-07 10:02:25 +01:00
Akihiro Suda
11a06c1a3d
ctr: add ctr content fetch-blob
e.g., `ctr content fetch-blob docker.io/library/debian:latest sha256:43d28810c1b4c28a1be3bac8e0e40fcc472b2bfcfcda952544ed99cb874d2b1a`

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2022-11-04 11:41:11 +09:00
Derek McGowan
49f96d8f7d
Merge pull request #7615 from turan18/export-bug
ctr export strictly matching
2022-11-02 14:36:56 -07:00
Maksym Pavlenko
9c2a634408 Fix ctr crash when pulling with http-trace and http-dump
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2022-11-01 16:28:39 -07:00
Yasin Turan
78ac0046a7 ctr export strictly match default platform
Signed-off-by: Yasin Turan <turyasin@amazon.com>
2022-11-01 17:35:30 +00:00
Mike Brown
3ce301ddee
Merge pull request #7349 from thaJeztah/gofmt_119
clean-up "nolint" comments, remove unused ones, update golangci-lint
2022-10-17 10:50:24 -05:00
Samuel Karp
6333c751ce
Merge pull request #7519 from Iceber/fix_flags 2022-10-13 11:21:17 -07:00
Iceber Gu
48daccb4dd fix the --no-pivot flag being ignored by ctr tasks start
Signed-off-by: Iceber Gu <wei.cai-nat@daocloud.io>
2022-10-13 11:50:26 +08:00
Sebastiaan van Stijn
752bff981a
cmd/containerd: use golang.org/x/sys/windows.SetStdHandle()
golang.org/x/sys/windows now implements this, so we can use that
instead of a local implementation.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-10-12 19:33:34 +02:00
Sebastiaan van Stijn
3ebeb6d79b
linting: address gosec G112/G114
GOGC=75 golangci-lint run
    services/server/server.go:320:27: G114: Use of net/http serve function that has no support for setting timeouts (gosec)
        return trapClosedConnErr(http.Serve(l, m))
                                 ^
    services/server/server.go:340:27: G114: Use of net/http serve function that has no support for setting timeouts (gosec)
        return trapClosedConnErr(http.Serve(l, m))
                                 ^
    cmd/containerd-stress/main.go:238:13: G114: Use of net/http serve function that has no support for setting timeouts (gosec)
            if err := http.ListenAndServe(c.Metrics, metrics.Handler()); err != nil {
                      ^

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-10-12 14:40:11 +02:00
Sebastiaan van Stijn
634bf0dd31
cmd/containerd: use golang.org/x/sys Service.SetRecoveryActions()
This is the equivalent of the local implementation.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-10-12 09:43:10 +02:00
Phil Estes
32aa33a9f4
Merge pull request #7497 from thaJeztah/replace_IsAnInteractiveSession
cmd/containerd: replace deprecated windows.IsAnInteractiveSession()
2022-10-11 13:17:48 -07:00
Phil Estes
cef99bea26
Merge pull request #7478 from AkihiroSuda/archive-whiteout-source-date-epoch
archive: add WithSourceDateEpoch() for whiteouts
2022-10-10 15:45:25 -07:00