From 7dd15058df9ecb8d7ab9ceea5253a766a1638285 Mon Sep 17 00:00:00 2001 From: Darcy Cleaver Date: Mon, 8 Apr 2024 11:40:32 -0600 Subject: [PATCH 1/5] initial go --- adr/0005-dev-mode.md | 45 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 adr/0005-dev-mode.md diff --git a/adr/0005-dev-mode.md b/adr/0005-dev-mode.md new file mode 100644 index 00000000..b763684b --- /dev/null +++ b/adr/0005-dev-mode.md @@ -0,0 +1,45 @@ +# 5. Dev Mode + +Date: 05 April 2024 + +## Status +In Progress + +## Context + +Zarf currently has a dev command that helps speed up the zarf package development cycle, we want to provide similar capabilities to help speed up the UDS bundle development cycle. + +The current bundle development lifecycle is: + +1. Create a local zarf package or reference a remote zarf package +2. Create a `uds-bundle.yaml` and add packages +3. Create a bundle with `uds create ` +4. Start up a cluster if one does not already exist +5. Run `uds zarf init` to initialize th cluster +6. Deploy the bundle with `uds deploy BUNDLE_TARBALL|OCI_REF]` + +Currently the [Local Artifacts](#bundle-create) option has been implemented to provide an MVP (minimal viable product). This ADR is intended to determine potential future implementation. + +## Alternatives +Regardless of implementation, the plan is to introduce `uds dev deploy` which allows you to deploy a UDS bundle in dev mode. If a **local** zarf package is missing, this command will create that zarf package for you assuming that your `zarf.yaml` file and zarf package are expected in the same directory. It will then create your bundle and deploy your zarf packages in [YOLO](https://docs.zarf.dev/docs/faq#what-is-yolo-mode-and-why-would-i-use-it) mode, eliminating the need to do a `uds zarf init`. + +### Local Artifacts + In order to maximize code reuse and leverage existing logic we will be creating local artifacts (both bundle and zarf package artifacts) in the same way that UDS bundles are currently created and deployed. This solution also minimizes the amount of code needed to process a zarf package regardless if it is a remote or local package. + + + code readibility/reuse regardless if `dev` or not and if processing local or remote packages + - less efficient + +### In Memory +The current `create` and `deploy` functionality does additional work creating local artifacts that potentially isn't necessary. We can speed up the dev cycle even more by doing the package and bundling processing in memory. Zarf currently has a `dev deploy` command that allows you to deploy zarf packages in memory in YOLO mode. This code can be leveraged, but only works for local packages. Additional work would be needed to handle remote packages. We will also need to handle the passing of variables and overrides between zarf packages within a bundle. + ++ more efficient +- more new code, less reuse between `dev` and non-dev and local and remote zarf packages. + +## Decision + + +## Consequences +Commands under `dev` are meant to be used in **development** environments, and are **not** meant to be used in **production** environments. There is still the possibility that a user will use `uds dev deploy` in a production environment, but the command name and documentation will make it clear that this is not the intended use case. + +## Related Decisions + - [Zarf `dev` command](https://github.com/defenseunicorns/zarf/blob/main/adr/0022-dev-cmd.md) From caa7565cae3a79dd633326eff3d77c5fdec0946c Mon Sep 17 00:00:00 2001 From: Darcy Cleaver Date: Mon, 8 Apr 2024 22:15:52 -0600 Subject: [PATCH 2/5] ZarfinitConfig adr update --- adr/0005-dev-mode.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adr/0005-dev-mode.md b/adr/0005-dev-mode.md index b763684b..d3e67f23 100644 --- a/adr/0005-dev-mode.md +++ b/adr/0005-dev-mode.md @@ -21,7 +21,7 @@ The current bundle development lifecycle is: Currently the [Local Artifacts](#bundle-create) option has been implemented to provide an MVP (minimal viable product). This ADR is intended to determine potential future implementation. ## Alternatives -Regardless of implementation, the plan is to introduce `uds dev deploy` which allows you to deploy a UDS bundle in dev mode. If a **local** zarf package is missing, this command will create that zarf package for you assuming that your `zarf.yaml` file and zarf package are expected in the same directory. It will then create your bundle and deploy your zarf packages in [YOLO](https://docs.zarf.dev/docs/faq#what-is-yolo-mode-and-why-would-i-use-it) mode, eliminating the need to do a `uds zarf init`. +Regardless of implementation, the plan is to introduce `uds dev deploy` which allows you to deploy a UDS bundle in dev mode. When deploying in dev mode, any `kind: ZarfInitConfig` packages in the bundle will be ignored. If a **local** zarf package is missing, this command will create that zarf package for you assuming that your `zarf.yaml` file and zarf package are expected in the same directory. It will then create your bundle and deploy your zarf packages in [YOLO](https://docs.zarf.dev/docs/faq#what-is-yolo-mode-and-why-would-i-use-it) mode, eliminating the need to do a `uds zarf init`. ### Local Artifacts In order to maximize code reuse and leverage existing logic we will be creating local artifacts (both bundle and zarf package artifacts) in the same way that UDS bundles are currently created and deployed. This solution also minimizes the amount of code needed to process a zarf package regardless if it is a remote or local package. From bcb0ab283e862c2d6053867e4f575421c3b3e9c1 Mon Sep 17 00:00:00 2001 From: Darcy Cleaver Date: Wed, 10 Apr 2024 16:59:39 -0600 Subject: [PATCH 3/5] add planned features --- adr/0005-dev-mode.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/adr/0005-dev-mode.md b/adr/0005-dev-mode.md index d3e67f23..78c2bb10 100644 --- a/adr/0005-dev-mode.md +++ b/adr/0005-dev-mode.md @@ -20,6 +20,9 @@ The current bundle development lifecycle is: Currently the [Local Artifacts](#bundle-create) option has been implemented to provide an MVP (minimal viable product). This ADR is intended to determine potential future implementation. +### Planned Features + - zarf package flavor support + ## Alternatives Regardless of implementation, the plan is to introduce `uds dev deploy` which allows you to deploy a UDS bundle in dev mode. When deploying in dev mode, any `kind: ZarfInitConfig` packages in the bundle will be ignored. If a **local** zarf package is missing, this command will create that zarf package for you assuming that your `zarf.yaml` file and zarf package are expected in the same directory. It will then create your bundle and deploy your zarf packages in [YOLO](https://docs.zarf.dev/docs/faq#what-is-yolo-mode-and-why-would-i-use-it) mode, eliminating the need to do a `uds zarf init`. @@ -29,8 +32,8 @@ Regardless of implementation, the plan is to introduce `uds dev deploy` which al + code readibility/reuse regardless if `dev` or not and if processing local or remote packages - less efficient -### In Memory -The current `create` and `deploy` functionality does additional work creating local artifacts that potentially isn't necessary. We can speed up the dev cycle even more by doing the package and bundling processing in memory. Zarf currently has a `dev deploy` command that allows you to deploy zarf packages in memory in YOLO mode. This code can be leveraged, but only works for local packages. Additional work would be needed to handle remote packages. We will also need to handle the passing of variables and overrides between zarf packages within a bundle. +### No Tarball +The current `create` and `deploy` functionality does additional work creating local artifacts and a tarball that potentially isn't necessary. We can speed up the dev cycle even more by doing the package and bundling processing without needing the intermediary bundle tarball. Zarf currently has a `dev deploy` command that allows you to deploy zarf packages in YOLO mode. This code can be leveraged, but only works for local packages. Additional work would be needed to handle remote packages. We will also need to handle the passing of variables and overrides between zarf packages within a bundle. + more efficient - more new code, less reuse between `dev` and non-dev and local and remote zarf packages. From a6f071ad1de3148ff8214b2a6c0c413bbeda92ec Mon Sep 17 00:00:00 2001 From: unclegedd Date: Thu, 11 Apr 2024 10:13:46 -0500 Subject: [PATCH 4/5] edits with Darcy --- adr/0005-dev-mode.md | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/adr/0005-dev-mode.md b/adr/0005-dev-mode.md index 78c2bb10..3a5b250d 100644 --- a/adr/0005-dev-mode.md +++ b/adr/0005-dev-mode.md @@ -20,14 +20,26 @@ The current bundle development lifecycle is: Currently the [Local Artifacts](#bundle-create) option has been implemented to provide an MVP (minimal viable product). This ADR is intended to determine potential future implementation. -### Planned Features - - zarf package flavor support -## Alternatives -Regardless of implementation, the plan is to introduce `uds dev deploy` which allows you to deploy a UDS bundle in dev mode. When deploying in dev mode, any `kind: ZarfInitConfig` packages in the bundle will be ignored. If a **local** zarf package is missing, this command will create that zarf package for you assuming that your `zarf.yaml` file and zarf package are expected in the same directory. It will then create your bundle and deploy your zarf packages in [YOLO](https://docs.zarf.dev/docs/faq#what-is-yolo-mode-and-why-would-i-use-it) mode, eliminating the need to do a `uds zarf init`. +## Dev Mode Overview +Regardless of implementation, the plan is to introduce `uds dev deploy` which allows you to deploy a UDS bundle in dev mode. Dev mode will perform the following actions: +- Create Zarf packages for all local packages in a bundle + - The Zarf tarball will be created in the same directory as the `zarf.yaml` + - Dev mode will only create the Zarf tarball if one does not already exist + - Ignore any `kind: ZarfInitConfig` packages in the bundle +- Create a bundle from the newly created Zarf packages +- Deploy the bundle in [YOLO](https://docs.zarf.dev/faq/#what-is-yolo-mode-and-why-would-i-use-it) mode, eliminating the need to do a `zarf init` + + +## Planned Features + - Add a `--ref` flag to `uds dev deploy` to enable setting the `ref` field for a package at `dev deploy` time + - Add a `--flavor` flag to `uds dev deploy` to enable setting the flavor of a ref at `dev deploy` time + +## Handling Artifacts +The following options are being considered for handling the creation of Zarf packages and bundles in dev mode: ### Local Artifacts - In order to maximize code reuse and leverage existing logic we will be creating local artifacts (both bundle and zarf package artifacts) in the same way that UDS bundles are currently created and deployed. This solution also minimizes the amount of code needed to process a zarf package regardless if it is a remote or local package. +In order to maximize code reuse and leverage existing logic we could create local artifacts (both bundle and Zarf package artifacts) in the same way that UDS bundles are currently created and deployed. This solution also minimizes the amount of code needed to process a zarf package regardless if it is a remote or local package. + code readibility/reuse regardless if `dev` or not and if processing local or remote packages - less efficient @@ -39,7 +51,7 @@ The current `create` and `deploy` functionality does additional work creating lo - more new code, less reuse between `dev` and non-dev and local and remote zarf packages. ## Decision - +TBD ## Consequences Commands under `dev` are meant to be used in **development** environments, and are **not** meant to be used in **production** environments. There is still the possibility that a user will use `uds dev deploy` in a production environment, but the command name and documentation will make it clear that this is not the intended use case. From 1a206861157579676460327ded10e44738600b36 Mon Sep 17 00:00:00 2001 From: Darcy Cleaver Date: Tue, 21 May 2024 11:46:22 -0600 Subject: [PATCH 5/5] update adr status and decision --- adr/0005-dev-mode.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/adr/0005-dev-mode.md b/adr/0005-dev-mode.md index 3a5b250d..bf740e48 100644 --- a/adr/0005-dev-mode.md +++ b/adr/0005-dev-mode.md @@ -1,9 +1,9 @@ # 5. Dev Mode -Date: 05 April 2024 +Date: 21 May 2024 ## Status -In Progress +Accepted ## Context @@ -51,7 +51,7 @@ The current `create` and `deploy` functionality does additional work creating lo - more new code, less reuse between `dev` and non-dev and local and remote zarf packages. ## Decision -TBD +By using the existing local artifacts solution, we can leverage current functionality and accelerate the development cycle. Understanding that this approach may be revisited based on future user feedback. ## Consequences Commands under `dev` are meant to be used in **development** environments, and are **not** meant to be used in **production** environments. There is still the possibility that a user will use `uds dev deploy` in a production environment, but the command name and documentation will make it clear that this is not the intended use case.