Skip to content

Commit

Permalink
Merge branch 'main' into docs-edits-to-set-up-and-install
Browse files Browse the repository at this point in the history
  • Loading branch information
Racer159 authored Apr 24, 2023
2 parents 0df925b + c316e3b commit c125039
Show file tree
Hide file tree
Showing 127 changed files with 694 additions and 635 deletions.
1 change: 1 addition & 0 deletions .github/actions/node/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ runs:
with:
node-version: 18
cache: "npm"
cache-dependency-path: "src/ui/package-lock.json"
138 changes: 0 additions & 138 deletions .github/workflows/Vagrantfile

This file was deleted.

10 changes: 7 additions & 3 deletions .github/workflows/nightly-ecr.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Test ECR Publishing
on:
# schedule:
# - cron: '0 7 * * * ' ## Every day at 0700 UTC
schedule:
- cron: '0 7 * * * ' ## Every day at 0700 UTC

workflow_dispatch: ## Give us the ability to run this manually

Expand All @@ -11,6 +11,10 @@ concurrency:
group: ecr-publish-${{ github.ref }}
cancel-in-progress: true

permissions:
id-token: write
contents: read

jobs:
validate:
runs-on: ubuntu-latest
Expand All @@ -35,7 +39,7 @@ jobs:

# NOTE: The aws cli will need to be explicitly installed on self-hosted runners
- name: Login to the ECR Registry
run: aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/t8y5r5z5 ─╯
run: aws ecr-public get-login-password --region us-east-1 | ./build/zarf tools registry login --username AWS --password-stdin public.ecr.aws

- name: Test publishing and pulling to ECR
run: go test ./src/test/nightly/ecr_publish_test.go
Expand Down
40 changes: 33 additions & 7 deletions .github/workflows/nightly-eks.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
name: Test EKS Cluster
on:
# schedule:
# - cron: '0 7 * * * ' ## Every day at 0700 UTC
schedule:
- cron: '0 7 * * * ' ## Every day at 0700 UTC

workflow_dispatch: ## Give us the ability to run this manually
inputs:
cluster_name:
type: string
default: zarf-nightly-eks-e2e-test
description: Name of the eks cluster that the test will create
instance_type:
type: string
default: t3.medium
description: EC2 instance type to use for the EKS cluster nodes

permissions:
id-token: write
contents: read

# Abort prior jobs in the same workflow / PR
concurrency:
Expand All @@ -30,21 +42,35 @@ jobs:
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: ${{ secrets.AWS_NIGHTLY_ROLE }}}
role-to-assume: ${{ secrets.AWS_NIGHTLY_ROLE }}
aws-region: us-east-1
role-duration-seconds: 14400


- name: Build the eks package
run: ./build/zarf package create packages/distros/eks -o build -a $(ARCH) --confirm
run: ./build/zarf package create packages/distros/eks -o build --confirm

- name: Deploy the eks package
run: ./build/zarf package deploy build/zarf-package-distro-eks-multi-0.0.2.tar.zst --components=deploy-eks-cluster --SET=CLUSTER_NAME=zarf-eks-test,INSTANCE_TYPE=t3.medium
run: ./build/zarf package deploy build/zarf-package-distro-eks-multi-0.0.2.tar.zst --components=deploy-eks-cluster --set=CLUSTER_NAME=${{ inputs.cluster_name || 'zarf-nightly-eks-e2e-test' }},INSTANCE_TYPE=${{ inputs.instance_type || 't3.medium' }} --confirm

# NOTE: We are copying the secret because part of the e2e process destroys the `zarf` namespace. We still want to test the remove-ability of the eks cluster via the package.
- name: Copy the eks secret into a local file
run: |
rm -f eks.yaml
./build/zarf tools kubectl get secret -n zarf zarf-eks-yaml -o jsonpath='{.data.*}' | base64 -d > eks.yaml
- name: Run tests
run: ZARF_INIT_ARGS="--make test-e2e ARCH=amd64
run: make test-e2e ARCH=amd64

# NOTE: We are copying the secret because part of the e2e process destroys the `zarf` namespace. We still want to test the remove-ability of the eks cluster via the package.
- name: Re-create zarf namespace with eks.yaml secret
run: |
./build/zarf tools kubectl create secret generic zarf-eks-yaml -n zarf --from-file=eks.yaml
- name: Teardown the cluster
if: always()
run: ./build/zarf package remove build/zarf-package-distro-eks-multi-0.0.2.tar.zst --confirm
run: ./build/zarf package deploy build/zarf-package-distro-eks-multi-0.0.2.tar.zst --components=teardown-eks-cluster --confirm

