-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cloud Assembly Specification #956
Comments
I don't think there is a need to support synthesis of subsets of applications. I think a cloud assembly is always 1:1 with an application. Keep it simple.
I would start with "Requirements". A list of use cases and scenarios that we want to support. Perhaps even prioritized or at least define which ones are supported in the current version of the spec and which are planned to be supported, and also which use cases are "non requirements" (i.e. not covered by this standard). See #233 for list of requirements.
A few things come to mind:
|
If you consider "assets" and "stacks" to be "things" (which I read as opaque data), then how are you supposed to discover dependencies between all those? This makes a case of each of them declaring their dependencies at assembly time, and the dependencies being expressed directly in the manifest. |
Yeah I kinda intended the paths to be more akin to examples than a hard specification of what it should be like. I've changed the table heading to clear things up a bit there.
Yeah I like the idea. There is no reason why there should be a different handling there. |
Why not JSON? No human will ever need to write it by hand, so why not lowest common denominator data structure?
Why this level of indirection? Could put the handler directly on the asset type.
Need to declare the dependencies then on the Are we provisioning for negotiation between Cloud Assembly producer and consumer? I'm thinking context parameters between toolkit and CDK app. Seems to be out of scope for this document, but it's going to have to be implemented anyway. Will it be some out-of-band mechanism? Also, a method to report errors and other metadata? Will that be out-of-band with this as well? If so, it seems like this describes what the output will be if synthesis succeeds, but we also need to have a standardized method to describe failing synthesis. Now it might be called something different, but it needs to be standardized as well because multiple tools are going to have to implement it. |
Also, are handlers only called once? Or might there be multiple phases for asset handling. For example: build/package/publish/deploy? |
I like computer-generated documents to be human-readable nonetheless, as it makes it easier for people to dive deep into the document in the event they have to. I'm not willing to die on this hill, though...
Handlers may have more configuration than just the path to the command, and they could be used by multiple assets. Call me old-school but I like to avoid repeating data.
This is what
That's a good point. I need t add this.
I'm not sure I understand the need for standardization beyond "returns in error when not successful"?
That's a part I haven't gone over entirely just yet, but yes, there may be multiple phases involved, and the handlers would somehow be told which phase they're invoked for. |
Currently "missing context" is cause for a reinvocation, for example. That's not a success (yet) but also not a failure. And reporting warnings is something that we have, as are reporting errors via stack output (even though the called program does not fail) |
I guess the missing context & warnings are consequences of how one generates the Cloud Assembly, and not features of the assembly itself... |
I know. But we need a standard for those as well, and right now we have none. We might be tempted to say today: "A CDK app is a program that generates a Cloud Assembly." But if we did that'd be incomplete. Instead, we have to say something like: "A CDK app is a program that adheres to the XXX protocol." And in the XXX protocol it is written somewhere that under some conditions some output somewhere is a Cloud Assembly. But without XXX protocol being written down, how do we do that? |
I think I agree with @rix0rrr that the protocol needs to allow the app to return an error that says "missing context". |
/cc @phobologic Would be really cool if we can define a general spec here that would work for both CDK and stacker. The example manifest above looks really similar to how the internal graph is built within stacker, so going from that to a compiled "Cloud Assembly" would be relatively straight forward. |
Looking forward to supporting a more integrated deployment experience with support of multiple stacks (with deployment order constraints honored) as well as assets, this proposes a specification for a *Cloud Assembly* that determines a document storage format. Fixes: #956
I'm moving the document building to a PR (#1119), to make it easier to track the revision history of the document and to facilitate conversation & commenting inline. |
Looking forward to supporting a more integrated deployment experience with support of multiple stacks (with deployment order constraints honored) as well as assets, this proposes a specification for a *Cloud Assembly* that determines a document storage format. Fixes: #956
Looking forward to supporting a more integrated deployment experience with support of multiple stacks (with deployment order constraints honored) as well as assets, this proposes a specification for a *Cloud Assembly* that determines a document storage format. Fixes: #956
The CNAB specification provides a mechanism for bundling arbitrary provisioning logic and configuration, but does not quite specify what that logic should look like. We'd have freedom to design the orchestration in whatever way we want. An interesting work form Microsoft on that topic is deislabs/porter, which aims at providing composable CNAB bundle fragments. The elements we have to figure out is how to instrument deployments externally to the invocation image (how to pass data in/out of the CNAB, so we can for example orchestrate deployment phases using CodePipelines). |
@hjander asks:
|
@hjander we are still thinking what is the best approach. At the moment, the protocol between CDK apps and the CDK CLI is a proprietary (and ugly) protocol we call the cx-api. It will serve in the short term, but we have a desire to standardize this interface and the cloud assembly was an attempt. From our conversations with the CNAB folks, it seems like there might be an opportunity to collaborate and define a higher level standard on top of CNAB that will address the requirements of the cloud assembly. Bottom line: at the moment, we are putting this work on hold, and we will get back to it later, most probably when we do some work on the CLI to clean it up and modularize it. |
Formalize the concept of a cloud assembly to allow decoupling "synth" and "deploy". the main motivation is to allow "deploy" to run in a controlled environment without needing to execute the app for security purposes. `cdk synth` now produces a self-contained assembly in the output directory, which we call a "cloud assembly". this directory includes synthesized templates (similar to current behavior) but also a "manifest.json" file and the asset staging directories. `cdk deploy -a assembly-dir` will now skip synthesis and will directly deploy the assembly. To that end, we modified the behavior of asset staging such that all synth output always goes to the output directory, which is by default `cdk.out` (can be set with `--output`). if there's a single template, it is printed to stdout, otherwise the name of output directory is printed. This PR also includes multiple clean ups and deprecations of stale APIs and modules such as: - `cdk.AppProps` includes various new options. - An error is thrown if references between stacks that are not in the same app (mostly in test cases). - Added the token creation stack trace for errors emitted by tokens - Added `ConstructNode.root` which returns the tree root. **TESTING**: verified that all integration tests passed and added a few tests to verify zip and docker assets as well as cloud assemblies. See: https://github.com/awslabs/cdk-ops/pull/364 Closes #1893 Closes #2093 Closes #1954 Closes #2310 Related #2073 Closes #1245 Closes #341 Closes #956 Closes #233 BREAKING CHANGE: *IMPORTANT*: apps created with the CDK version 0.33.0 and above cannot be used with an older CLI version. - `--interactive` has been removed - `--numbered` has been removed - `--staging` is now a boolean flag that indicates whether assets should be copied to the `--output` directory or directly referenced (`--no-staging` is useful for e.g. local debugging with SAM CLI) - Assets (e.g. Lambda code assets) are now referenced relative to the output directory. - `SynthUtils.templateForStackName` has been removed (use `SynthUtils.synthesize(stack).template`). - `cxapi.SynthesizedStack` renamed to `cxapi.CloudFormationStackArtifact` with multiple API changes. - `cdk.App.run()` now returns a `cxapi.CloudAssembly` instead of `cdk.ISynthesisSession`. - `cdk.App.synthesizeStack` and `synthesizeStacks` has been removed. The `cxapi.CloudAssembly` object returned from `app.run()` can be used as an alternative to explore a synthesized assembly programmatically (resolves #2016). - `cdk.CfnElement.creationTimeStamp` may now return `undefined` if there is no stack trace captured. - `cdk.ISynthesizable.synthesize` now accepts a `cxapi.CloudAssemblyBuilder` instead of `ISynthesisSession`. - `cdk`: The concepts of a synthesis session and session stores have been removed (`cdk.FileSystemStore`, cdk.InMemoryStore`, `cdk.SynthesisSession`, `cdk.ISynthesisSession` and `cdk.SynthesisOptions`). - No more support for legacy manifests (`cdk.ManifestOptions` member `legacyManifest` has been removed) - All support for build/bundle manifest have been removed (`cxapi.BuildManifest`, `cxapi.BuildStep`, etc). - Multiple deprecations and breaking changes in the `cxapi` module (`cxapi.AppRuntime` has been renamed to `cxapi.RuntimeInfo`, `cxapi.SynthesizeResponse`, `cxapi.SynthesizedStack` has been removed) - The `@aws-cdk/applet-js` program is no longer available. Use [decdk](https://github.com/awslabs/aws-cdk/tree/master/packages/decdk) as an alternative.
In order to confidently design a CI/CD deployment experience that supports assets and multiple stack ordering constraints, the Cloud Assembly document format needs to be defined, at least in an initial version.
Use-cases
Remarks
build
thensynthesize
thenpackage
thendeploy
.The text was updated successfully, but these errors were encountered: