Skip to content

Commit

Permalink
Merge branch 'main' into adr/schema
Browse files Browse the repository at this point in the history
  • Loading branch information
AustinAbro321 authored Aug 23, 2024
2 parents 8af8885 + 951b4e6 commit 09ff6a4
Show file tree
Hide file tree
Showing 70 changed files with 1,409 additions and 564 deletions.
22 changes: 10 additions & 12 deletions .github/workflows/publish-application-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,24 @@ permissions:

on:
workflow_dispatch:
inputs:
branchName:
description: "Branch to build the packages from"
required: true
default: "main"

jobs:
publish-packages:
runs-on: ubuntu-latest
permissions:
id-token: write
packages: write
steps:
- name: "Checkout Repo"
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: Auth with AWS
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
with:
ref: ${{ github.event.inputs.branchName }}
role-to-assume: ${{ secrets.AWS_KMS_ROLE }}
role-session-name: ${{ github.job || github.event.client_payload.pull_request.head.sha || github.sha }}
aws-region: us-east-2
role-duration-seconds: 3600

- name: Install The Latest Release Version of Zarf
uses: defenseunicorns/setup-zarf@10e539efed02f75ec39eb8823e22a5c795f492ae #v1.0.1
Expand All @@ -39,12 +41,8 @@ jobs:
zarf package create -o build -a arm64 examples/dos-games --signing-key=awskms:///${{ secrets.COSIGN_AWS_KMS_KEY }} --confirm
# Publish a the signed dos-games package
zarf package publish ./build/zarf-package-dos-games-amd64-1.0.0.tar.zst oci://ghcr.io/zarf-dev/packages --key=https://zarf.dev/cosign.pub
zarf package publish ./build/zarf-package-dos-games-arm64-1.0.0.tar.zst oci://ghcr.io/zarf-dev/packages --key=https://zarf.dev/cosign.pub
zarf package publish ./build/zarf-package-dos-games-amd64-1.1.0.tar.zst oci://ghcr.io/zarf-dev/packages --key=https://zarf.dev/cosign.pub
zarf package publish ./build/zarf-package-dos-games-arm64-1.1.0.tar.zst oci://ghcr.io/zarf-dev/packages --key=https://zarf.dev/cosign.pub
# Publish a skeleton of the dos-games package
zarf package publish examples/dos-games oci://ghcr.io/zarf-dev/packages
env:
AWS_REGION: ${{ secrets.COSIGN_AWS_REGION }}
AWS_ACCESS_KEY_ID: ${{ secrets.COSIGN_AWS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.COSIGN_AWS_ACCESS_KEY }}
12 changes: 9 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:
build-release:
runs-on: ubuntu-latest
permissions:
id-token: write
packages: write
steps:
# Checkout the repo and setup the tooling for this job
Expand Down Expand Up @@ -53,13 +54,18 @@ jobs:
rm build/zarf-linux-arm64
echo ZARF_AGENT_IMAGE_DIGEST=$(docker buildx imagetools inspect ghcr.io/zarf-dev/zarf/agent:$GITHUB_REF_NAME --format '{{ json . }}' | jq -r .manifest.digest) >> $GITHUB_ENV
- name: Auth with AWS
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
with:
role-to-assume: ${{ secrets.AWS_KMS_ROLE }}
role-session-name: ${{ github.job || github.event.client_payload.pull_request.head.sha || github.sha }}
aws-region: us-east-2
role-duration-seconds: 3600

- name: "Zarf Agent: Sign the Image"
run: cosign sign --key awskms:///${{ secrets.COSIGN_AWS_KMS_KEY }} -a release-engineer=https://github.com/${{ github.actor }} -a version=$GITHUB_REF_NAME ghcr.io/zarf-dev/zarf/agent@$ZARF_AGENT_IMAGE_DIGEST -y
env:
COSIGN_EXPERIMENTAL: 1
AWS_REGION: ${{ secrets.COSIGN_AWS_REGION }}
AWS_ACCESS_KEY_ID: ${{ secrets.COSIGN_AWS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.COSIGN_AWS_ACCESS_KEY }}

