From 33cb5028848244edf9ec2cf1b62f797154ddc17f Mon Sep 17 00:00:00 2001 From: razzle Date: Tue, 18 Apr 2023 20:49:35 -0500 Subject: [PATCH] Cleanup root (#1603) ## Description Cleanup the root files a bit, remove `vagrant` references, update the README w/ new features. ## NOTICE @mike-winberry This changes how NPM stuff gets run. Either run w/ `npm --prefix src/ui COMMAND`, or cd into `src/ui` before running npm things. Additionally, since `package.json` is not in root, you will need to do `export NODE_PATH=$(pwd)/src/ui/node_modules` at root before running `npm --prefix src/ui run test` in order for the UI tests to resolve `node_modules`. ## Type of change - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [x] Other (security config, docs update, etc) ## Checklist before merging - [x] Test, docs, adr added or updated as needed - [x] [Contributor Guide Steps](https://github.com/defenseunicorns/zarf/blob/main/CONTRIBUTING.md#developer-workflow) followed --------- Signed-off-by: razzle Co-authored-by: Wayne Starr --- .github/actions/node/action.yaml | 1 + .github/workflows/Vagrantfile | 138 ------------------ .github/workflows/test-ui.yml | 7 +- Makefile | 16 +- README.md | 35 ++--- Vagrantfile | 52 ------- docs/0-zarf-overview.md | 40 ++--- docs/5-operator-manual/90-supported-oses.md | 75 ---------- docs/6-developer-guide/2-testing.md | 12 +- hack/ui-dev.sh | 2 +- .eslintignore => src/ui/.eslintignore | 0 .eslintrc.cjs => src/ui/.eslintrc.cjs | 0 .npmrc => src/ui/.npmrc | 0 .prettierignore => src/ui/.prettierignore | 4 +- .prettierrc => src/ui/.prettierrc | 0 package-lock.json => src/ui/package-lock.json | 0 package.json => src/ui/package.json | 6 +- .../ui/playwright.config.ts | 4 +- svelte.config.js => src/ui/svelte.config.js | 20 +-- tsconfig.json => src/ui/tsconfig.json | 16 +- vite.config.ts => src/ui/vite.config.ts | 2 +- 21 files changed, 80 insertions(+), 350 deletions(-) delete mode 100644 .github/workflows/Vagrantfile delete mode 100644 Vagrantfile delete mode 100644 docs/5-operator-manual/90-supported-oses.md rename .eslintignore => src/ui/.eslintignore (100%) rename .eslintrc.cjs => src/ui/.eslintrc.cjs (100%) rename .npmrc => src/ui/.npmrc (100%) rename .prettierignore => src/ui/.prettierignore (84%) rename .prettierrc => src/ui/.prettierrc (100%) rename package-lock.json => src/ui/package-lock.json (100%) rename package.json => src/ui/package.json (97%) rename playwright.config.ts => src/ui/playwright.config.ts (95%) rename svelte.config.js => src/ui/svelte.config.js (67%) rename tsconfig.json => src/ui/tsconfig.json (66%) rename vite.config.ts => src/ui/vite.config.ts (93%) diff --git a/.github/actions/node/action.yaml b/.github/actions/node/action.yaml index f4e4789f6c..6e063fa384 100644 --- a/.github/actions/node/action.yaml +++ b/.github/actions/node/action.yaml @@ -8,3 +8,4 @@ runs: with: node-version: 18 cache: "npm" + cache-dependency-path: "src/ui/package-lock.json" diff --git a/.github/workflows/Vagrantfile b/.github/workflows/Vagrantfile deleted file mode 100644 index c07c834d6a..0000000000 --- a/.github/workflows/Vagrantfile +++ /dev/null @@ -1,138 +0,0 @@ -# Github self-hosted runner config -# Usage: -# DOCKER_LOGIN="REPLACE_ME_DOCKER_TOKEN_FOR_PULL_LIMIT" GITHUB_TOKEN="REPLACE_ME_GITHUB_ACTION_TOKEN" vagrant up --provision - -GITHUB_RUNNER_VERSION = "2.296.0" -GITHUB_RUNNER_SHASUM = "d1fa9768ef81de108db24645cba174096dfb59b4dbb883016192384827f29e43" -UBUNTU_NODE_COUNT = 6 -ROCKY_NODE_COUNT = 2 - -require 'securerandom' - -Vagrant.configure("2") do |config| - - config.vm.synced_folder '.', '/vagrant', disabled: true - config.ssh.insert_key = false - - config.vm.provider "virtualbox" do |vb| - vb.check_guest_additions = false - vb.cpus = 6 - vb.memory = 16384 - end - - config.disksize.size = '200GB' - - ##################################################################### - # Common setup scripts # - ##################################################################### - config.vm.provision "shell", inline: <<-SHELL - # Elasticsearch needs this - sysctl -w vm.max_map_count=262144 - - # Write the runner pre/posts scripts - cat > /home/vagrant/runner-cleanup.sh << EOF -#!/bin/bash -set +e - -sudo chown -R vagrant /home/vagrant || echo '' -sudo /opt/zarf/zarf-clean-k3s.sh || echo '' -sudo rm -fr ~/.kube -sudo rm -fr /root/.kube -sudo rm -fr /tmp/zarf* -EOF - - # Make it executable - chmod 755 /home/vagrant/runner-cleanup.sh - - # Create a folder - mkdir -p actions-runner && cd actions-runner - - # Download the latest runner package & validate the shasum - curl -o actions-runner-linux-x64-#{GITHUB_RUNNER_VERSION}.tar.gz -L https://github.com/actions/runner/releases/download/v#{GITHUB_RUNNER_VERSION}/actions-runner-linux-x64-#{GITHUB_RUNNER_VERSION}.tar.gz - echo "#{GITHUB_RUNNER_SHASUM} actions-runner-linux-x64-#{GITHUB_RUNNER_VERSION}.tar.gz" | sha256sum -c - - # Extract the installer - tar xzf ./actions-runner-linux-x64-#{GITHUB_RUNNER_VERSION}.tar.gz - - ./bin/installdependencies.sh - SHELL - - - ##################################################################### - # Ubuntu-specific configs # - ##################################################################### - (1..UBUNTU_NODE_COUNT).each do |i| - config.vm.define "ubuntu-#{i}" do |subconfig| - subconfig.vm.hostname = "ubuntu-#{i}-dallas-#{SecureRandom.hex(6)}" - - subconfig.vm.box = "ubuntu/focal64" - - subconfig.vm.provision "shell", inline: <<-SHELL - # Install tools - apt-get update -y - apt-get install docker.io make build-essential curl -y - - # Grant vagrant docker access without sudo - usermod -aG docker vagrant - - # Docker login to avoid pull limits - docker login -u zarfdev -p #{ENV['DOCKER_LOGIN']} - - # Tell github to use the cleanup script and allow sudo - export ACTIONS_RUNNER_HOOK_JOB_STARTED=/home/vagrant/runner-cleanup.sh - export ACTIONS_RUNNER_HOOK_JOB_COMPLETED=/home/vagrant/runner-cleanup.sh - export RUNNER_ALLOW_RUNASROOT=1 - - # Create the runner and start the configuration, allow sudo due to k3s tests - ./actions-runner/config.sh --url https://github.com/defenseunicorns/zarf --token #{ENV['GITHUB_TOKEN']} --unattended --labels ubuntu - - # Start the runner - ./actions-runner/run.sh & - SHELL - end - end - - ##################################################################### - # Rocky-specific configs # - ##################################################################### - (1..ROCKY_NODE_COUNT).each do |i| - config.vm.define "rocky-#{i}" do |subconfig| - subconfig.vm.hostname = "rocky-#{i}-dallas-#{SecureRandom.hex(6)}" - - subconfig.vm.box = "rockylinux/8" - - # Setup for Rocky (k3s test only) - subconfig.vm.provision "shell", inline: <<-SHELL - - # Grow the disk - dnf install -y cloud-utils-growpart - growpart /dev/sda 1 - xfs_growfs /dev/sda1 - - # Install docker - dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo - dnf update -y - dnf install -y docker-ce docker-ce-cli containerd.io - dnf groupinstall "Development Tools" -y - - # Configure docker - systemctl enable docker --now - usermod -aG docker vagrant - docker login -u zarfdev -p #{ENV['DOCKER_LOGIN']} - - - # Tell github to use the cleanup script and allow sudo - export ACTIONS_RUNNER_HOOK_JOB_STARTED=/home/vagrant/runner-cleanup.sh - export ACTIONS_RUNNER_HOOK_JOB_COMPLETED=/home/vagrant/runner-cleanup.sh - export RUNNER_ALLOW_RUNASROOT=1 - - # Create the runner and start the configuration, allow sudo due to k3s tests - ./actions-runner/config.sh --url https://github.com/defenseunicorns/zarf --token #{ENV['GITHUB_TOKEN']} --unattended --labels rhel,rocky - - # Start the runner - ./actions-runner/run.sh & - SHELL - end - end - -end diff --git a/.github/workflows/test-ui.yml b/.github/workflows/test-ui.yml index ec5ce0b4af..c8de942222 100644 --- a/.github/workflows/test-ui.yml +++ b/.github/workflows/test-ui.yml @@ -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() diff --git a/Makefile b/Makefile index 826bfb5879..25220902b3 100644 --- a/Makefile +++ b/Makefile @@ -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 @@ -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 @@ -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: diff --git a/README.md b/README.md index a99b1c9ad1..6e782cc7f4 100644 --- a/README.md +++ b/README.md @@ -1,42 +1,41 @@ # Zarf - DevSecOps for Air Gap [![Latest Release](https://img.shields.io/github/v/release/defenseunicorns/zarf)](https://github.com/defenseunicorns/zarf/releases) -[![Zarf Slack Channel](https://img.shields.io/badge/k8s%20slack-zarf-40a3dd)](https://kubernetes.slack.com/archives/C03B6BJAUJ3) -[![Zarf Website](https://img.shields.io/badge/web-zarf.dev-6d87c3)](https://zarf.dev/) -[![Zarf Documentation](https://img.shields.io/badge/docs-docs.zarf.dev-775ba1)](https://docs.zarf.dev/) -[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/defenseunicorns/zarf/badge)](https://api.securityscorecards.dev/projects/github.com/defenseunicorns/zarf) [![Go version](https://img.shields.io/github/go-mod/go-version/defenseunicorns/zarf?filename=go.mod)](https://go.dev/) +[![Build Status](https://img.shields.io/github/actions/workflow/status/defenseunicorns/zarf/release.yml)](https://github.com/defenseunicorns/zarf/actions/workflows/release.yml) +[![Zarf Documentation Status](https://api.netlify.com/api/v1/badges/fe846ae4-25fb-4274-9968-90782640ee9f/deploy-status)](https://app.netlify.com/sites/zarf-docs/deploys) +[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/defenseunicorns/zarf/badge)](https://api.securityscorecards.dev/projects/github.com/defenseunicorns/zarf) -||Build Status| -|---|---| -|Zarf|[![Build Status](https://img.shields.io/github/actions/workflow/status/defenseunicorns/zarf/release.yml)](https://github.com/defenseunicorns/zarf/actions/workflows/release.yml)| -|Zarf Documentation|[![Zarf Documentation Status](https://api.netlify.com/api/v1/badges/fe846ae4-25fb-4274-9968-90782640ee9f/deploy-status)](https://app.netlify.com/sites/zarf-docs/deploys)| +[![Zarf Website](https://img.shields.io/badge/web-zarf.dev-6d87c3)](https://zarf.dev/) +[![Zarf Documentation](https://img.shields.io/badge/docs-docs.zarf.dev-775ba1)](https://docs.zarf.dev/) +[![Zarf Slack Channel](https://img.shields.io/badge/k8s%20slack-zarf-40a3dd)](https://kubernetes.slack.com/archives/C03B6BJAUJ3) zarf logo Zarf eliminates the [complexity of air gap software delivery](https://www.itopstimes.com/contain/air-gap-kubernetes-considerations-for-running-cloud-native-applications-without-the-cloud/) for Kubernetes clusters and cloud-native workloads using a declarative packaging strategy to support DevSecOps in offline and semi-connected environments. -📦 Out of the Box Features +## 📦 Out of the Box Features - Automate Kubernetes deployments in disconnected environments - Automate [Software Bill of Materials (SBOM)](https://www.linuxfoundation.org/tools/the-state-of-software-bill-of-materials-sbom-and-cybersecurity-readiness/) generation - Provide a [web dashboard](https://docs.zarf.dev/docs/dashboard-ui/sbom-dashboard) for viewing SBOM output +- Create and verify package signatures with [cosign](https://github.com/sigstore/cosign) +- [Publish](https://docs.zarf.dev/docs/user-guide/the-zarf-cli/cli-commands/zarf_package_publish), [pull](https://docs.zarf.dev/docs/user-guide/the-zarf-cli/cli-commands/zarf_package_pull), and [deploy](https://docs.zarf.dev/docs/user-guide/the-zarf-cli/cli-commands/zarf_package_deploy) packages from an [OCI registry](https://opencontainers.org/) +- Powerful component lifecycle [actions](https://docs.zarf.dev/docs/user-guide/component-actions) - Deploy a new cluster while fully disconnected with [K3s](https://k3s.io/) or into any existing cluster using a [kube config](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/) - Builtin logging stack with [Loki](https://grafana.com/oss/loki/) -- Builtin git server with [Gitea](https://gitea.com/) -- Builtin docker registry +- Builtin Git server with [Gitea](https://gitea.com/) +- Builtin Docker registry - Builtin [K9s Dashboard](https://k9scli.io/) for managing a cluster from the terminal - [Mutating Webhook](adr/0005-mutating-webhook.md) to automatically update Kubernetes pod's image path and pull secrets as well as [Flux Git Repository](https://fluxcd.io/docs/components/source/gitrepositories/) URLs and secret references -- Builtin [command to find images](https://docs.zarf.dev/docs/user-guide/the-zarf-cli/cli-commands/zarf_prepare_find-images) and resources from a helm chart +- Builtin [command to find images](https://docs.zarf.dev/docs/user-guide/the-zarf-cli/cli-commands/zarf_prepare_find-images) and resources from a Helm chart - Tunneling capability to [connect to Kuberenetes resources](https://docs.zarf.dev/docs/user-guide/the-zarf-cli/cli-commands/zarf_connect) without network routing, DNS, TLS or Ingress configuration required -🛠️ Configurable Features +## 🛠️ Configurable Features -- Customizable [variables](examples/variables/README.md) with defaults and user prompting +- Customizable [variables and package templates](examples/variables/README.md) with defaults and user prompting - [Composable packages](https://docs.zarf.dev/docs/user-guide/zarf-packages/zarf-components#composing-package-components) to include multiple sub-packages/components -- Filters to select the correct architectures/operating systems for packages - -> Early Zarf research and prototypes were developed jointly with [United States Naval Postgraduate School](https://nps.edu/) research you can read [here](https://calhoun.nps.edu/handle/10945/68688). +- Component-level OS/architecture filtering ## Demo @@ -62,6 +61,8 @@ To contribute, please see our [Contributor Guide](https://docs.zarf.dev/docs/dev ## Special Thanks +> Early Zarf research and prototypes were developed jointly with [United States Naval Postgraduate School](https://nps.edu/) research you can read [here](https://calhoun.nps.edu/handle/10945/68688). + We would also like to thank the following awesome libraries and projects without which Zarf would not be possible! [![pterm/pterm](https://img.shields.io/badge/pterm%2Fpterm-007d9c?logo=go&logoColor=white)](https://github.com/pterm/pterm) diff --git a/Vagrantfile b/Vagrantfile deleted file mode 100644 index 7daaec5845..0000000000 --- a/Vagrantfile +++ /dev/null @@ -1,52 +0,0 @@ -Vagrant.configure("2") do |config| - - config.vm.provider "virtualbox" do |vb| - vb.check_guest_additions = false - vb.cpus = 6 - vb.memory = 8192 - end - - config.vm.disk :disk, size: "20GB", primary: true - - config.vm.define "rhel7" do |target| - target.vm.box = "generic/rhel7" - end - - config.vm.define "rhel8" do |target| - target.vm.box = "generic/rhel8" - end - - config.vm.define "centos7" do |target| - target.vm.box = "boxomatic/centos-7" - end - - config.vm.define "centos8" do |target| - target.vm.box = "boxomatic/centos-8" - end - - config.vm.define "ubuntu" do |target| - target.vm.box = "boxomatic/ubuntu-20.04" - end - - config.vm.define "debian" do |target| - target.vm.box = "boxomatic/debian-11" - end - - config.vm.define "rocky" do |target| - target.vm.box = "boxomatic/rocky-8.4" - end - - config.vm.hostname = "zarf-test" - config.vm.synced_folder '.', '/vagrant', disabled: true - config.vm.synced_folder 'build', '/opt/zarf', SharedFoldersEnableSymlinksCreate: false - - config.vm.network "forwarded_port", guest: 80, host: 8080 - config.vm.network "forwarded_port", guest: 443, host: 8443 - - config.ssh.insert_key = false - - config.vm.provision "shell", inline: <<-SHELL - # Airgap images please - echo "0.0.0.0 registry.hub.docker.com hub.docker.com charts.helm.sh repo1.dso.mil github.com registry.dso.mil registry1.dso.mil docker.io index.docker.io auth.docker.io registry-1.docker.io dseasb33srnrn.cloudfront.net production.cloudflare.docker.com registry.opensource.zalan.do" >> /etc/hosts - SHELL -end diff --git a/docs/0-zarf-overview.md b/docs/0-zarf-overview.md index a0d415c897..3245979112 100644 --- a/docs/0-zarf-overview.md +++ b/docs/0-zarf-overview.md @@ -41,7 +41,6 @@ A typical Zarf deployment is made up of three parts: 3. A Zarf Package: - A compressed tarball package that contains all of the files, manifests, source repositories, and images needed to deploy your infrastructure, application, and resources in a disconnected environment. - :::note For more technical information on how Zarf works and to view the Zarf architecture, visit our [Nerd Notes page](./6-developer-guide/3-nerd-notes.md). @@ -66,7 +65,6 @@ Given Zarf's being a "K8s cluster to serve _other_ K8s clusters", the following - Helm charts, kustomizations, and other K8s manifests: to apply in a Kubernetes cluster. - [Data injections](../examples/data-injection/README.md): to declaratively inject data into running containers in a Kubernetes cluster. - ## How To Use Zarf Zarf is intended for use in a software deployment process that looks similar to this: @@ -87,7 +85,7 @@ For additional information, see the [Building a package](./13-walkthroughs/0-usi ### (2) Ship the Package to the System Location -Zarf enables secure software delivery for various environments, such as remote, constrained, independent, and air-gapped systems. Considering there are various target environments with their own appropriate transferring mechanisms, Zarf does not determine _how_ packages are moved so long as they can arrive in your downstream environment. +Zarf enables secure software delivery for various environments, such as remote, constrained, independent, and air-gapped systems. Considering there are various target environments with their own appropriate transferring mechanisms, Zarf does not determine _how_ packages are moved so long as they can arrive in your downstream environment. ### (3) Deploy the Package @@ -117,7 +115,7 @@ In the more complex use case, your package consists of updates for many apps/sys - 💸 **Free and Open-Source.** Zarf will always be free to use and maintained by the open-source community. - 🔓 **No Vendor Lock.** There is no proprietary software that locks you into using Zarf. If you want to remove it, you still can use your helm charts to deploy your software manually. -- 💻 **OS Agnostic.** Zarf supports numerous operating systems. For a full list, visit the [Supported OSes](./5-operator-manual/90-supported-oses.md) page. +- 💻 **OS Agnostic.** Zarf supports numerous operating systems. A full matrix of supported OSes, architectures and featuresets is coming soon. - 📦 **Highly Distributable.** Integrate and deploy software from multiple secure development environments including edge, embedded systems, secure cloud, data centers, and even local environments. - 🚀 **Develop Connected Deploy Disconnected.** Teams can build and configure individual applications or entire DevSecOps environments while connected to the internet. Once created, they can be packaged and shipped to a disconnected environment to be deployed. - 💿 **Single File Deployments.** Zarf allows you to package the parts of the internet your app needs into a single compressed file to be installed without connectivity. @@ -126,26 +124,30 @@ In the more complex use case, your package consists of updates for many apps/sys ## Features + + ### 📦 Out of the Box Features -- Automates Kubernetes deployments in disconnected environments. -- Automates [Software Bill of Materials (SBOM)](https://www.linuxfoundation.org/tools/the-state-of-software-bill-of-materials-sbom-and-cybersecurity-readiness/) generation. -- Provides an [SBOM dashboard UI](dashboard-ui/sbom-dashboard). -- Convert SBOM JSON file into government compliant format (.xpdx or .cyclone.dx). -- Deploys a new cluster while fully disconnected with [K3s](https://k3s.io/) or into any existing cluster using a [Kube config](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/). -- Built-in logging stack with [Loki](https://grafana.com/oss/loki/). -- Built-in git server with [Gitea](https://gitea.com/). -- Built-in docker registry. -- Built-in [K9s Dashboard](https://k9scli.io/) for managing a cluster from the terminal. -- [Mutating Webhook](adr/0005-mutating-webhook.md) to automatically update Kubernetes pod's image path and pull secrets as well as [Flux Git Repository](https://fluxcd.io/docs/components/source/gitrepositories/) URLs and secret references. -- Built-in [command to find images](user-guide/the-zarf-cli/cli-commands/zarf_prepare_find-images) and resources from a helm chart. -- Tunneling capability to [connect to Kubernetes resources](user-guide/the-zarf-cli/cli-commands/zarf_connect) without network routing, DNS, TLS, or Ingress configuration required. +- Automate Kubernetes deployments in disconnected environments +- Automate [Software Bill of Materials (SBOM)](https://www.linuxfoundation.org/tools/the-state-of-software-bill-of-materials-sbom-and-cybersecurity-readiness/) generation +- Provide a [web dashboard](https://docs.zarf.dev/docs/dashboard-ui/sbom-dashboard) for viewing SBOM output +- Create and verify package signatures with [cosign](https://github.com/sigstore/cosign) +- [Publish](https://docs.zarf.dev/docs/user-guide/the-zarf-cli/cli-commands/zarf_package_publish), [pull](https://docs.zarf.dev/docs/user-guide/the-zarf-cli/cli-commands/zarf_package_pull), and [deploy](https://docs.zarf.dev/docs/user-guide/the-zarf-cli/cli-commands/zarf_package_deploy) packages from an [OCI registry](https://opencontainers.org/) +- Powerful component lifecycle [actions](https://docs.zarf.dev/docs/user-guide/component-actions) +- Deploy a new cluster while fully disconnected with [K3s](https://k3s.io/) or into any existing cluster using a [kube config](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/) +- Builtin logging stack with [Loki](https://grafana.com/oss/loki/) +- Builtin Git server with [Gitea](https://gitea.com/) +- Builtin Docker registry +- Builtin [K9s Dashboard](https://k9scli.io/) for managing a cluster from the terminal +- [Mutating Webhook](adr/0005-mutating-webhook.md) to automatically update Kubernetes pod's image path and pull secrets as well as [Flux Git Repository](https://fluxcd.io/docs/components/source/gitrepositories/) URLs and secret references +- Builtin [command to find images](https://docs.zarf.dev/docs/user-guide/the-zarf-cli/cli-commands/zarf_prepare_find-images) and resources from a Helm chart +- Tunneling capability to [connect to Kuberenetes resources](https://docs.zarf.dev/docs/user-guide/the-zarf-cli/cli-commands/zarf_connect) without network routing, DNS, TLS or Ingress configuration required ### 🛠️ Configurable Features -- Customizable [variables](examples/variables/README.md) with defaults and user prompting. -- [Composable packages](user-guide/zarf-packages/zarf-components#composing-package-components) to include multiple sub-packages/components. -- Filters to select the correct architectures/operating systems for packages. +- Customizable [variables and package templates](examples/variables/README.md) with defaults and user prompting +- [Composable packages](https://docs.zarf.dev/docs/user-guide/zarf-packages/zarf-components#composing-package-components) to include multiple sub-packages/components +- Component-level OS/architecture filtering ## Quick Start diff --git a/docs/5-operator-manual/90-supported-oses.md b/docs/5-operator-manual/90-supported-oses.md deleted file mode 100644 index 9bdd92b946..0000000000 --- a/docs/5-operator-manual/90-supported-oses.md +++ /dev/null @@ -1,75 +0,0 @@ ---- -sidebar_position: 8 ---- -# Supported OSes - -Zarf is intended to install & run on a multitude of 64-bit Linux distributions. - -Check the table below to understand which distros which we test against & if there are any known issues or usage caveats. - - -## Support Matrix - -|OS |VM_ID |Notes| -|--- |--- |---| -|RHEL 7 |rhel7 || -|RHEL 8 |rhel8 || -|CentOS 7 |centos7 || -|CentOS 8 |centos8 || -|Ubuntu 20.04 |ubuntu || -|Debian 11 |debian || -|Rocky 8.4 |rocky || - - -## Demo Environments - -We support running an instance of Zarf _inside a local VM_ (of any of the [supported OSes](#support-matrix)) for test & demonstration purposes. - -> _**Take note**_ -> -> Run the following commands from _**the project root directory**_. - -### Startup - -To get a VM running, it's as easy as running a single command: - -``` bash -make vm-init OS=[VM_ID] # e.g. make vm-init OS=ubuntu -``` - -> _**Warning!**_ -> -> Besure to pass a VM_ID or you'll start a VM instance for _every one of the supported OS types_. Yikes! - -### Work in the VM - -To connect into the VM instance you just started, run: - -``` bash -vagrant ssh [VM_ID] # e.g. vagrant ssh ubuntu -``` - -Once connected, you can work with your mounted-from-the-host copy of Zarf like so: - -``` bash -sudo su # escalate permissions (to "root" user) -cd /opt/zarf # access Zarf -./zarf help -``` - -When you're done with the VM, you can exit back to the host terminal by running: - -``` bash -exit # de-escalate permissions (back to "vagrant" user) -exit # exits VM shel & drops you back on the host -``` - -### Shutdown - -Closing out the demo environment is _also_ a single command: - -``` bash -make vm-destroy -``` - -This will shutdown & destroy _all_ the demo VM instances it can find. Easy-peasy—nice and clean. diff --git a/docs/6-developer-guide/2-testing.md b/docs/6-developer-guide/2-testing.md index 456f12099c..5e76477779 100644 --- a/docs/6-developer-guide/2-testing.md +++ b/docs/6-developer-guide/2-testing.md @@ -113,17 +113,17 @@ There are several ways to run tests depending on your specific situation, such a ```shell # dont forget to install dependencies -npm ci +npm --prefix src/ui ci -# get help with playwright -npx playwright --help +# allow playwright to find the node modules +export NODE_PATH=$(pwd)/src/ui/node_modules # run tests with @pre-init tag -npm run test:pre-init +npm --prefix src/ui run test:pre-init # run tests with @init tag -npm run test:init +npm --prefix src/ui run test:init # run tests with @post-init tag -npm run test:post-init +npm --prefix src/ui run test:post-init ``` diff --git a/hack/ui-dev.sh b/hack/ui-dev.sh index 359681e608..9e76453bfc 100755 --- a/hack/ui-dev.sh +++ b/hack/ui-dev.sh @@ -12,4 +12,4 @@ API_DEV_PORT=5173 \ concurrently --names "ui,api" \ -c "gray.bold,yellow" \ "vite dev" \ - "nodemon -e go -x 'go run -ldflags=\"$BUILD_ARGS\" main.go dev ui -l=trace || exit 1'" + "nodemon -e go -x 'go run -ldflags=\"$BUILD_ARGS\" ../../main.go dev ui -l=trace || exit 1'" diff --git a/.eslintignore b/src/ui/.eslintignore similarity index 100% rename from .eslintignore rename to src/ui/.eslintignore diff --git a/.eslintrc.cjs b/src/ui/.eslintrc.cjs similarity index 100% rename from .eslintrc.cjs rename to src/ui/.eslintrc.cjs diff --git a/.npmrc b/src/ui/.npmrc similarity index 100% rename from .npmrc rename to src/ui/.npmrc diff --git a/.prettierignore b/src/ui/.prettierignore similarity index 84% rename from .prettierignore rename to src/ui/.prettierignore index 24e0748d8f..02cb6e22d0 100644 --- a/.prettierignore +++ b/src/ui/.prettierignore @@ -1,8 +1,6 @@ .DS_Store node_modules -/build -/.svelte-kit -/package +.svelte-kit .env .env.* !.env.example diff --git a/.prettierrc b/src/ui/.prettierrc similarity index 100% rename from .prettierrc rename to src/ui/.prettierrc diff --git a/package-lock.json b/src/ui/package-lock.json similarity index 100% rename from package-lock.json rename to src/ui/package-lock.json diff --git a/package.json b/src/ui/package.json similarity index 97% rename from package.json rename to src/ui/package.json index d14f8316f1..3a800d5bf9 100644 --- a/package.json +++ b/src/ui/package.json @@ -1,10 +1,10 @@ { "name": "zarf-ui", "private": true, - "version": "0.0.1", "type": "module", + "version": "0.0.1", "scripts": { - "dev": "hack/ui-dev.sh", + "dev": "../../hack/ui-dev.sh", "build": "vite build", "test": "playwright test -x --reporter github,html", "test:pre-init": "playwright test -x --reporter github,html --grep @pre-init", @@ -17,7 +17,7 @@ "nodemonConfig": { "delay": 5000, "watch": [ - "src" + "../../src" ], "signal": "SIGKILL", "extensions": [ diff --git a/playwright.config.ts b/src/ui/playwright.config.ts similarity index 95% rename from playwright.config.ts rename to src/ui/playwright.config.ts index ad48cfcbc7..c44fc5170a 100644 --- a/playwright.config.ts +++ b/src/ui/playwright.config.ts @@ -11,7 +11,7 @@ import type { PlaywrightTestConfig } from '@playwright/test'; * See https://playwright.dev/docs/test-configuration. */ const config: PlaywrightTestConfig = { - testDir: './src/test/ui', + testDir: '../test/ui', /* This is 10 minutes jon */ timeout: 10 * 60 * 1000, expect: { @@ -75,7 +75,7 @@ const config: PlaywrightTestConfig = { /* Run your local dev server before starting the tests */ webServer: { - command: process.env.CI ? 'make test-built-ui' : 'npm run dev', + command: process.env.CI ? 'cd ../.. && make test-built-ui' : 'npm run dev', port: 3333, reuseExistingServer: true, timeout: 120 * 1000 diff --git a/svelte.config.js b/src/ui/svelte.config.js similarity index 67% rename from svelte.config.js rename to src/ui/svelte.config.js index 5f55b9940e..a7dd5fd6dc 100644 --- a/svelte.config.js +++ b/src/ui/svelte.config.js @@ -7,23 +7,23 @@ const config = { // disable css-unused warnings if (warning.code.startsWith("css-unused-")) return; handler(warning); - }, + }, + root: ".", // Consult https://github.com/sveltejs/svelte-preprocess // for more information about preprocessors preprocess: preprocess(), kit: { - files: { - assets: 'src/ui/static', - lib: 'src/ui/lib', - params: 'src/ui/params', - routes: 'src/ui/routes', - serviceWorker: 'src/ui/service-worker', - appTemplate: 'src/ui/app.html' + assets: 'static', + lib: 'lib', + params: 'params', + routes: 'routes', + serviceWorker: 'service-worker', + appTemplate: 'app.html' }, adapter: adapter({ - pages: 'build/ui', - assets: 'build/ui', + pages: '../../build/ui', + assets: '../../build/ui', fallback: "index.html", }), }, diff --git a/tsconfig.json b/src/ui/tsconfig.json similarity index 66% rename from tsconfig.json rename to src/ui/tsconfig.json index 3c38eb22dc..c108021511 100644 --- a/tsconfig.json +++ b/src/ui/tsconfig.json @@ -8,19 +8,19 @@ "sourceMap": true, "strict": true, "paths": { - "$lib": ["./src/ui/lib"], - "$lib/*": ["./src/ui/lib/*"], - "@assets/*": ["./src/ui/static/*"], - "@images/*": ["./src/ui/images/*"], + "$lib": ["./lib"], + "$lib/*": ["./lib/*"], + "@assets/*": ["./static/*"], + "@images/*": ["./images/*"], "@ui": ["./node_modules/@defense-unicorns/unicorn-ui"], "@ui/*": ["./node_modules/@defense-unicorns/unicorn-ui/*"] } }, "include": [ - "src/ui/**/*.d.ts", - "src/ui/**/*.ts", - "src/ui/**/*.js", - "src/ui/**/*.svelte", + "**/*.d.ts", + "**/*.ts", + "**/*.js", + "**/*.svelte", "jest.config.js", ".svelte-kit/ambient.d.ts", ] diff --git a/vite.config.ts b/src/ui/vite.config.ts similarity index 93% rename from vite.config.ts rename to src/ui/vite.config.ts index 825d08e6d6..82cb156825 100644 --- a/vite.config.ts +++ b/src/ui/vite.config.ts @@ -27,7 +27,7 @@ const config: UserConfig = { }, resolve: { alias: { - '@images': __dirname + '/src/ui/images', + '@images': __dirname + '/images', '@ui': __dirname + '/node_modules/@defense-unicorns/unicorn-ui', }, },