Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions pkg/snapshot/diskquota/prjquota.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@ import (
"strings"
"sync"

"github.com/sirupsen/logrus"

"github.com/containerd/containerd/v2/core/mount"
"github.com/containerd/log"
"github.com/docker/go-units"
)

Expand Down Expand Up @@ -145,7 +144,7 @@ func (quota *PrjQuotaDriver) setQuota(quotaID uint32, blockLimit uint64, mountPo
blockLimitStr := strconv.FormatUint(blockLimit, 10)

// ext4 set project quota limit
// logrus.Infof("setquota -P %s 0 %s 0 0 %s", quotaIDStr, blockLimitStr, mountPoint)
// log.L.Infof("setquota -P %s 0 %s 0 0 %s", quotaIDStr, blockLimitStr, mountPoint)
stdout, stderr, err := ExecSync("setquota", "-P", quotaIDStr, "0", blockLimitStr, "0", "0", mountPoint)
if err != nil {
return fmt.Errorf("failed to set quota, mountpoint: (%s), quota id: (%d), quota: (%d kbytes), stdout: (%s), stderr: (%s): %w",
Expand Down Expand Up @@ -203,7 +202,7 @@ func (quota *PrjQuotaDriver) GetNextQuotaID() (quotaID uint32, err error) {
if id <= QuotaMaxID {
break
}
logrus.Infof("reach the maximum, try to reuse quotaID")
log.L.Infof("reach the maximum, try to reuse quotaID")
quota.QuotaIDs, quota.LastID, err = loadQuotaIDs("-Pan")
if err != nil {
return 0, fmt.Errorf("failed to load quota list: %w", err)
Expand All @@ -227,7 +226,7 @@ func (quota *PrjQuotaDriver) SetFileAttr(dir string, quotaID uint32) error {
if err != nil {
return fmt.Errorf("failed to set file(%s) quota id(%s), stdout: (%s), stderr: (%s): %w", dir, strID, stdout, stderr, err)
}
logrus.Debugf("set quota id (%s) to file (%s) attr", strID, dir)
log.L.Debugf("set quota id (%s) to file (%s) attr", strID, dir)

return nil
}
9 changes: 4 additions & 5 deletions pkg/snapshot/overlay.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ import (
mylog "github.com/containerd/accelerated-container-image/internal/log"
"github.com/containerd/accelerated-container-image/pkg/metrics"
"github.com/data-accelerator/zdfs"
"github.com/sirupsen/logrus"

"github.com/containerd/containerd/v2/core/mount"
"github.com/containerd/containerd/v2/core/snapshots"
Expand Down Expand Up @@ -249,7 +248,7 @@ func NewSnapshotter(bootConfig *BootConfig, opts ...Opt) (snapshots.Snapshotter,
}

if bootConfig.MirrorRegistry != nil {
logrus.Infof("mirror Registry: %+v", bootConfig.MirrorRegistry)
log.L.Infof("mirror Registry: %+v", bootConfig.MirrorRegistry)
}

return &snapshotter{
Expand Down Expand Up @@ -679,7 +678,7 @@ func (o *snapshotter) Prepare(ctx context.Context, key, parent string, opts ...s
if retErr != nil {
metrics.GRPCErrCount.WithLabelValues("Prepare").Inc()
} else {
log.G(ctx).WithFields(logrus.Fields{
log.G(ctx).WithFields(log.Fields{
"d": time.Since(start),
"key": key,
"parent": parent,
Expand Down Expand Up @@ -717,7 +716,7 @@ func (o *snapshotter) Mounts(ctx context.Context, key string) (_ []mount.Mount,
if retErr != nil {
metrics.GRPCErrCount.WithLabelValues("Mounts").Inc()
} else {
log.G(ctx).WithFields(logrus.Fields{
log.G(ctx).WithFields(log.Fields{
"d": time.Since(start),
"key": key,
}).Infof("Mounts")
Expand Down Expand Up @@ -792,7 +791,7 @@ func (o *snapshotter) Commit(ctx context.Context, name, key string, opts ...snap
if retErr != nil {
metrics.GRPCErrCount.WithLabelValues("Commit").Inc()
} else {
log.G(ctx).WithFields(logrus.Fields{
log.G(ctx).WithFields(log.Fields{
"d": time.Since(start),
"name": name,
"key": key,
Expand Down
3 changes: 1 addition & 2 deletions pkg/snapshot/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ import (
"github.com/containerd/log"
"github.com/moby/sys/mountinfo"
specs "github.com/opencontainers/image-spec/specs-go/v1"
"github.com/sirupsen/logrus"
"golang.org/x/sys/unix"
)

Expand Down Expand Up @@ -135,7 +134,7 @@ func (o *snapshotter) parseAndCheckMounted(ctx context.Context, r io.Reader, mat
numFields := len(fields)
if numFields < 10 {
// should be at least 10 fields
logrus.Warnf("Parsing '%s' failed: not enough fields (%d)", text, numFields)
log.G(ctx).Warnf("Parsing '%s' failed: not enough fields (%d)", text, numFields)
continue
}

Expand Down
Loading