Skip to content

Commit

Permalink
Merge branch 'main' into renovate/github.com-defenseunicorns-uds-secu…
Browse files Browse the repository at this point in the history
…rity-hub-0.x
  • Loading branch information
UncleGedd authored Sep 19, 2024
2 parents e1f1b7b + 1353dfd commit 270f2b9
Show file tree
Hide file tree
Showing 28 changed files with 646 additions and 215 deletions.
2 changes: 1 addition & 1 deletion .github/actions/install-uds-cli/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ runs:
using: composite
steps:
- name: Set up Homebrew
uses: Homebrew/actions/setup-homebrew@b436f63110d42d5dba536c12dadb975210e98c5a # master
uses: Homebrew/actions/setup-homebrew@c4fb4dcc8c58d57ae2e382a04d5444995c9c1917 # master

- name: Install UDS CLI
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:

- name: Get Brew tap repo token
id: brew-tap-token
uses: actions/create-github-app-token@3378cda945da322a8db4b193e19d46352ebe2de5 # v1.10.4
uses: actions/create-github-app-token@5d869da34e18e7287c1daad50e0b8ea0f506ce69 # v1.11.0
with:
app-id: ${{ secrets.HOMEBREW_TAP_WORKFLOW_GITHUB_APP_ID }}
private-key: ${{ secrets.HOMEBREW_TAP_WORKFLOW_GITHUB_APP_SECRET }}
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/test-schema-and-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ jobs:
- name: Install UDS CLI
uses: ./.github/actions/install-uds-cli

- name: Pull UDS Runtime binary
run: ./hack/update-uds-runtime-binaries.sh uds-runtime-linux-amd64

- name: Test schemas
run: uds run schema:test

Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/test-unit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ jobs:
- name: Install UDS CLI
uses: ./.github/actions/install-uds-cli

- name: Pull UDS Runtime binary
run: ./hack/update-uds-runtime-binaries.sh uds-runtime-linux-amd64

- name: Run unit tests
run: uds run test:unit

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,4 @@ tmp/
out.txt
*.gif
*.mp4
src/cmd/bin
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ We strive to test all changes made to UDS CLI. If you're adding a new feature or
#### Unit Tests
Unit tests reside alongside the source code in a `*_test.go` file. These tests should be used to test individual functions or methods in isolation. Unit tests should be fast and focused on a single piece of functionality.

In order to run the unit tests in `src/cmd`, you must ensure that you have pulled the UDS Runtime binary into the `src/cmd/bin` dir. This can be done by running the `./hack/update-uds-runtime-binaries.sh` script or by running the build task for your os/architectecture (eg. `uds run build-cli-mac-apple`).

#### E2E Tests
E2E tests reside in the `src/test/e2e` directory. They use bundles located in the `src/test/e2e/bundles` which contain Zarf packages from the `src/test/e2e/packages` directory. Feel free to add new bundles and packages where appropriate. It's encouraged to write comments/metadata in any new bundles or packages to explain what they are testing.

Expand Down
29 changes: 29 additions & 0 deletions design-docs/0002-uds-ui.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# UDS UI

Author(s): @decleaver
Date Created: Sept 9, 2024
Status: IMPLEMENTED
Ticket: https://github.com/defenseunicorns/uds-cli/issues/870

### Problem Statement

The goal of the `uds ui` command is to allow uds-cli users to launch the UDS Runtime application from the command line.

### Proposal

Bundle the UDS Runtime binaries as a part of uds-cli allowing users to launch UDS Runtime from the command line.

### Scope and Requirements

Allow users to launch UDS Runtime locally from uds-cli. When running UDS Runtime locally, API token authentication is required. This is implemented programmatically and is transparent to the user.

### Implementation Details

To execute UDS Runtime from uds-cli, the appropriate runtime binary is pulled into the `src/cmd/bin` directory during the uds-cli build process. This is based on the specific build task being run (e.g., `build-cli-linux-arm`). The runtime binary is then packaged with the uds-cli binary.

To ensure the `uds ui` command works correctly, the uds-cli must be built using the build tasks specified in `tasks.yaml`. If not, the runtime binary might be missing, causing the `uds ui` command to fail.

### Alternatives Considered

1. Save runtime binaries directly in the uds-cli repo to avoid having to pull at build time. This approach was discarded because it adds extra size and complexity to the uds-cli repo
2. Vendor UDS Runtime in uds-cli. This approach was discarded because although the Runtime backend can be vendored, it required static assets from the frontend which would need to be embedded in the uds-cli binary, thus negating the benefits of vendoring.
48 changes: 48 additions & 0 deletions design-docs/template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Design Doc Title

