Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit 70c0984
Author: UncleGedd <42304551+UncleGedd@users.noreply.github.com>
Date:   Wed Jul 31 21:42:01 2024 -0500

    chore: add release ci (#118)

commit c4016ca
Author: decleaver <85503726+decleaver@users.noreply.github.com>
Date:   Wed Jul 31 16:11:18 2024 -0600

    feat: swagger (#114)

    Using: https://github.com/swaggo

    Swaggo needs the api operation comments on each handler function, so I
    did need to add wrappers around the sse.Bind calls, and i added all of
    those in swagger.go

    Good News:
    - All the endpoints seem to work as expected
    Bad News:
    - Swagger doesn't seem to support text/event stream (so `once=true` must
    be set otherwise it just hangs)
    - can probably write some scripts to handle this but this would take a
    lot of customizing and we would probably lose autogen capabilities.
    - Swaggo currently doesnt support OpenApi v3 (currently being "slowly"
    in their v2 branch)
    - most of the suggestions I've seen for goloang and OpenApi v3 say to
    use [huma](https://huma.rocks/) rest api framework 😞

     I think this is ok for now, but we will want to revisit longterm.

commit 983ae6a
Author: Megamind <882485+jeff-mccoy@users.noreply.github.com>
Date:   Wed Jul 31 16:02:26 2024 -0500

    feat(ui): add toast for status messages (#116)

    Add the ability to create toast messages using `addToast()` to write to
    a common store

    - #115

commit 98916d6
Author: UncleGedd <42304551+UncleGedd@users.noreply.github.com>
Date:   Wed Jul 31 15:54:08 2024 -0500

    feat(ui): format age with more detail (#111)

    Formats age to be prettier

    - #66

commit cad4f35
Author: UncleGedd <42304551+UncleGedd@users.noreply.github.com>
Date:   Wed Jul 31 08:03:28 2024 -0500

    feat(ui): adds validatingwebhooks view (#110)

    Adds validatingwebhooks view

commit 27d7433
Author: Megamind <882485+jeff-mccoy@users.noreply.github.com>
Date:   Tue Jul 30 16:04:40 2024 -0500

    feat(api): debounce SSE messages (#100)

    Limits the streaming API to at most 1 re-list per-second

    - #88 and PR #92

commit d7c0bee
Author: schristoff <28318173+schristoff@users.noreply.github.com>
Date:   Tue Jul 30 14:56:24 2024 -0600

    chore: update zarf (#99)

commit 24b24b0
Author: Billy Figueroa <billy@defenseunicorns.com>
Date:   Tue Jul 30 05:16:02 2024 -0400

    feat(ui): adding 404 (#98)
    Adding 404 page

    - #38

commit a55696d
Author: Billy Figueroa <billy@defenseunicorns.com>
Date:   Tue Jul 30 03:45:30 2024 -0400

    feat(ui): add cluster ops hpa k8s view (#97)
    Adding cluster ops HPAs view

    - #46

commit 6af3a95
Author: UncleGedd <42304551+UncleGedd@users.noreply.github.com>
Date:   Mon Jul 29 16:32:00 2024 -0500

    feat: enables uds-runtime releases (#93)

    Co-authored-by: Megamind <882485+jeff-mccoy@users.noreply.github.com>

commit 5370bf9
Author: Billy Figueroa <billy@defenseunicorns.com>
Date:   Mon Jul 29 14:56:36 2024 -0400

    feat(ui): adding cluster ops resource quotas view (#81)
  • Loading branch information
jeff-mccoy committed Aug 1, 2024
1 parent 33e781f commit 9160bde
Show file tree
Hide file tree
Showing 59 changed files with 8,620 additions and 113 deletions.
4 changes: 2 additions & 2 deletions .air.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ tmp_dir = "build"

[build]
args_bin = []
bin = "./build/main"
cmd = "go build -o ./build/main main.go"
bin = "./build/uds-runtime"
cmd = "go build -o ./build/uds-runtime main.go"
delay = 2000
exclude_dir = ["assets", "build", "vendor", "testdata", "ui", "docs", "hack", "tasks"]
exclude_file = []
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/setup/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ runs:
shell: bash
run: |
brew tap defenseunicorns/tap
brew install uds@0.12.0
brew install uds@0.14.0
- name: Install k3d
shell: bash
Expand Down
43 changes: 43 additions & 0 deletions .github/workflows/tag-and-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Release UDS Runtime

on:
push:
branches:
- main

jobs:
tag-new-version:
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.release-flag.outputs.release_created }}
release_tag: ${{ steps.release-tag.outputs.release_tag }}
steps:
- name: Create Release Tag
id: tag
uses: googleapis/release-please-action@7987652d64b4581673a76e33ad5e98e3dd56832f # v4.1.3
- id: release-flag
run: echo "release_created=${{ steps.tag.outputs.release_created || false }}" >> $GITHUB_OUTPUT
- id: release-tag
run: echo "release_tag=${{ steps.tag.outputs.version || false }}" >> $GITHUB_OUTPUT

release:
permissions:
contents: read
packages: write
needs: tag-new-version
if: ${{ needs.tag-new-version.outputs.release_created == 'true'}}
runs-on: ubuntu-latest
steps:

- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: Setup Environment (Go, Node, Homebrew, UDS CLI, k3d)
uses: ./.github/actions/setup

- name: Publish
run: |
uds run build:publish-uds-runtime
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,6 @@ vite.config.ts.timestamp-*
/ui/test-results

# Dev
/zarf-sbom
zarf-sbom
tmp/
*.tar.zst
1 change: 1 addition & 0 deletions .yamllint
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ ignore:
- 'node_modules/**'
- 'dist/**'
- 'ui/node_modules/**'
- 'pkg/api/docs/**'

rules:
anchors: enable
Expand Down
16 changes: 16 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM cgr.dev/chainguard/static:latest

# grab auto platform arg
ARG TARGETARCH

# 65532 is the UID of the `nonroot` user in chainguard/static.
# See: https://edu.chainguard.dev/chainguard/chainguard-images/reference/static/overview/#users
USER 65532:65532

# copy binary from local and expose port
COPY --chown=65532:65532 build/uds-runtime-${TARGETARCH} /app/uds-runtime
ENV PORT=8080
EXPOSE 8080

# run binary
CMD ["./app/uds-runtime"]
23 changes: 23 additions & 0 deletions chart/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
24 changes: 24 additions & 0 deletions chart/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: v2
name: uds-runtime
description: A Helm chart for Kubernetes

# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "0.1.0"
13 changes: 13 additions & 0 deletions chart/templates/cluster-role-binding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: uds-runtime-cluster-role-binding
namespace: {{ .Release.Namespace }}
subjects:
- kind: ServiceAccount
name: uds-runtime-sa
namespace: {{ .Release.Namespace }}
roleRef:
kind: ClusterRole
name: uds-runtime-cluster-role
apiGroup: rbac.authorization.k8s.io
9 changes: 9 additions & 0 deletions chart/templates/cluster-role.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: uds-runtime-cluster-role
namespace: {{ .Release.Namespace }}
rules:
- apiGroups: ["*"]
resources: ["*"]
verbs: ["get", "list", "watch"]
29 changes: 29 additions & 0 deletions chart/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: uds-runtime
namespace: {{ .Release.Namespace }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app: uds-runtime
template:
metadata:
labels:
app: uds-runtime
spec:
serviceAccountName: uds-runtime-sa
containers:
- name: uds-runtime
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- containerPort: 8080
resources:
requests:
memory: "128Mi"
cpu: "250m"
limits:
memory: "512Mi"
cpu: "750m"
13 changes: 13 additions & 0 deletions chart/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: v1
kind: Service
metadata:
name: uds-runtime
namespace: {{ .Release.Namespace }}
spec:
selector:
app: uds-runtime
ports:
- protocol: TCP
port: 8080
targetPort: 8080
type: ClusterIP
5 changes: 5 additions & 0 deletions chart/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: uds-runtime-sa
namespace: {{ .Release.Namespace }}
20 changes: 20 additions & 0 deletions chart/templates/uds-package.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: uds.dev/v1alpha1
kind: Package
metadata:
name: uds-runtime
namespace: {{ .Release.Namespace }}
spec:
network:
expose:
- service: uds-runtime
selector:
app: uds-runtime
host: runtime
gateway: tenant
port: 8080
targetPort: 8080
allow:
- direction: Egress
selector:
app: uds-runtime
remoteGenerated: KubeAPI
7 changes: 7 additions & 0 deletions chart/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
replicaCount: 1
image:
repository: ghcr.io/defenseunicorns/uds-runtime
# x-release-please-start-version
tag: 0.1.0-alpha.1
# x-release-please-end
pullPolicy: Always
23 changes: 15 additions & 8 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
module github.com/defenseunicorns/uds-runtime

go 1.22.4
go 1.22.5

require (
github.com/charmbracelet/lipgloss v0.12.1
github.com/defenseunicorns/zarf v0.36.1
github.com/go-chi/chi/v5 v5.1.0
github.com/stretchr/testify v1.9.0
github.com/swaggo/http-swagger/v2 v2.0.2
github.com/swaggo/swag v1.16.3
github.com/zarf-dev/zarf v0.37.0
k8s.io/api v0.30.3
k8s.io/apimachinery v0.30.3
k8s.io/client-go v0.30.3
Expand All @@ -17,6 +19,7 @@ require (
atomicgo.dev/cursor v0.2.0 // indirect
atomicgo.dev/keyboard v0.2.9 // indirect
atomicgo.dev/schedule v0.1.0 // indirect
github.com/KyleBanks/depth v1.2.1 // indirect
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
github.com/bahlo/generic-list-go v0.2.0 // indirect
github.com/buger/jsonparser v1.1.1 // indirect
Expand All @@ -28,9 +31,10 @@ require (
github.com/evanphx/json-patch v5.7.0+incompatible // indirect
github.com/fatih/color v1.16.0 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-openapi/jsonpointer v0.20.2 // indirect
github.com/go-openapi/jsonreference v0.20.4 // indirect
github.com/go-openapi/swag v0.22.9 // indirect
github.com/go-openapi/jsonpointer v0.21.0 // indirect
github.com/go-openapi/jsonreference v0.21.0 // indirect
github.com/go-openapi/spec v0.21.0 // indirect
github.com/go-openapi/swag v0.23.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/gnostic-models v0.6.9-0.20230804172637-c7be7c783f49 // indirect
Expand Down Expand Up @@ -59,17 +63,20 @@ require (
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/pterm/pterm v0.12.78 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/rogpeppe/go-internal v1.12.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/stretchr/objx v0.5.2 // indirect
github.com/swaggo/files/v2 v2.0.1 // indirect
github.com/wk8/go-ordered-map/v2 v2.1.8 // indirect
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
golang.org/x/net v0.26.0 // indirect
golang.org/x/net v0.27.0 // indirect
golang.org/x/oauth2 v0.21.0 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/sys v0.21.0 // indirect
golang.org/x/term v0.21.0 // indirect
golang.org/x/sys v0.22.0 // indirect
golang.org/x/term v0.22.0 // indirect
golang.org/x/text v0.16.0 // indirect
golang.org/x/time v0.5.0 // indirect
golang.org/x/tools v0.23.0 // indirect
google.golang.org/protobuf v1.34.2 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
Expand Down
Loading

0 comments on commit 9160bde

Please sign in to comment.