- name: Save logs
if: always()
uses: ./.github/actions/save-logs
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
push-resources:
runs-on: ubuntu-latest
permissions:
contents: read
contents: write
packages: write
steps:
- name: Checkout
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/test-ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,10 @@ jobs:

- name: Run UI tests
run: >
npm run test:pre-init &&
npm run test:init &&
npm run test:post-init
export NODE_PATH=$(pwd)/src/ui/node_modules &&
npm --prefix src/ui run test:pre-init &&
npm --prefix src/ui run test:init &&
npm --prefix src/ui run test:post-init
- name: Save logs
if: always()
Expand Down
2 changes: 1 addition & 1 deletion .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ builds:
- darwin
- windows
ldflags:
- -s -w -X github.com/defenseunicorns/zarf/src/config.CLIVersion={{.Tag}}
- -s -w -X github.com/defenseunicorns/zarf/src/config.CLIVersion={{.Tag}} -X k8s.io/component-base/version.gitVersion=v0.0.0+zarf{{.Tag}} -X k8s.io/component-base/version.gitCommit={{.FullCommit}} -X k8s.io/component-base/version.buildDate={{.Date}}
goarch:
- amd64
- arm64
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Our E2E tests can be found in the `/test` folder and follow the journey of someo
Our Unit tests can be found as `*_test.go` files inside the package that they are designed to test. These are also run in CI and are designed to test small functions with clear interfaces that would be difficult to test otherwise. As a general rule, we are limiting unit tests to the `src/pkg/*` folder.

All of our tests should be able to be run locally or in CI.
You can learn more about the testing of Zarf [here](docs/6-developer-guide/2-testing.md).
You can learn more about the testing of Zarf [here](docs/6-contribute-to-zarf/2-testing.md).

## Documentation

Expand Down
18 changes: 5 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,6 @@ help: ## Display this help information
| sort | awk 'BEGIN {FS = ":.*?## "}; \
{printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'

vm-init: ## Make a vagrant VM (usage -> make vm-init OS=ubuntu)
vagrant destroy -f
vagrant up --no-color ${OS}
echo -e "\n\n\n\033[1;93m ✅ BUILD COMPLETE. To access this environment, run \"vagrant ssh ${OS}\"\n\n\n"

vm-destroy: ## Destroy the vagrant VM
vagrant destroy -f

clean: ## Clean the build directory
rm -rf build

Expand Down Expand Up @@ -72,8 +64,8 @@ check-ui:
fi

build-ui: ## Build the Zarf UI
npm ci
npm run build
npm --prefix src/ui ci
npm --prefix src/ui run build

build-cli-linux-amd: check-ui ## Build the Zarf CLI for Linux on AMD64
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="$(BUILD_ARGS)" -o build/zarf main.go
Expand Down Expand Up @@ -103,8 +95,8 @@ docs-and-schema: ensure-ui-build-dir ## Generate the Zarf Documentation and Sche

dev: ensure-ui-build-dir ## Start a Dev Server for the Zarf UI
go mod download
npm ci
npm run dev
npm --prefix src/ui ci
npm --prefix src/ui run dev

# INTERNAL: a shim used to build the agent image only if needed on Windows using the `test` command
init-package-local-agent:
Expand Down Expand Up @@ -150,7 +142,7 @@ build-examples: ## Build all of the example packages

@test -s ./build/zarf-package-test-helm-wait-$(ARCH).tar.zst || $(ZARF_BIN) package create examples/helm-no-wait -o build -a $(ARCH) --confirm

@test -s ./build/zarf-package-helm-oci-chart-$(ARCH).tar.zst || $(ZARF_BIN) package create examples/helm-oci-chart -o build -a $(ARCH) --confirm
@test -s ./build/zarf-package-helm-oci-chart-$(ARCH)-0.0.1.tar.zst || $(ZARF_BIN) package create examples/helm-oci-chart -o build -a $(ARCH) --confirm

@test -s ./build/zarf-package-yolo-$(ARCH).tar.zst || $(ZARF_BIN) package create examples/yolo -o build -a $(ARCH) --confirm

Expand Down
Loading

0 comments on commit c125039

Please sign in to comment.