Skip to content

Commit 01d5e46

Browse files
committed
anawareness runtime prefetch
1. add prefetchlist store prefetchlist storage service. 2. Modify the optimizer to publish the access file list as a prefetchlist to the storage service when obtaining it. 3. modify http server add lru algo 4. use echo web framework 5. modify based on comments
1 parent 47d4311 commit 01d5e46

File tree

6 files changed

+347
-58
lines changed

6 files changed

+347
-58
lines changed

cmd/optimizer-nri-plugin/main.go

+129-14
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,13 @@
77
package main
88

99
import (
10+
"bytes"
1011
"context"
12+
"encoding/json"
1113
"fmt"
1214
"io"
1315
"log/syslog"
16+
"net/http"
1417
"os"
1518
"path/filepath"
1619
"strings"
@@ -38,11 +41,12 @@ const (
3841
type PluginConfig struct {
3942
Events []string `toml:"events"`
4043

41-
ServerPath string `toml:"server_path"`
42-
PersistDir string `toml:"persist_dir"`
43-
Readable bool `toml:"readable"`
44-
Timeout int `toml:"timeout"`
45-
Overwrite bool `toml:"overwrite"`
44+
ServerPath string `toml:"server_path"`
45+
PersistDir string `toml:"persist_dir"`
46+
Readable bool `toml:"readable"`
47+
Timeout int `toml:"timeout"`
48+
Overwrite bool `toml:"overwrite"`
49+
PrefetchDistributionEndpoint string `toml:"prefetch_distribution_endpoint"`
4650
}
4751

4852
type PluginArgs struct {
@@ -104,6 +108,11 @@ func buildFlags(args *PluginArgs) []cli.Flag {
104108
Usage: "whether to overwrite the existed persistent files",
105109
Destination: &args.Config.Overwrite,
106110
},
111+
&cli.StringFlag{
112+
Name: "prefetch-distribution-endpoint",
113+
Usage: "The service endpoint of prefetch distribution, for example: http://localhost:1323/api/v1/prefetch/upload",
114+
Destination: &args.Config.PrefetchDistributionEndpoint,
115+
},
107116
}
108117
}
109118

@@ -129,7 +138,8 @@ var (
129138
)
130139

131140
const (
132-
imageNameLabel = "io.kubernetes.cri.image-name"
141+
imageNameLabel = "io.kubernetes.cri.image-name"
142+
containerNameLabel = "io.kubernetes.cri.container-name"
133143
)
134144

135145
func (p *plugin) Configure(config, runtime, version string) (stub.EventMask, error) {
@@ -156,11 +166,26 @@ func (p *plugin) Configure(config, runtime, version string) (stub.EventMask, err
156166
return p.mask, nil
157167
}
158168

169+
type PrefetchFile struct {
170+
Path string
171+
}
172+
173+
type CacheItem struct {
174+
ImageName string
175+
ContainerName string
176+
PrefetchFiles []PrefetchFile
177+
}
178+
179+
type Cache struct {
180+
Items map[string]*CacheItem
181+
}
182+
159183
func (p *plugin) StartContainer(_ *api.PodSandbox, container *api.Container) error {
160-
dir, imageName, err := GetImageName(container.Annotations)
184+
dir, imageName, imageRepo, err := GetImageName(container.Annotations)
161185
if err != nil {
162186
return err
163187
}
188+
containerName := container.Annotations[containerNameLabel]
164189

165190
persistDir := filepath.Join(cfg.PersistDir, dir)
166191
if err := os.MkdirAll(persistDir, os.ModePerm); err != nil {
@@ -172,37 +197,127 @@ func (p *plugin) StartContainer(_ *api.PodSandbox, container *api.Container) err
172197
persistFile = fmt.Sprintf("%s.timeout%ds", persistFile, cfg.Timeout)
173198
}
174199

175-
fanotifyServer := fanotify.NewServer(cfg.ServerPath, container.Pid, imageName, persistFile, cfg.Readable, cfg.Overwrite, time.Duration(cfg.Timeout)*time.Second, logWriter)
200+
var hasSentPrefetchList = false
201+
202+
fanotifyServer := fanotify.NewServer(cfg.ServerPath, container.Pid, imageName, persistFile, cfg.Readable, cfg.Overwrite, time.Duration(cfg.Timeout)*time.Second, logWriter, containerName, hasSentPrefetchList)
176203

177204
if err := fanotifyServer.RunServer(); err != nil {
178205
return err
179206
}
180207

208+
go func() {
209+
time.Sleep(10 * time.Minute)
210+
fanotifyServer.Mu.Lock()
211+
if !fanotifyServer.IsSent {
212+
data, err := getPrefetchList(persistFile)
213+
if err != nil {
214+
log.WithError(err).Error("error reading file")
215+
}
216+
if err = sendToServer(imageRepo, containerName, cfg.PrefetchDistributionEndpoint, data); err != nil {
217+
log.WithError(err).Error("failed to send prefetch to http server")
218+
}
219+
fanotifyServer.IsSent = true
220+
}
221+
fanotifyServer.Mu.Unlock()
222+
}()
223+
181224
globalFanotifyServer[imageName] = fanotifyServer
182225

183226
return nil
184227
}
185228

229+
func sendToServer(imageName, containerName, serverURL string, data []byte) error {
230+
filePaths := strings.Split(string(data), "\n")
231+
232+
var prefetchFiles []PrefetchFile
233+
for _, path := range filePaths {
234+
if path != "" {
235+
prefetchFiles = append(prefetchFiles, PrefetchFile{Path: path})
236+
}
237+
}
238+
239+
item := CacheItem{
240+
ImageName: imageName,
241+
ContainerName: containerName,
242+
PrefetchFiles: prefetchFiles,
243+
}
244+
245+
err := postRequest(item, serverURL)
246+
if err != nil {
247+
return errors.Wrap(err, "error uploading to server")
248+
}
249+
250+
return nil
251+
}
252+
253+
func postRequest(item CacheItem, endpoint string) error {
254+
data, err := json.Marshal(item)
255+
if err != nil {
256+
return err
257+
}
258+
259+
resp, err := http.Post(endpoint, "application/json", bytes.NewBuffer(data))
260+
if err != nil {
261+
return err
262+
}
263+
defer resp.Body.Close()
264+
265+
if resp.StatusCode != http.StatusOK {
266+
return errors.Wrap(fmt.Errorf("server returned a non-OK status code: %d", resp.StatusCode), "HTTP Status Error")
267+
}
268+
269+
body, err := io.ReadAll(resp.Body)
270+
if err != nil {
271+
return errors.Wrap(err, "failed to read response body")
272+
}
273+
274+
log.Info("Server Response:", string(body))
275+
276+
return nil
277+
}
278+
279+
func getPrefetchList(prefetchListPath string) ([]byte, error) {
280+
data, err := os.ReadFile(prefetchListPath)
281+
if err != nil {
282+
return nil, err
283+
}
284+
return data, nil
285+
}
286+
186287
func (p *plugin) StopContainer(_ *api.PodSandbox, container *api.Container) ([]*api.ContainerUpdate, error) {
187288
var update = []*api.ContainerUpdate{}
188-
_, imageName, err := GetImageName(container.Annotations)
289+
_, imageName, imageRepo, err := GetImageName(container.Annotations)
189290
if err != nil {
190291
return update, err
191292
}
293+
192294
if fanotifyServer, ok := globalFanotifyServer[imageName]; ok {
193-
fanotifyServer.StopServer()
295+
fanotifyServer.Mu.Lock()
296+
if !fanotifyServer.IsSent {
297+
data, err := getPrefetchList(fanotifyServer.PersistFile)
298+
if err != nil {
299+
return update, err
300+
}
301+
if err = sendToServer(imageRepo, fanotifyServer.ContainerName, cfg.PrefetchDistributionEndpoint, data); err != nil {
302+
log.WithError(err).Error("failed to send prefetch to http server")
303+
}
304+
fanotifyServer.IsSent = true
305+
306+
fanotifyServer.StopServer()
307+
}
308+
fanotifyServer.Mu.Unlock()
194309
} else {
195310
return nil, errors.New("can not find fanotify server for container image " + imageName)
196311
}
197-
198312
return update, nil
199313
}
200314

201-
func GetImageName(annotations map[string]string) (string, string, error) {
315+
func GetImageName(annotations map[string]string) (string, string, string, error) {
202316
named, err := docker.ParseDockerRef(annotations[imageNameLabel])
203317
if err != nil {
204-
return "", "", err
318+
return "", "", "", err
205319
}
320+
imageRepo := docker.Named.String(named)
206321
nameTagged := named.(docker.NamedTagged)
207322
repo := docker.Path(nameTagged)
208323

@@ -211,7 +326,7 @@ func GetImageName(annotations map[string]string) (string, string, error) {
211326

212327
imageName := image + ":" + nameTagged.Tag()
213328

214-
return dir, imageName, nil
329+
return dir, imageName, imageRepo, nil
215330
}
216331

217332
func (p *plugin) onClose() {

go.mod

+15-8
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ require (
2828
github.com/hashicorp/go-retryablehttp v0.7.2
2929
github.com/imdario/mergo v0.3.13
3030
github.com/klauspost/compress v1.16.0
31+
github.com/labstack/echo/v4 v4.11.4
3132
github.com/moby/locker v1.0.1
3233
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826
3334
github.com/opencontainers/go-digest v1.0.0
@@ -38,13 +39,13 @@ require (
3839
github.com/prometheus/client_model v0.3.0
3940
github.com/rs/xid v1.4.0
4041
github.com/sirupsen/logrus v1.9.0
41-
github.com/stretchr/testify v1.8.3
42+
github.com/stretchr/testify v1.8.4
4243
github.com/urfave/cli/v2 v2.25.0
4344
go.etcd.io/bbolt v1.3.7
4445
golang.org/x/exp v0.0.0-20231006140011-7918f672742d
45-
golang.org/x/net v0.17.0
46+
golang.org/x/net v0.19.0
4647
golang.org/x/sync v0.4.0
47-
golang.org/x/sys v0.13.0
48+
golang.org/x/sys v0.15.0
4849
google.golang.org/grpc v1.59.0
4950
gopkg.in/natefinch/lumberjack.v2 v2.2.1
5051
gotest.tools v2.2.0+incompatible
@@ -55,6 +56,12 @@ require (
5556
k8s.io/utils v0.0.0-20230726121419-3b25d923346b
5657
)
5758

59+
require (
60+
github.com/labstack/gommon v0.4.2 // indirect
61+
github.com/valyala/bytebufferpool v1.0.0 // indirect
62+
github.com/valyala/fasttemplate v1.2.2 // indirect
63+
)
64+
5865
require (
5966
github.com/AdamKorcz/go-118-fuzz-build v0.0.0-20221215162035-5330a85ea652 // indirect
6067
github.com/Microsoft/go-winio v0.6.0 // indirect
@@ -112,7 +119,7 @@ require (
112119
github.com/json-iterator/go v1.1.12 // indirect
113120
github.com/mailru/easyjson v0.7.7 // indirect
114121
github.com/mattn/go-colorable v0.1.13 // indirect
115-
github.com/mattn/go-isatty v0.0.17 // indirect
122+
github.com/mattn/go-isatty v0.0.20 // indirect
116123
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
117124
github.com/miekg/pkcs11 v1.1.1 // indirect
118125
github.com/mitchellh/go-homedir v1.1.0 // indirect
@@ -137,12 +144,12 @@ require (
137144
go.opencensus.io v0.24.0 // indirect
138145
go.opentelemetry.io/otel v1.14.0 // indirect
139146
go.opentelemetry.io/otel/trace v1.14.0 // indirect
140-
golang.org/x/crypto v0.14.0 // indirect
147+
golang.org/x/crypto v0.17.0 // indirect
141148
golang.org/x/mod v0.13.0 // indirect
142149
golang.org/x/oauth2 v0.11.0 // indirect
143-
golang.org/x/term v0.13.0 // indirect
144-
golang.org/x/text v0.13.0 // indirect
145-
golang.org/x/time v0.3.0 // indirect
150+
golang.org/x/term v0.15.0 // indirect
151+
golang.org/x/text v0.14.0 // indirect
152+
golang.org/x/time v0.5.0 // indirect
146153
golang.org/x/tools v0.14.0 // indirect
147154
google.golang.org/appengine v1.6.7 // indirect
148155
google.golang.org/genproto v0.0.0-20231012201019-e917dd12ba7a // indirect

go.sum

+25-16
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,10 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
236236
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
237237
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
238238
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
239+
github.com/labstack/echo/v4 v4.11.4 h1:vDZmA+qNeh1pd/cCkEicDMrjtrnMGQ1QFI9gWN1zGq8=
240+
github.com/labstack/echo/v4 v4.11.4/go.mod h1:noh7EvLwqDsmh/X/HWKPUl1AjzJrhyptRyEbQJfxen8=
241+
github.com/labstack/gommon v0.4.2 h1:F8qTUNXgG1+6WQmqoUWnz8WiEU60mXVVw0P4ht1WRA0=
242+
github.com/labstack/gommon v0.4.2/go.mod h1:QlUFxVM+SNXhDL/Z7YhocGIBYOiwB0mXm1+1bAPHPyU=
239243
github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
240244
github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
241245
github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
@@ -244,8 +248,8 @@ github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovk
244248
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
245249
github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84=
246250
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
247-
github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng=
248-
github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
251+
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
252+
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
249253
github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo=
250254
github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4=
251255
github.com/miekg/pkcs11 v1.1.1 h1:Ugu9pdy6vAYku5DEpVWVFPYnzV+bxB+iRdbuFSu7TvU=
@@ -333,13 +337,17 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
333337
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
334338
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
335339
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
336-
github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gtY=
337-
github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
340+
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
341+
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
338342
github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww=
339343
github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
340344
github.com/urfave/cli v1.22.4/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
341345
github.com/urfave/cli/v2 v2.25.0 h1:ykdZKuQey2zq0yin/l7JOm9Mh+pg72ngYMeB0ABn6q8=
342346
github.com/urfave/cli/v2 v2.25.0/go.mod h1:GHupkWPMM0M/sj1a2b4wUrWBPzazNrIjouW6fmdJLxc=
347+
github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
348+
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
349+
github.com/valyala/fasttemplate v1.2.2 h1:lxLXG0uE3Qnshl9QyaK6XJxMXlQZELvChBOCmQD0Loo=
350+
github.com/valyala/fasttemplate v1.2.2/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ=
343351
github.com/vbatts/tar-split v0.11.2 h1:Via6XqJr0hceW4wff3QRzD5gAk/tatMw/4ZA7cTlIME=
344352
github.com/vbatts/tar-split v0.11.2/go.mod h1:vV3ZuO2yWSVsz+pfFzDG/upWH1JhjOiEaWq6kXyQ3VI=
345353
github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE=
@@ -367,8 +375,8 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk
367375
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
368376
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
369377
golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
370-
golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc=
371-
golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4=
378+
golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k=
379+
golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4=
372380
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
373381
golang.org/x/exp v0.0.0-20231006140011-7918f672742d h1:jtJma62tbqLibJ5sFQz8bKtEM8rJBtfilJ2qTU199MI=
374382
golang.org/x/exp v0.0.0-20231006140011-7918f672742d/go.mod h1:ldy0pHrwJyGW56pPQzzkH36rKxoZW1tw7ZJpeKx+hdo=
@@ -395,8 +403,8 @@ golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v
395403
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
396404
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
397405
golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
398-
golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM=
399-
golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=
406+
golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c=
407+
golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U=
400408
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
401409
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
402410
golang.org/x/oauth2 v0.11.0 h1:vPL4xzxBM4niKCW6g9whtaWVXTJf1U5e4aZxxFx/gbU=
@@ -432,20 +440,21 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc
432440
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
433441
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
434442
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
435-
golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE=
436-
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
443+
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
444+
golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc=
445+
golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
437446
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
438-
golang.org/x/term v0.13.0 h1:bb+I9cTfFazGW51MZqBVmZy7+JEJMouUHTUSKVQLBek=
439-
golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U=
447+
golang.org/x/term v0.15.0 h1:y/Oo/a/q3IXu26lQgl04j/gjuBDOBlx7X6Om1j2CPW4=
448+
golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0=
440449
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
441450
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
442451
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
443452
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
444453
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
445-
golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k=
446-
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
447-
golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4=
448-
golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
454+
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
455+
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
456+
golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk=
457+
golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
449458
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
450459
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
451460
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=

misc/example/optimizer-nri-plugin.conf

+3-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@ timeout = 0
1010
overwrite = false
1111
# The events that containerd subscribes to.
1212
# Do not change this element.
13-
events = [ "StartContainer", "StopContainer" ]
13+
events = [ "StartContainer", "StopContainer" ]
14+
# The service endpoint of prefetch distribution.
15+
prefetch_distribution_endpoint = "http://localhost:1323/api/v1/prefetch/upload"

0 commit comments

Comments
 (0)