Author(s): <@Your Name Here>
Date Created: Mar 13, 2024
Status: DRAFT | REVIEW | APPROVED | IMPLEMENTED
Ticket: <link to ticket>
Reviews Requested By: Mm DD, YYYY

### Problem Statement

Give background to the reader about the problem being solved and why a change is necessary. There should be adequate information here for a person with minimal context to understand the author's motivation for creating the document.

### Proposal

Briefly outline the proposed solution and explain how it will solve the problem mentioned in the background section.

### Scope and Requirements

Explicitly outline any project requirements that must be solved by the solution.

### Implementation Details

Expand upon the implementation details here. Draw the reader's attention to:

* Changes to existing systems.
* Creation of new systems.
* Impacts to the customer.
* Include code samples where possible.

### Metrics & Alerts

List any Metrics / Alerts that you plan to include in the system design

### Alternatives Considered

List any alternative solutions considered and how the proposed solution is a better fit.

### Non-Goals

List out anything that may be related to the solution, but won't be covered by this solution.

### Future Improvements:

List out anything that won't be included in this version of the feature/solution, but could be revisited or iterated upon in the future.

### Other Considerations:

List anything else that won't be solved by the solution
1 change: 1 addition & 0 deletions docs/command-reference/uds.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,6 @@ uds COMMAND [flags]
* [uds pull](/cli/command-reference/uds_pull/) - Pull a bundle from a remote registry and save to the local file system
* [uds remove](/cli/command-reference/uds_remove/) - Remove a bundle that has been deployed already
* [uds run](/cli/command-reference/uds_run/) - Run a task using maru-runner
* [uds ui](/cli/command-reference/uds_ui/) - [beta] Launch UDS Runtime and view UI
* [uds version](/cli/command-reference/uds_version/) - Shows the version of the running UDS-CLI binary

37 changes: 37 additions & 0 deletions docs/command-reference/uds_ui.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
title: uds ui
description: UDS CLI command reference for <code>uds ui</code>.
type: docs
---
## uds ui

[beta] Launch UDS Runtime and view UI

```
uds ui [flags]
```

### Options

```
-h, --help help for ui
```

### Options inherited from parent commands

```
-a, --architecture string Architecture for UDS bundles and Zarf packages
--insecure Allow access to insecure registries and disable other recommended security enforcements such as package checksum and signature validation. This flag should only be used if you have a specific reason and accept the reduced security posture.
-l, --log-level string Log level when running UDS-CLI. Valid options are: warn, info, debug, trace (default "info")
--no-color Disable color output
--no-log-file Disable log file creation
--no-progress Disable fancy UI progress bars, spinners, logos, etc
--oci-concurrency int Number of concurrent layer operations to perform when interacting with a remote bundle. (default 3)
--tmpdir string Specify the temporary directory to use for intermediate files
--uds-cache string Specify the location of the UDS cache directory (default "~/.uds-cache")
```

### SEE ALSO

* [uds](/cli/command-reference/uds/) - CLI for UDS Bundles

