-
-
Notifications
You must be signed in to change notification settings - Fork 107
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
Support vendor.yaml
as a new way of vendoring components, stacks or any other artifacts
#448
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…`.yaml` by default
…`.yaml` by default
nitrocode
approved these changes
Oct 25, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
osterman
approved these changes
Oct 25, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
what
vendor.yaml
as a new way of vendoring components, stacks and other artifactswhy
Atmos natively supports the concept of "vendoring", which is making copies of the 3rd party components, stacks, and other artifacts in your own repo.
The vendoring configuration is described in the
vendor.yaml
manifest, which should be placed in the directory from which theatmos vendor pull
command is executed, usually in the root of the infrastructure repo.After defining the
vendor.yaml
manifest, all the remote artifacts can be downloaded by running the following command:To vendor a particular component or other artifact, execute the following command:
Vendoring Manifest
To vendor remote artifacts, create a
vendor.yaml
file similar to the example below:The
vendor.yaml
vendoring manifest supports Kubernetes-style YAML config to describe vendoring configuration for components, stacks, and other artifacts. The file is placed into the directory from which theatmos vendor pull
command is executed (usually the root of the repo)The
sources
invendor.yaml
support all protocols (local files, Git, Mercurial, HTTP, HTTPS, Amazon S3, Google GCP), and all URL and archive formats as described in go-getter, and also theoci://
scheme to download artifacts from OCI registries.The
targets
in the sources support absolute and relative paths (relative to the directory where the command is executed)included_paths
andexcluded_paths
support POSIX-style greedy Globs for filenames/paths (double-star/globstar**
is supported as well)The
component
attribute in each source is optional. It's used in theatmos vendor pull -- component <component
command if the component is passed in. In this case, Atmos will vendor only the specified component instead of vendoring all the artifacts configured in thevendor.yaml
manifestThe
source
andtargets
attributes support Go templatesand Sprig Functions. This can be used to templatise the
source
andtargets
paths with the artifact versions specified in theversion
attributeThe
imports
section defines the additional vendoring manifests that are merged into the main manifest. Hierarchical imports are supported at many levels (one vendoring manifest can import another, which in turn can import other manifests, etc.). Atmos processes all imports and all sources in the imported manifests in the order they are definedHierarchical Imports in Vendoring Manifests
Use
imports
to split the mainvendor.yaml
manifest into smaller files for maintainability, or by their roles in the infrastructure.For example, import separate manifests for networking, security, data management, CI/CD, and other layers:
Hierarchical imports are supported at many levels. For example, consider the following vendoring configurations:
When you execute the
atmos vendor pull
command, Atmos processes the import chain and the sources in the imported manifests in the order they are defined:vendor/vendor2.yaml
andvendor/vendor3.yaml
manifests (defined in the mainvendor.yaml
file) are importedvendor/vendor2.yaml
file is processed, and thevendor/vendor4.yaml
manifest is importedvendor/vendor4.yaml
file is processed, and thevendor/vendor5.yaml
manifest is importedtargets
Vendoring from OCI Registries
Atmos supports vendoring from OCI registries.
To specify a repository in an OCI registry, use the
oci://<registry>/<repository>:tag
scheme.Artifacts from OCI repositories are downloaded as Docker image tarballs, then all the layers are processed, un-tarred and un-compressed, and the files are written into the directories specified by the
targets
attribute of eachsource
.For example, to vendor the
vpc
component from thepublic.ecr.aws/cloudposse/components/terraform/stable/aws/vpc
AWS public ECR registry, use the following
source
:The schema of a
vendor.yaml
manifest is as follows:To vendor the
vpc
component, execute the following command: