Skip to content

Commit

Permalink
DEVPROD-60: Create new log fetching CLI command (#8004)
Browse files Browse the repository at this point in the history
  • Loading branch information
julianedwards committed Jun 20, 2024
1 parent f6bafce commit ba5bc66
Show file tree
Hide file tree
Showing 11 changed files with 417 additions and 210 deletions.
2 changes: 1 addition & 1 deletion cmd/evergreen/evergreen.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func buildApp() *cli.App {
operations.Host(),
operations.Volume(),
operations.Notification(),
operations.Buildlogger(),
operations.Task(),

// Top-level commands.
operations.Keys(),
Expand Down
2 changes: 1 addition & 1 deletion config.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ var (

// ClientVersion is the commandline version string used to control updating
// the CLI. The format is the calendar date (YYYY-MM-DD).
ClientVersion = "2024-06-18"
ClientVersion = "2024-06-18-a"

// Agent version to control agent rollover. The format is the calendar date
// (YYYY-MM-DD).
Expand Down
24 changes: 8 additions & 16 deletions docs/CLI.md
Original file line number Diff line number Diff line change
Expand Up @@ -376,27 +376,19 @@ evergreen last-green -p mci -v ubuntu
```
#### Buildlogger Fetch
#### Tasks
The command `evergeen task` contains subcommands for interacting with task run data, including task output (build) data.
The command `evergreen buildlogger fetch` downloads logs from cedar buildlogger.
To use it, specify the task id and execution from which you would like to download logs.
To download all logs of a task (including test logs):
```
evergreen buildlogger fetch --task_id <task_id> --execution <execution>
```
# Fetch task logs
evergreen task build TaskLogs --task_id <task_id> --execution <execution> --type <task_log_type>
To download task level logs:
```
evergreen buildlogger fetch --task_id <task_id> --execution <execution> --tags agent_log,task_log,system_log
# Fetch test logs
evergreen task build TestLogs --task_id <task_id> --execution <execution> --log_path <test_log_path>
```
You may request any combination of agent, task, or system logs by setting the corresponding names in `--tags`. They must be comma-separated if requesting more than one.
To download test logs:
```
evergreen buildlogger fetch --task_id <task_id> --execution <execution> --test_name <test_name>
```
Please note that test logs may not be in cedar buildlogger yet for some projects.
#### Commit Queue
The command `evergreen commit-queue` contains subcommands for interacting with the commit queue. See [Commit Queue](Project-Configuration/Commit-Queue).
### Server Side (for Evergreen admins)
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ require (
github.com/evergreen-ci/poplar v0.0.0-20240509153623-2de75d6eb493
github.com/evergreen-ci/shrub v0.0.0-20231121224157-600e066f9de6
github.com/evergreen-ci/timber v0.0.0-20240509150854-9d66df03b40e
github.com/evergreen-ci/utility v0.0.0-20240223193433-e2121cffbdfa
github.com/evergreen-ci/utility v0.0.0-20240617170504-722123d27649
github.com/golang-jwt/jwt v3.2.2+incompatible
github.com/google/go-github/v52 v52.0.0
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,8 @@ github.com/evergreen-ci/timber v0.0.0-20240509150854-9d66df03b40e/go.mod h1:dOoy
github.com/evergreen-ci/utility v0.0.0-20211026201827-97b21fa2660a/go.mod h1:fuEDytmDhOv+UCUwRPG/qD7mjVkUgx37KEv+thUgHVk=
github.com/evergreen-ci/utility v0.0.0-20220404192535-d16eb64796e6/go.mod h1:wSui4nRyDZzm2db7Ju7ZzBAelLyVLmcTPJEIh1IdSrc=
github.com/evergreen-ci/utility v0.0.0-20230104160902-3f0e05a638bd/go.mod h1:vkCEVgfCMIDajzbG/PHZURszI2Y1SuFqNWX9EUxmLLI=
github.com/evergreen-ci/utility v0.0.0-20240223193433-e2121cffbdfa h1:L/ABpQOmF8dIam4KpTjUnxBctxsZCAf+rU3EDyqZPrQ=
github.com/evergreen-ci/utility v0.0.0-20240223193433-e2121cffbdfa/go.mod h1:/9mHqlcrKHRtK2qah6a+/r6xkDpNuOaAJyxNYNgmK6A=
github.com/evergreen-ci/utility v0.0.0-20240617170504-722123d27649 h1:5aDO/hC3payCRUjzyrUCZNRPuqTQDupASt5b49YmkEo=
github.com/evergreen-ci/utility v0.0.0-20240617170504-722123d27649/go.mod h1:SHfOAE51SKTA4NLJFvm046A4CNLDr0gfRTQoTM5l1Zc=
github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo=
github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M=
github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg=
Expand Down
4 changes: 2 additions & 2 deletions model/log/chunk_iterator.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ func (it *chunkIterator) Next() bool {
}
it.lineCount++

if it.opts.end != nil && item.Timestamp > *it.opts.end {
if it.opts.end != nil && item.Timestamp > utility.FromInt64Ptr(it.opts.end) {
it.exhausted = true
return false
}
Expand Down Expand Up @@ -174,7 +174,7 @@ func (it *chunkIterator) Close() error {
func filterChunksByTimeRange(chunks []chunkInfo, start, end *int64) []chunkInfo {
var filteredChunks []chunkInfo
for i := 0; i < len(chunks); i++ {
if (end != nil && *end < chunks[i].start) || utility.FromInt64Ptr(start) > chunks[i].end {
if (end != nil && utility.FromInt64Ptr(end) < chunks[i].start) || utility.FromInt64Ptr(start) > chunks[i].end {
continue
}
filteredChunks = append(filteredChunks, chunks[i])
Expand Down
179 changes: 0 additions & 179 deletions operations/buildlogger.go

This file was deleted.

Loading

0 comments on commit ba5bc66

Please sign in to comment.