Skip to content

Send Progrock updates to Cloud - #5297

Merged
vito merged 24 commits into
dagger:mainfrom
vito:cloud-progrock
Jun 16, 2023
Merged

vito merged 24 commits into
dagger:mainfrom
vito:cloud-progrock

Conversation

@vito

@vito vito commented Jun 7, 2023 •

Copy link
Copy Markdown
Contributor

This is an incremental step that maintains compatibility with the Dagger Cloud API:

  • Progrock Groups are mapped to their equivalent pipeline paths.
  • Vertex <-> Group membership is handled client-side; an Op will be emitted for every the first group membership as soon as both pieces of information are known.

In the long run we might want to store groups as first-class entities in Cloud to aid with querying and knowing the actual start/end of a pipeline, but that's a bigger lift.

It also:

  • Removes all of the pre-Progrock progress infra, so we're no longer injecting pipeline paths into Buildkit ProgressGroups
  • Updates our one-off tools (cmd/{upload-journal,dagger-graph,otel-collector}) - though I fully admit I haven't tested these
  • Adds the cloud URL and engine name to the TUI

Fixes DAG-1087

@vito
vito force-pushed the cloud-progrock branch 2 times, most recently from c007389 to 00aa067 Compare June 9, 2023 20:01
@vito
vito marked this pull request as ready for review June 9, 2023 20:08
@vito
vito force-pushed the cloud-progrock branch from 00aa067 to e61f34b Compare June 9, 2023 20:51

@vito vito left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ready for review! Did a review of my own and left some comments below, hope it helps.

Comment thread core/container.go Outdated

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Marking a pipeline as "weak" allows us to differentiate these implicitly-added pipelines from explicit user-configured ones.

Comment thread core/container.go Outdated

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is handled by (core.GatewayClient).ResolveImageConfig now.

Comment thread core/container.go Outdated

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the one spot where we want to mark a Buildkit vertex as "internal." We don't need to shove the whole pipeline path in there anymore, so I swapped it out for a [internal] prefix, which gets stripped off and turned into internal: true during the Buildkit => Progrock conversion.

Comment thread core/directory.go Outdated

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't need to pass pipeline info to Buildkit anymore; group <-> vertex membership is handled by core.GatewayClient.

Comment thread core/pipeline/label.go Outdated

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This originally existed so we can detect service vertices and treat them differently, which shouldn't be needed once we convert it to the gateway. I don't think this ended up being load-bearing, so just removing it along the way.

Comment thread engine/engine.go Outdated

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has moved to telemetry.Writer.

vito added 19 commits June 15, 2023 16:39
This is an incremental step that maintains compatibility with the Dagger
Cloud API.

Groups are mapped to pipeline paths. (TODO: pipeline descriptions are
currently droped.)

Vertex <-> Group membership is handled client-side; an Op will be
emitted for every group membership.

Signed-off-by: Alex Suraci <[email protected]>
this was copy-pasta from Bass, not intended to be preserved in Dagger

Signed-off-by: Alex Suraci <[email protected]>
this is used for engine logs - need to dedupe these, or maybe use one in
the other

Signed-off-by: Alex Suraci <[email protected]>
'weak' pipelines are ones that Dagger automatically adds, or a Buildkit
frontend adds via a ProgressGroup. They are treated differently from
user-specified pipelines.

Signed-off-by: Alex Suraci <[email protected]>
Too difficult to figure out many-to-many vertex <-> groups in the
frontend. This is much simpler for now.

Signed-off-by: Alex Suraci <[email protected]>
* remove JournalWriter (unused)
* remove internal/engine/journal/ (outdated)

Signed-off-by: Alex Suraci <[email protected]>
* add telemetry.Pipeliner for tying vertices to pipeline.Paths

Signed-off-by: Alex Suraci <[email protected]>
trivial now that there's telemetry.Writer

Signed-off-by: Alex Suraci <[email protected]>
We're no longer putting this information into Buildkit, so the console
output no longer shows pipelines and such. To be clear, this format was
always a bit janky, often resulting in things like blank vertex names.
These tests can be brought back once Progrock has a proper console
output format.

Signed-off-by: Alex Suraci <[email protected]>
this was a temporary hack to show the Dagger Cloud URL in the TUI. will
figure this out in a separate PR.

Signed-off-by: Alex Suraci <[email protected]>
no need to tie this 100% to Buildkit events, in case we want to create
any other vertexes

Signed-off-by: Alex Suraci <[email protected]>
* --silent no longer configures console output format, which was frankly
  confusing. --progress has been added instead.
* removed buildkit console format; we are now 100% Progrock!
* show Cloud URL and engine name in TUI

Signed-off-by: Alex Suraci <[email protected]>
the Progrock socket should always be available, so this is pretty
pointless anyway

Signed-off-by: Alex Suraci <[email protected]>
vito added 2 commits June 15, 2023 16:39
Signed-off-by: Alex Suraci <[email protected]>
@vito
vito force-pushed the cloud-progrock branch from 89e310c to 9dfe622 Compare June 15, 2023 20:40

@sipsma sipsma left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, super minor comments/questions

Comment thread telemetry/telemetry.go Outdated
t.mu.Lock()
defer t.mu.Unlock()
if t.token != "" {
// no token; don't send telemetry

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this comment supposed to be outside this if?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed! Not sure what happened here, probably inverted the conditional or something.

Comment thread cmd/dagger/engine.go
if !silent {
if progress == "auto" && autoTTY || progress == "tty" {
if interactive {
return interactiveTUI(ctx, engineConf, fn)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we not set the EngineName and CloudURL callbacks for the interactive TUI? If so, is that just an oversight or is it because we'll need more updates to display those in the interactive tui? Not a big deal either way, just checking

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs more updates; will probably do it in another PR as this one's already grown quite a bit.

Comment thread telemetry/pipeliner.go Outdated
if group.Parent != nil {
parentPath, found := t.pipelinePaths[group.GetParent()]
if found {
path = append(path, parentPath...)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extreme nit, probably separate issue if one at all: is there harm in changing pipeline.Path to be type []*Pipeline? It just looks like we are using quadratic memory here by re-copying each parent path, which I guess could plausibly matter in extreme scenarios with many long pipelines.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done! I don't think this matters too much since it only happens when a group starts or finishes, and the largest chunk of data (Labels) is already by-reference, but it's a tiny tweak and every bit helps.

vito added 2 commits June 16, 2023 09:38
pretty tiny change that should reduce some memory pressure, since each
of these values never change. (this likely has very little actual
effect, just seems sensible.)

Signed-off-by: Alex Suraci <[email protected]>
Signed-off-by: Alex Suraci <[email protected]>
@vito
vito merged commit 7d1c04a into dagger:main Jun 16, 2023
@vito
vito deleted the cloud-progrock branch June 16, 2023 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants