Code Monkey home page Code Monkey logo

uds-cli's Introduction

UDS-CLI

Latest Release Go version Build Status OpenSSF Scorecard

โš ๏ธ Warning: UDS-CLI is in early alpha, expect changes to the schema and workflow

Table of Contents

  1. Install
  2. Quickstart
  3. Variables
  4. Bundle Anatomy
  5. UDS Runner

Install

Recommended installation method is with Brew:

brew tap defenseunicorns/tap && brew install uds

UDS CLI Binaries are also included with each Github Release

Quickstart

The UDS-CLI's flagship feature is deploying multiple, independent Zarf packages. To create a UDSBundle of Zarf packages, create a uds-bundle.yaml file like so:

kind: UDSBundle
metadata:
  name: example
  description: an example UDS bundle
  version: 0.0.1

zarf-packages:
  - name: init 
    repository: localhost:5000/init
    ref: v0.31.1
    optional-components:
      - git-server
  - name: podinfo
    repository: localhost:5000/podinfo
    ref: 0.0.1

The above UDSBundle deploys the Zarf init package and podinfo.

The packages referenced in zarf-packages can exist either locally or in an OCI registry. See here for an example that deploys both local and remote Zarf packages. More UDSBundle examples can be found in the src/test/packages folder.

Declarative Syntax

The syntax of a uds-bundle.yaml is entirely declarative. As a result, the UDS CLI will not prompt users to deploy optional components in a Zarf package. If you want to deploy an optional Zarf component, it must be specified in the optional-components key of a particular zarf-package.

Bundle Create

Pulls the Zarf packages from the registry and bundles them into an OCI artifact.

There are 2 ways to create Bundles:

  1. Inside an OCI registry: uds create <dir> --insecure -o localhost:5000
  2. Locally on your filesystem: uds create <dir> --insecure

Noting that the --insecure flag will be necessary when running the registry from the Makefile.

Bundle Deploy

Deploys the bundle

There are 2 ways to deploy Bundles:

  1. From an OCI registry: uds deploy oci://localhost:5000/<name>:<tag> --insecure
  2. From your local filesystem: uds deploy uds-bundle-<name>.tar.zst

Bundle Inspect

Inspect the uds-bundle.yaml of a bundle

  1. From an OCI registry: uds inspect oci://localhost:5000/<name>:<tag> --insecure
  2. From your local filesystem: uds inspect uds-bundle-<name>.tar.zst

Viewing SBOMs

There are 2 additional flags for the uds inspect command you can use to extract and view SBOMs:

  • Output the SBOMs as a tar file: uds inspect ... --sbom
  • Output SBOMs into a directory as files: uds inspect ... --sbom --extract

This functionality will use the sboms.tar of the underlying Zarf packages to create new a bundle-sboms.tar artifact containing all SBOMs from the Zarf packages in the bundle.

Bundle Publish

Local bundles can be published to an OCI registry like so: uds publish <bundle>.tar.zst oci://<registry>

As an example: uds publish uds-bundle-example-arm64-0.0.1.tar.zst oci://ghcr.io/github_user

Variables

Zarf package variables can be passed between Zarf packages:

kind: UDSBundle
metadata:
  name: simple-vars
  description: show how vars work
  version: 0.0.1

zarf-packages:
  - name: output-var
    repository: localhost:888/output-var
    ref: 0.0.1
    exports:
      - name: OUTPUT
  - name: receive-var
    repository: localhost:888/receive-var
    ref: 0.0.1
    imports:
      - name: OUTPUT
        package: output-var

Variables that you want to make available to other package are in the export block of the Zarf package to export a variable from. To have another package ingest an exported variable, use the imports key to name both the variable and package that the variable is exported from.

In the example above, the OUTPUT variable is created as part of a Zarf Action in the output-var package, and the receive-var package expects a variable called OUTPUT.

Variable Precedence and Specificity

In a bundle, variables can come from 3 sources. Those sources and their precedence are shown below in order of least to most specificity:

  • Variables declared in a Zarf pkg
  • Variables import'ed from a bundle package's export
  • Variables declared in uds-config.yaml

That is to say, deploy-time variables declared in uds-config.yaml take precedence over all other variable sources.

Bundle Anatomy

A UDS Bundle is an OCI artifact with the following form:

uds-cli's People

Contributors

unclegedd avatar renovate[bot] avatar corang avatar decleaver avatar jeff-mccoy avatar kirankt avatar zachariahmiller avatar anthonywendt avatar andrewg-xyz avatar mikevanhemert avatar tristanholaday avatar racer159 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.