4 changes: 4 additions & 0 deletions docs/quickstart-and-usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -509,3 +509,7 @@ uds scan --org <organization> --package-name <package-name> --tag <tag> [options
```sh
uds scan -o defenseunicorns -n packages/uds/gitlab-runner -g 16.10.0-uds.0-upstream -u docker-username -p docker-password -f gitlab-runner.csv
```

## UDS Runtime

The `uds ui` command launches UDS Runtime, which provides a web-based user interface to view what is running in your K8s cluster. More information regarding UDS Runtime can be found [here](https://github.com/defenseunicorns/uds-runtime).
66 changes: 33 additions & 33 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ require (
github.com/spf13/viper v1.19.0
github.com/stretchr/testify v1.9.0
github.com/zarf-dev/zarf v0.39.0
golang.org/x/exp v0.0.0-20240823005443-9b4947da3948
golang.org/x/mod v0.20.0
golang.org/x/exp v0.0.0-20240909161429-701f63a606c0
golang.org/x/mod v0.21.0
golang.org/x/sync v0.8.0
helm.sh/helm/v3 v3.15.4
helm.sh/helm/v3 v3.16.1
k8s.io/api v0.31.0
k8s.io/apimachinery v0.31.0
k8s.io/client-go v0.31.0
Expand All @@ -46,7 +46,7 @@ require (
cloud.google.com/go/storage v1.42.0 // indirect
cuelabs.dev/go/oci/ociregistry v0.0.0-20231103182354-93e78c079a13 // indirect
cuelang.org/go v0.7.0 // indirect
dario.cat/mergo v1.0.0 // indirect
dario.cat/mergo v1.0.1 // indirect
filippo.io/edwards25519 v1.1.0 // indirect
github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 // indirect
github.com/AdamKorcz/go-118-fuzz-build v0.0.0-20230306123547-8075edf89bb0 // indirect
Expand All @@ -73,8 +73,8 @@ require (
github.com/MakeNowJust/heredoc v1.0.0 // indirect
github.com/Masterminds/goutils v1.1.1 // indirect
github.com/Masterminds/semver v1.5.0 // indirect
github.com/Masterminds/semver/v3 v3.2.1 // indirect
github.com/Masterminds/sprig/v3 v3.2.3 // indirect
github.com/Masterminds/semver/v3 v3.3.0 // indirect
github.com/Masterminds/sprig/v3 v3.3.0 // indirect
github.com/Masterminds/squirrel v1.5.4 // indirect
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/Microsoft/hcsshim v0.11.4 // indirect
Expand Down Expand Up @@ -152,7 +152,7 @@ require (
github.com/buildkite/interpolate v0.0.0-20200526001904-07f35b4ae251 // indirect
github.com/cenkalti/backoff/v3 v3.2.2 // indirect
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/chai2010/gettext-go v1.0.2 // indirect
github.com/charmbracelet/bubbles v0.16.1 // indirect
github.com/charmbracelet/bubbletea v0.25.0 // indirect
Expand All @@ -176,7 +176,7 @@ require (
github.com/coreos/go-oidc/v3 v3.11.0 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect
github.com/cyberphone/json-canonicalization v0.0.0-20231011164504-785e29786b46 // indirect
github.com/cyphar/filepath-securejoin v0.2.4 // indirect
github.com/cyphar/filepath-securejoin v0.3.1 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/daviddengcn/go-colortext v1.0.0 // indirect
github.com/defenseunicorns/pkg/helpers v1.1.1 // indirect
Expand Down Expand Up @@ -205,7 +205,7 @@ require (
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
github.com/emicklei/proto v1.12.1 // indirect
github.com/emirpasic/gods v1.18.1 // indirect
github.com/evanphx/json-patch v5.7.0+incompatible // indirect
github.com/evanphx/json-patch v5.9.0+incompatible // indirect
github.com/evanphx/json-patch/v5 v5.9.0 // indirect
github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d // indirect
github.com/facebookincubator/nvdtools v0.1.5 // indirect
Expand Down Expand Up @@ -292,7 +292,7 @@ require (
github.com/hashicorp/go-version v1.7.0 // indirect
github.com/hashicorp/hcl v1.0.1-vault-5 // indirect
github.com/hashicorp/vault/api v1.14.0 // indirect
github.com/huandu/xstrings v1.4.0 // indirect
github.com/huandu/xstrings v1.5.0 // indirect
github.com/iancoleman/orderedmap v0.0.0-20190318233801-ac98e3ecb4b0 // indirect
github.com/iancoleman/strcase v0.3.0 // indirect
github.com/imdario/mergo v0.3.16 // indirect
Expand All @@ -306,7 +306,7 @@ require (
github.com/jinzhu/inflection v1.0.0 // indirect
github.com/jinzhu/now v1.1.5 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/jmoiron/sqlx v1.3.5 // indirect
github.com/jmoiron/sqlx v1.4.0 // indirect
github.com/jonboulle/clockwork v0.4.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
Expand Down Expand Up @@ -393,15 +393,15 @@ require (
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/prometheus/client_golang v1.19.1 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.48.0 // indirect
github.com/prometheus/common v0.55.0 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
github.com/protocolbuffers/txtpbfmt v0.0.0-20231025115547-084445ff1adf // indirect
github.com/rakyll/hey v0.1.4 // indirect
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/rs/zerolog v1.32.0 // indirect
github.com/rubenv/sql-migrate v1.5.2 // indirect
github.com/rubenv/sql-migrate v1.7.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/ryanuber/go-glob v1.0.0 // indirect
github.com/saferwall/pe v1.4.8 // indirect
Expand All @@ -416,7 +416,7 @@ require (
github.com/segmentio/ksuid v1.0.4 // indirect
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect
github.com/shibumi/go-pathspec v1.3.0 // indirect
github.com/shopspring/decimal v1.3.1 // indirect
github.com/shopspring/decimal v1.4.0 // indirect
github.com/sigstore/cosign/v2 v2.2.3 // indirect
github.com/sigstore/fulcio v1.4.3 // indirect
github.com/sigstore/rekor v1.3.4 // indirect
Expand All @@ -432,7 +432,7 @@ require (
github.com/sourcegraph/conc v0.3.0 // indirect
github.com/spdx/tools-golang v0.5.3 // indirect
github.com/spf13/afero v1.11.0 // indirect
github.com/spf13/cast v1.6.0 // indirect
github.com/spf13/cast v1.7.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/spiffe/go-spiffe/v2 v2.1.7 // indirect
github.com/stretchr/objx v0.5.2 // indirect
Expand Down Expand Up @@ -472,8 +472,8 @@ require (
go.mongodb.org/mongo-driver v1.13.1 // indirect
go.mozilla.org/pkcs7 v0.0.0-20210826202110-33d05740a352 // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.52.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.52.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.53.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0 // indirect
go.opentelemetry.io/otel v1.28.0 // indirect
go.opentelemetry.io/otel/metric v1.28.0 // indirect
go.opentelemetry.io/otel/sdk v1.28.0 // indirect
Expand All @@ -483,20 +483,20 @@ require (
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.27.0 // indirect
go4.org v0.0.0-20200411211856-f5505b9728dd // indirect
golang.org/x/crypto v0.26.0 // indirect
golang.org/x/net v0.28.0 // indirect
golang.org/x/crypto v0.27.0 // indirect
golang.org/x/net v0.29.0 // indirect
golang.org/x/oauth2 v0.21.0 // indirect
golang.org/x/sys v0.24.0 // indirect
golang.org/x/term v0.23.0 // indirect
golang.org/x/text v0.17.0 // indirect
golang.org/x/sys v0.25.0 // indirect
golang.org/x/term v0.24.0 // indirect
golang.org/x/text v0.18.0 // indirect
golang.org/x/time v0.5.0 // indirect
golang.org/x/tools v0.24.0 // indirect
golang.org/x/tools v0.25.0 // indirect
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect
google.golang.org/api v0.187.0 // indirect
google.golang.org/genproto v0.0.0-20240624140628-dc46fd24d27d // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240624140628-dc46fd24d27d // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240624140628-dc46fd24d27d // indirect
google.golang.org/grpc v1.64.1 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094 // indirect
google.golang.org/grpc v1.65.0 // indirect
google.golang.org/protobuf v1.34.2 // indirect
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
Expand All @@ -506,15 +506,15 @@ require (
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
gorm.io/gorm v1.25.10 // indirect
k8s.io/apiextensions-apiserver v0.30.3 // indirect
k8s.io/apiserver v0.30.3 // indirect
k8s.io/cli-runtime v0.30.3 // indirect
k8s.io/component-base v0.30.3 // indirect
k8s.io/component-helpers v0.30.3 // indirect
k8s.io/apiextensions-apiserver v0.31.0 // indirect
k8s.io/apiserver v0.31.0 // indirect
k8s.io/cli-runtime v0.31.0 // indirect
k8s.io/component-base v0.31.0 // indirect
k8s.io/component-helpers v0.31.0 // indirect
k8s.io/klog/v2 v2.130.1 // indirect
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 // indirect
k8s.io/kubectl v0.30.3 // indirect
k8s.io/metrics v0.30.3 // indirect
k8s.io/kubectl v0.31.0 // indirect
k8s.io/metrics v0.31.0 // indirect
k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 // indirect
modernc.org/libc v1.29.0 // indirect
modernc.org/mathutil v1.6.0 // indirect
Expand All @@ -525,7 +525,7 @@ require (
sigs.k8s.io/controller-runtime v0.18.1 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/kustomize/api v0.17.3 // indirect
sigs.k8s.io/kustomize/kustomize/v5 v5.0.4-0.20230601165947-6ce0bf390ce3 // indirect
sigs.k8s.io/kustomize/kustomize/v5 v5.4.2 // indirect
sigs.k8s.io/kustomize/kyaml v0.17.2 // indirect
sigs.k8s.io/release-utils v0.7.7 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
Expand Down
Loading

0 comments on commit 270f2b9

Please sign in to comment.