# Builds init packages since GoReleaser won't handle this for us
- name: Build init-packages For Release
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/scan-codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@29d86d22a34ea372b1bbf3b2dced2e25ca6b3384 # v3.26.1
uses: github/codeql-action/init@f0f3afee809481da311ca3a6ff1ff51d81dbeb24 # v3.26.4
with:
languages: ${{ matrix.language }}
config-file: ./.github/codeql.yaml
Expand All @@ -62,6 +62,6 @@ jobs:
run: make build-cli-linux-amd

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@29d86d22a34ea372b1bbf3b2dced2e25ca6b3384 # v3.26.1
uses: github/codeql-action/analyze@f0f3afee809481da311ca3a6ff1ff51d81dbeb24 # v3.26.4
with:
category: "/language:${{matrix.language}}"
2 changes: 1 addition & 1 deletion .github/workflows/scorecard.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@ jobs:

# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@29d86d22a34ea372b1bbf3b2dced2e25ca6b3384 # v3.26.1
uses: github/codeql-action/upload-sarif@f0f3afee809481da311ca3a6ff1ff51d81dbeb24 # v3.26.4
with:
sarif_file: results.sarif
50 changes: 50 additions & 0 deletions .github/workflows/test-import.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Test Import
on:
pull_request:

permissions:
contents: read

# Abort prior jobs in the same workflow / PR
concurrency:
group: import-${{ github.ref }}
cancel-in-progress: true

jobs:
test-import:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: Setup Go
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version-file: 'go.mod'
cache: true

- name: Run test Go program that imports Zarf
run: |
cd $(mktemp -d)
echo "$GO_MAIN" > main.go
go mod init github.com/zarf-dev/test-import
go mod edit -replace github.com/zarf-dev/zarf=github.com/${{ github.repository }}@${COMMIT_SHA:0:12}
go mod tidy
cat go.mod | grep -q ${COMMIT_SHA:0:12}
go run main.go
env:
COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
GO_MAIN: |
package main
import (
"fmt"
"github.com/zarf-dev/zarf/src/api/v1alpha1"
"github.com/zarf-dev/zarf/src/pkg/packager"
)
func main() {
fmt.Println(packager.Packager{})
fmt.Println(v1alpha1.ZarfComponent{})
}
2 changes: 1 addition & 1 deletion .golangci.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
run:
timeout: 5m
timeout: 10m
linters:
disable-all: true
enable:
Expand Down
12 changes: 0 additions & 12 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,3 @@ repos:
types: [go]
language: golang
pass_filenames: false
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.14.0
hooks:
- id: check-jsonschema
name: "Validate Zarf Configs Against Schema"
files: "zarf.yaml"
types: [yaml]
args: ["--schemafile", "zarf.schema.json"]
exclude: |
(?x)^(
src/test/packages/12-lint/.*
)$
26 changes: 13 additions & 13 deletions cosign.pub
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
-----BEGIN PUBLIC KEY-----
MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA9u472y/wY0tjIiR2T6rY
zOG1q4qwx5ZdmnoGsiG0Zc3rYo2DMiuKciG0MI4opCf4IID7kfYOD4aWILymwFID
xW0L6pEbxknHRQacWZSf/qfA+aAcjbKOY3ZWU8/uLJJeq37Y4OLc17ThJ7ZOj1Yf
Uvj81Uz9ZWVW7kYY31vWCruJh4VxZLsUAmFc6CsQUtzSGordLhh1b1rDP6ZRAaIP
mQnniULogwIBqnUTkIVwxiRYG+V2a3IC5vqlBLQRQ3UOWQ9mgZcfcXuTA6Fh8bwO
2lG768UfI1RBYioXAgXbPwXK+kM3Idvjcr+X2F3VpYWhHTscMIQF0ERzK7BkRqRI
x9l/RRm5lP+9a1kt6giYtvX2OqEsWaG3lTen3ocwblaHRlmqna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AQ==
-----END PUBLIC KEY-----
2 changes: 1 addition & 1 deletion examples/composable-packages/zarf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ components:
# default: false # the initial value overrides the child component
import:
# The URL to the skeleton package containing this component's package definition
url: oci://🦄/dos-games:1.0.0
url: oci://ghcr.io/zarf-dev/packages/dos-games:1.1.0
# Example optional custom name to point to in the imported package (default is to use this component's name)
name: baseline
# Un'name'd Zarf primitives will be appended to the end of the primitive's list for that component.
Expand Down
2 changes: 1 addition & 1 deletion examples/dos-games/zarf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ kind: ZarfPackageConfig
metadata:
name: dos-games
description: Simple example to load classic DOS games into K8s in the airgap
version: 1.0.0
version: 1.1.0

