Skip to content

Support for partially running a DAG#1302

Merged
aluzzardi merged 1 commit intodagger:mainfrom
aluzzardi:up-target
Jan 14, 2022
Merged

Support for partially running a DAG#1302
aluzzardi merged 1 commit intodagger:mainfrom
aluzzardi:up-target

Conversation

@aluzzardi
Copy link
Copy Markdown
Contributor

Based of @samalba's proposal for CI #1230

  • This adds a -t / --target (placeholder name) flag to dagger up
  • Only that part of the DAG will execute
  • All the necessary dependencies will be executed as well

Example:

engine.#Plan & {
	actions: {
		image: engine.#Pull & {
			source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
		}

		exec: engine.#Exec & {
			input: image.output
			args: ["sh", "-c", "echo -n hello world > /output.txt"]
		}
	}
}
  • dagger up -t actions.image will only run actions.image
  • dagger up -t actions.exec will run actions.image and then actions.exec (because actions.image is necessary to run actions.exec)

@samalba
Copy link
Copy Markdown
Contributor

samalba commented Dec 23, 2021

+1 on merging this. It solves the number one blocker of the CI spec: #1230

@jlongtine
Copy link
Copy Markdown
Contributor

I like the simplicity of this. Do we need some tests to verify the behavior?

@shykes
Copy link
Copy Markdown
Contributor

shykes commented Jan 11, 2022

See #1396 . This is only part of the solution. It’s very important that before merging, we get on the same page on when to use this feature and when not to use it.

Copy link
Copy Markdown
Contributor

@shykes shykes left a comment

Choose a reason for hiding this comment

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

See #1396 . I agree with this feature BUT only for troubleshooting purposes (same as terraform apply —target). It’s very important that we get on the same page before merging, on when to use this feature and when not to use it.

@aluzzardi aluzzardi changed the title [FOR DISCUSSION] Support for partially running a DAG Support for partially running a DAG Jan 13, 2022
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.

Could you add “(for debugging only)” to the end of that description please? So that we have at least one small trace of the usage pattern we recommend.

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.

Otherwise I’ll do it as a follow-up PR, that’s fine too. I don’t want to hold up merging.

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

@aluzzardi aluzzardi merged commit 971346c into dagger:main Jan 14, 2022
@aluzzardi aluzzardi deleted the up-target branch January 14, 2022 07:58
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.

4 participants