Skip to content

Commit

Permalink
Merge branch 'bb-merge-values' of github.com:defenseunicorns/zarf int…
Browse files Browse the repository at this point in the history
…o bb-merge-values
  • Loading branch information
Tom Runyon committed Mar 27, 2023
2 parents 0910f0e + 343563b commit 030eb91
Show file tree
Hide file tree
Showing 12 changed files with 128 additions and 45 deletions.
6 changes: 3 additions & 3 deletions CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

# Docs & examples
/adr/ @jeff-mccoy @YrrepNoj @Racer159
/docs/ @Madeline-UX @JasonvanBrackel @RothAndrew @jeff-mccoy @YrrepNoj @Racer159 @wirewc
/examples/ @JasonvanBrackel @RothAndrew @jeff-mccoy @YrrepNoj @Racer159 @wirewc
*.md @Madeline-UX @JasonvanBrackel @RothAndrew @jeff-mccoy @YrrepNoj @Racer159 @wirewc
/docs/ @Madeline-UX @JasonvanBrackel @jeff-mccoy @YrrepNoj @Racer159 @wirewc
/examples/ @JasonvanBrackel @jeff-mccoy @YrrepNoj @Racer159 @wirewc
*.md @Madeline-UX @JasonvanBrackel @jeff-mccoy @YrrepNoj @Racer159 @wirewc