components:
- name: baseline
Expand Down
4 changes: 2 additions & 2 deletions packages/zarf-registry/zarf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ components:
architecture: amd64
files:
# Rust Injector Binary
- source: https://zarf-public.s3-us-gov-west-1.amazonaws.com/injector/###ZARF_PKG_TMPL_INJECTOR_VERSION###/zarf-injector-amd64
- source: https://zarf-init.s3.us-east-2.amazonaws.com/injector/###ZARF_PKG_TMPL_INJECTOR_VERSION###/zarf-injector-amd64
target: "###ZARF_TEMP###/zarf-injector"
shasum: "###ZARF_PKG_TMPL_INJECTOR_AMD64_SHASUM###"
executable: true
Expand All @@ -126,7 +126,7 @@ components:
architecture: arm64
files:
# Rust Injector Binary
- source: https://zarf-public.s3-us-gov-west-1.amazonaws.com/injector/###ZARF_PKG_TMPL_INJECTOR_VERSION###/zarf-injector-arm64
- source: https://zarf-init.s3.us-east-2.amazonaws.com/injector/###ZARF_PKG_TMPL_INJECTOR_VERSION###/zarf-injector-arm64
target: "###ZARF_TEMP###/zarf-injector"
shasum: "###ZARF_PKG_TMPL_INJECTOR_ARM64_SHASUM###"
executable: true
Expand Down
4 changes: 2 additions & 2 deletions site/src/content/docs/getting-started/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { Tabs, TabItem, LinkCard, CardGrid } from '@astrojs/starlight/components
# (Select optional components as desired)

# Now you are ready to deploy any Zarf Package, try out our Retro Arcade!!
zarf package deploy oci://🦄/dos-games:1.0.0 --key=https://zarf.dev/cosign.pub
zarf package deploy oci://ghcr.io/zarf-dev/packages/dos-games:1.1.0 --key=https://zarf.dev/cosign.pub
# (Select 'Y' to confirm deployment)
```

Expand All @@ -39,7 +39,7 @@ import { Tabs, TabItem, LinkCard, CardGrid } from '@astrojs/starlight/components
zarf init --confirm

# Deploy the DOS Games package
zarf package deploy oci://🦄/dos-games:1.0.0 \
zarf package deploy oci://ghcr.io/zarf-dev/packages/dos-games:1.1.0 \
--key=https://zarf.dev/cosign.pub \
--confirm
```
Expand Down
6 changes: 6 additions & 0 deletions site/src/content/docs/ref/deploy.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,12 @@ By default, Zarf waits for all resources to deploy successfully during install,

You can override this behavior during install and upgrade by setting the `noWait: true` key under the `charts` and `manifests` fields.

:::note

Deployments will wait for helm [post-install hooks](https://helm.sh/docs/topics/charts_hooks/#the-available-hooks) to complete even with `noWait` set to `true` as Zarf follows the [Helm release lifecycle](https://helm.sh/docs/topics/charts_hooks/#hooks-and-the-release-lifecycle)

:::

### Timeout Settings

The default timeout for Helm operations in Zarf is 15 minutes.
Expand Down
3 changes: 2 additions & 1 deletion src/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ func Execute(ctx context.Context) {
if len(comps) > 1 && comps[1] == "tools" && slices.Contains(defaultPrintCmds, comps[2]) {
cmd.PrintErrln(cmd.ErrPrefix(), err.Error())
} else {
pterm.Error.Println(err.Error())
errParagraph := message.Paragraph(err.Error())
pterm.Error.Println(errParagraph)
}
os.Exit(1)
}
Expand Down
Loading

0 comments on commit 09ff6a4

Please sign in to comment.