microsoft / microsoft/aspire

How to break up aspire deploy into multiple CI/CD pipelines

Open
#14,830 1 comment 0 reactions 0 assignees View on GitHub
area-deployment
Dominant language
C#
Stars
6.3k
Forks
991
Avg merge
2d 15h
Merged PRs (30d)
196

Description

In some organizations, the ability to "build" your application in one pipeline (optionally "sign" the outputs) and upload the artifacts to an artifact store, then in a separate pipeline (maybe one that is more locked down and doesn't have access to source control or internet services) deploy the artifacts from the store.

This supports governance features in CI/CD pipelines.

To accomplish this today is hard with `aspire do/deploy`. The biggest issue is that when you want to run a step later in the pipeline, it will ensure all the dependent steps before it run. When you've already run the "build" step in a separate pipeline, you don't want the "build" step to run again. You just want the deploy to take the already built artifacts and deploy them.

We should come up with a strategy for how to do this.

One idea is to maintain a "state" file of which steps have already executed. For example, we store that "build" has already been executed. Then, when uploading the build artifacts, you also include the "state" file. And then on the next pipeline, along with downloading the build artifacts, you download the "state" file. `aspire do/deploy` will read that state file and see that "build" has already completed, so it gets skipped and moves to the next step. This way the build artifacts are used and not reproduced.

Another thought is to rely on inputs/outputs like MSBuild does. However, this will be hard because some outputs aren't local (like if an image has been pushed to a container registry) and some steps don't work incrementally - ex. [Draft of incremental container generation (dotnet/sdk#49556)](https://github.com/dotnet/sdk/pull/49556)

cc @mitchdenny @davidfowl

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.