Skip to content

Commit

Permalink
feat: remove logs on enclave rm and clean -a (#1489)
Browse files Browse the repository at this point in the history
## Description:
Addresses #1394 and
#1459 by removing an
enclaves logs on `kurtosis enclave rm ...` and removing all logs on
`kurtosis clean -a`

## Is this change user facing?
YES

## References:
#1394
#1459
  • Loading branch information
tedim52 committed Oct 7, 2023
1 parent 57da901 commit 9ea344e
Show file tree
Hide file tree
Showing 14 changed files with 447 additions and 302 deletions.
4 changes: 2 additions & 2 deletions cli/cli/commands/clean/clean.go
Expand Up @@ -195,6 +195,6 @@ func formattedUuidAndName(enclaveUuidWithName *kurtosis_engine_rpc_api_bindings.
}

func cleanUnusedImages(ctx context.Context, kurtosisBackend backend_interface.KurtosisBackend, shouldCleanAll bool) ([]string, []error, error) {
cleanedImages, cleanError := kurtosisBackend.PruneUnusedImages(ctx)
return cleanedImages, nil, cleanError
cleanedImages, cleanErr := kurtosisBackend.PruneUnusedImages(ctx)
return cleanedImages, nil, cleanErr
}
Expand Up @@ -15,10 +15,6 @@ import (
"github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_interface/objects/port_spec"
"github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/uuid_generator"
"github.com/kurtosis-tech/kurtosis/engine/launcher/args"
"github.com/kurtosis-tech/kurtosis/engine/server/engine/centralized_logs/client_implementations/persistent_volume/log_remover"
"github.com/kurtosis-tech/kurtosis/engine/server/engine/centralized_logs/client_implementations/persistent_volume/logs_clock"
"github.com/kurtosis-tech/kurtosis/engine/server/engine/centralized_logs/client_implementations/persistent_volume/volume_consts"
"github.com/kurtosis-tech/kurtosis/engine/server/engine/centralized_logs/client_implementations/persistent_volume/volume_filesystem"
"github.com/kurtosis-tech/stacktrace"
"github.com/sirupsen/logrus"
"time"
Expand Down Expand Up @@ -111,20 +107,6 @@ func CreateEngine(
removeLogsAggregatorFunc()
}
}()

// schedule log removal for log retention
go func() {
osFs := volume_filesystem.NewOsVolumeFilesystem()
realTime := logs_clock.NewRealClock()
logRemover := log_remover.NewLogRemover(osFs, realTime)
// do a first removal
logRemover.Run()

logRemovalTicker := time.NewTicker(volume_consts.RemoveLogsWaitHours)
for range logRemovalTicker.C {
logRemover.Run()
}
}()
logrus.Infof("Centralized logs components started.")

enclaveManagerUIPortSpec, err := port_spec.NewPortSpec(uint16(enclaveManagerUIPort), consts.EngineTransportProtocol, consts.HttpApplicationProtocol, defaultWait)
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

This file was deleted.

0 comments on commit 9ea344e

Please sign in to comment.