# Core code
/src/ @jeff-mccoy @YrrepNoj @Racer159
Expand Down
6 changes: 6 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ You can learn more about the testing of Zarf [here](docs/6-developer-guide/2-tes

## Documentation

### Updating Our Documentation

Our documentation is auto-generated from the `src/types` and `src/cmd` go packages. This includes the [Zarf package jsonschema](https://github.com/defenseunicorns/zarf/blob/main/zarf.schema.json), the [Zarf schema docs](https://docs.zarf.dev/docs/user-guide/zarf-schema), the [Zarf CLI docs](https://docs.zarf.dev/docs/user-guide/the-zarf-cli/), and our [front-end API types](https://github.com/defenseunicorns/zarf/blob/main/src/ui/lib/api-types.ts). When an update to types or the CLI commands is made you will need to run `make docs-and-schema` locally to regenerate the schema and documentation. CI checks if this was ran, and will fail if it wasn't.

We do this so that there is a git commit signature from a person on the commit for better traceability, rather than a non-person entity (e.g. GitHub CI token).

### Architecture Decision Records (ADR)

We've chosen to use ADRs to document architecturally significant decisions. We primarily use the guidance found in [this article by Michael Nygard](http://thinkrelevance.com/blog/2011/11/15/documenting-architecture-decisions) with a couple of tweaks:
Expand Down
14 changes: 7 additions & 7 deletions docs/1-understand-the-basics.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Understand The Basics
# Understand the Basics

Before you can effectively use Zarf, it is useful to have an understanding of the technology Zarf is built on and around. The sections below provide some helpful links to start building up this foundation as well as a glossary of the terms used in this project.

Expand All @@ -18,7 +18,7 @@ Before you can effectively use Zarf, it is useful to have an understanding of th
- [What is AirGap](https://ibm.github.io/kubernetes-networking/vpc/airgap/)
- AirGap Kubernetes Course - Coming Soon!

## GitOps Basics
### GitOps Basics

- [CloudBees GitOps Definition](https://www.cloudbees.com/gitops/what-is-gitops)
- [Understanding Git](https://hackernoon.com/understanding-git-fcffd87c15a3)
Expand All @@ -31,9 +31,9 @@ Before you can effectively use Zarf, it is useful to have an understanding of th

## Terms Used

- **Declarative**: A user states (via configuration file) which resources are needed and Zarf locates & packages them. A user does not have to know _how_ to download, collect, roll, and unroll dependencies for transport, they only have to know _what_ they need.
- **Package**: A well-defined, tool-generated, versioned, and compressed collection of software intended for movement (and later use) across a network / administrative boundary.
- **Remote systems**: Systems that are organized such that development & maintenance actions occur _primarily_ in locations physically & logically separate from where operations occur.
- **Constrained systems**: Systems with explicit resource / administrative / capability limitations.
- **Declarative**: A user states (via configuration file) which resources are needed and Zarf locates and packages them. A user does not have to know _how_ to download, collect, roll, and unroll dependencies for transport, they only have to know _what_ they need.
- **Package**: A well-defined, tool-generated, versioned, and compressed collection of software intended for movement (and later use) across a network/administrative boundary.
- **Remote systems**: Systems that are organized such that development and maintenance actions occur _primarily_ in locations physically and logically separate from where operations occur.
- **Constrained systems**: Systems with explicit resource/administrative/capability limitations.
- **Independent systems**: Systems are organized such that continued operation is possible even when disconnected (temporarily or otherwise) from external systems dependencies.
- **Air-gapped systems**: Systems are designed to operate while _physically disconnected_ from "unsecured" networks like the internet. More on that [here](<https://en.wikipedia.org/wiki/Air_gap_(networking)>).
- **Air-gapped systems**: Systems are designed to operate while _physically disconnected_ from "unsecured" networks like the internet. For more information, see [Air Gap Networking](<https://en.wikipedia.org/wiki/Air_gap_(networking)>).
7 changes: 6 additions & 1 deletion docs/4-user-guide/3-zarf-schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -1748,12 +1748,17 @@ Must be one of:
&nbsp;
<blockquote>

**Description:** The URL of the chart repository or git url if the chart is using a git repo instead of helm repo
**Description:** The URL of the OCI registry, chart repository, or git repo where the helm chart is stored

| | |
| -------- | -------- |
| **Type** | `string` |

**Examples:**

<code>
"OCI registry: oci://ghcr.io/stefanprodan/charts/podinfo", "helm chart repo: https://stefanprodan.github.io/podinfo", "git repo: https://github.com/stefanprodan/podinfo"</code>

</blockquote>
</details>

Expand Down
79 changes: 53 additions & 26 deletions examples/big-bang/config/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,36 +7,63 @@ istio:
tls: # certs for *.bigbang.dev
key: |
-----BEGIN PRIVATE KEY-----
MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgbI4SyUc4dXDvtm/x
PxxrC7qjmb2Kxit/ZphilhOoUF+hRANCAARBXS6lFbqcDFR5VUzihkUshJ7yX2s7
cXFqUD0ChkmsDnT+igae9xg6hEnz83JaTr4YAqJhEpI2B0ZLcVa4kMkw
MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDDvKUzWiZucm6/
8D2Nx4KVe8t6uHtARpw112f4yGv7xKcOJkbxLbVtor8pj/HS5tRSZq2ziIQl9y98
8TVAOBezgzPPMDxOqDeyHl5gAtqzpK/eSPmueZIhR88BH2+SMYqa5kxmjn752Rf0
jVeCrVdQ5MD9rqA00oQi/zO+gQQoz6QSui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qK2mNwMRCk5wQBjQGYanTANBgkqhkiG9w0BAQsFAAOC
AQEAeviZDlTw9bzxF9vIZ1F+ijIQmnma6CD32eIEQmD/tIpOeayxuRiNFzIt/ixo
uC0/hKcC+JbVb7ZJOT9woPDce+g3gbA2i390yf3av3EP7sptV90rTM8gLPAdtHxo
RW14cSGmGFmaBRhr7ZbaSumztWcqgOF5orBq26wkhPT5bmqn7YX1W/H7/OMjP1Z+
fQTfgFnfkBtzg1Ib4z3SHIPTqo2kAN3cF+b8AxrUKlk0STwesX2mR9h9jUKTapGg
Y36zDlKTOI3edM22AZDSmrIiR2LV1qGBDoxrsJmnK/Ci3t0KjwzJz45tyzenk8kO
imbt/HYVhe8WfukQ/kQdlhsHCw==
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
MIIFFjCCAv6gAwIBAgIRAJErCErPDBinU/bWLiWnX1owDQYJKoZIhvcNAQELBQAw
Expand Down
16 changes: 16 additions & 0 deletions examples/big-bang/virtualservices/gitea.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: gitea
namespace: zarf
spec:
gateways:
- istio-system/public
hosts:
- gitea.###ZARF_VAR_DOMAIN###
http:
- route:
- destination:
host: zarf-gitea-http.zarf.svc.cluster.local
port:
number: 3000
9 changes: 9 additions & 0 deletions examples/big-bang/zarf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,12 @@ components:
- config/loki.yaml
# Values are merged in order, so this would override the above and disable everything if uncommented
# - config/disable-all.yaml
- name: gitea-virtual-service
description: >
Expose the internal Zarf Gitea server through the Big Bang Istio deployment via a virtual service.
(only applies if you are using the Zarf-provided Gitea deployment - not an externally configured git host)
manifests:
- name: gitea
namespace: zarf
files:
- virtualservices/gitea.yaml
17 changes: 14 additions & 3 deletions src/internal/packager/images/pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ func (i *ImgConfig) PullAll() error {
}

totalBytes := int64(0)
processedLayers := make(map[string]bool)
for src, img := range imageMap {
tag, err := name.NewTag(src, name.WeakValidation)
if err != nil {
Expand All @@ -82,11 +83,21 @@ func (i *ImgConfig) PullAll() error {
return fmt.Errorf("unable to get layers for image %s: %w", src, err)
}
for _, layer := range layers {
size, err := layer.Size()
layerDigest, err := layer.Digest()
if err != nil {
return fmt.Errorf("unable to get size of layer: %w", err)
return fmt.Errorf("unable to get digest for image layer: %w", err)
}
totalBytes += size

// Only calculate this layer size if we haven't already looked at it
if !processedLayers[layerDigest.Hex] {
size, err := layer.Size()
if err != nil {
return fmt.Errorf("unable to get size of layer: %w", err)
}
totalBytes += size
processedLayers[layerDigest.Hex] = true
}

}
}
spinner.Updatef("Preparing image sources and cache for image pulling")
Expand Down
7 changes: 6 additions & 1 deletion src/pkg/packager/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,13 @@ func getOCIPackageSize(src *utils.OrasRemote, ref registry.Reference) (int64, er
layers = manifest.Layers
}

processedLayers := make(map[string]bool)
for _, layer := range layers {
total += layer.Size
// Only include this layer's size if we haven't already processed it
if !processedLayers[layer.Digest.String()] {
total += layer.Size
processedLayers[layer.Digest.String()] = true
}
}

return total, nil
Expand Down
2 changes: 1 addition & 1 deletion src/types/component.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ type ZarfFile struct {
type ZarfChart struct {
Name string `json:"name" jsonschema:"description=The name of the chart to deploy; this should be the name of the chart as it is installed in the helm repo"`
ReleaseName string `json:"releaseName,omitempty" jsonschema:"description=The name of the release to create; defaults to the name of the chart"`
URL string `json:"url,omitempty" jsonschema:"oneof_required=url,description=The URL of the chart repository or git url if the chart is using a git repo instead of helm repo"`
URL string `json:"url,omitempty" jsonschema:"oneof_required=url,example=OCI registry: oci://ghcr.io/stefanprodan/charts/podinfo,example=helm chart repo: https://stefanprodan.github.io/podinfo,example=git repo: https://github.com/stefanprodan/podinfo" jsonschema_description:"The URL of the OCI registry, chart repository, or git repo where the helm chart is stored"`
Version string `json:"version" jsonschema:"description=The version of the chart to deploy; for git-based charts this is also the tag of the git repo"`
Namespace string `json:"namespace" jsonschema:"description=The namespace to deploy the chart to"`
ValuesFiles []string `json:"valuesFiles,omitempty" jsonschema:"description=List of values files to include in the package; these will be merged together"`
Expand Down
3 changes: 1 addition & 2 deletions src/ui/lib/api-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -490,8 +490,7 @@ export interface ZarfChart {
*/
releaseName?: string;
/**
* The URL of the chart repository or git url if the chart is using a git repo instead of
* helm repo
* The URL of the OCI registry, chart repository, or git repo where the helm chart is stored
*/
url?: string;
/**
Expand Down
7 changes: 6 additions & 1 deletion zarf.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,12 @@
},
"url": {
"type": "string",
"description": "The URL of the chart repository or git url if the chart is using a git repo instead of helm repo"
"description": "The URL of the OCI registry, chart repository, or git repo where the helm chart is stored",
"examples": [
"OCI registry: oci://ghcr.io/stefanprodan/charts/podinfo",
"helm chart repo: https://stefanprodan.github.io/podinfo",
"git repo: https://github.com/stefanprodan/podinfo"
]
},
"version": {
"type": "string",
Expand Down

0 comments on commit 030eb91

Please sign in to comment.