Skip to content

Commit

Permalink
chore: migrates runner to maru-runner repo
Browse files Browse the repository at this point in the history
  • Loading branch information
UncleGedd committed Mar 4, 2024
1 parent dc3576d commit 0de4186
Show file tree
Hide file tree
Showing 10 changed files with 66 additions and 883 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
1. [Zarf Integration](#zarf-integration)
1. [Bundle Overrides](docs/overrides.md)
1. [Bundle Anatomy](docs/anatomy.md)
1. [UDS Runner](docs/runner.md)
1. [Runner](docs/runner.md)

## Install
Recommended installation method is with Brew:
Expand Down
13 changes: 12 additions & 1 deletion adr/0002-runner.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Date: 1 Feb 2024

## Status
Accepted
[AMENDED](#amendment-1)

## Context

Expand All @@ -25,3 +25,14 @@ After quickly gaining adoption across the organization, we have decided to make
## Consequences

The UDS CLI team will own the UDS Runner functionality and is responsible for maintaining it. Furthermore, because the UDS Runner uses Zarf, the UDS CLI team will contribute to upstream Zarf Actions and common library functionality to support UDS Runner.

# Amendment 1

Date: 1 March 2024

## Status

Accepted

## Context and Decision
In an effort to reduce the scope of UDS CLI and experiment with a new standalone project, the UDS Runner functionality will be moved to a new project tentatively named [maru-runner](https://github.com/defenseunicorns/maru-runner). This project will be maintained by the UDS CLI team for a short time but ownership will be eventually be transferred to a different team. Furthermore, UDS CLI will vendor the runner such that no breaking changes will be introduced for UDS CLI users.
3 changes: 3 additions & 0 deletions docs/runner.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# UDS Runner

TODO: refactor docs to point to run-run-run, but keep a quickstart here
- UDS_ vs RUN_

UDS runner enables UDS Bundle developers to automate UDS builds and perform common shell tasks. It
uses [Zarf](https://zarf.dev/) under the hood to perform tasks and shares a syntax similar to `zarf.yaml` manifests.
Many [Zarf Actions features](https://docs.zarf.dev/docs/create-a-zarf-package/component-actions) are also available in
Expand Down
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ go 1.21.6
require (
github.com/AlecAivazis/survey/v2 v2.3.7
github.com/alecthomas/jsonschema v0.0.0-20220216202328-9eeeec9d044b
github.com/defenseunicorns/maru-runner v0.0.1
github.com/defenseunicorns/zarf v0.32.4
github.com/fsnotify/fsnotify v1.7.0
github.com/goccy/go-yaml v1.11.3
github.com/mholt/archiver/v3 v3.5.1
github.com/mholt/archiver/v4 v4.0.0-alpha.8
github.com/opencontainers/image-spec v1.1.0
github.com/pterm/pterm v0.12.78
github.com/pterm/pterm v0.12.79
github.com/spf13/cobra v1.8.0
github.com/spf13/viper v1.18.2
github.com/stretchr/testify v1.8.4
Expand Down
6 changes: 4 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/daviddengcn/go-colortext v1.0.0 h1:ANqDyC0ys6qCSvuEK7l3g5RaehL/Xck9EX8ATG8oKsE=
github.com/daviddengcn/go-colortext v1.0.0/go.mod h1:zDqEI5NVUop5QPpVJUxE9UO10hRnmkD5G4Pmri9+m4c=
github.com/defenseunicorns/maru-runner v0.0.1 h1:0SPiaXbPKnv7bjsUW2f7rPiIMmd3YLfT9+wQe4810K8=
github.com/defenseunicorns/maru-runner v0.0.1/go.mod h1:3K+JeLpud+rb8vC+nPFaTNjhqW40++6qFKKVTBEEzQM=
github.com/defenseunicorns/zarf v0.32.4 h1:3foCaUHUtAu8YId49j3u+EVknaTB8ERaQ9J6Do+bAwc=
github.com/defenseunicorns/zarf v0.32.4/go.mod h1:f4H7al7qnj5VXfkUkB/CcepVW/DA/O5tvAy8TWv9aT8=
github.com/deitch/magic v0.0.0-20230404182410-1ff89d7342da h1:ZOjWpVsFZ06eIhnh4mkaceTiVoktdU67+M7KDHJ268M=
Expand Down Expand Up @@ -1456,8 +1458,8 @@ github.com/pterm/pterm v0.12.31/go.mod h1:32ZAWZVXD7ZfG0s8qqHXePte42kdz8ECtRyEej
github.com/pterm/pterm v0.12.33/go.mod h1:x+h2uL+n7CP/rel9+bImHD5lF3nM9vJj80k9ybiiTTE=
github.com/pterm/pterm v0.12.36/go.mod h1:NjiL09hFhT/vWjQHSj1athJpx6H8cjpHXNAK5bUw8T8=
github.com/pterm/pterm v0.12.40/go.mod h1:ffwPLwlbXxP+rxT0GsgDTzS3y3rmpAO1NMjUkGTYf8s=
github.com/pterm/pterm v0.12.78 h1:QTWKaIAa4B32GKwqVXtu9m1DUMgWw3VRljMkMevX+b8=
github.com/pterm/pterm v0.12.78/go.mod h1:1v/gzOF1N0FsjbgTHZ1wVycRkKiatFvJSJC4IGaQAAo=
github.com/pterm/pterm v0.12.79 h1:lH3yrYMhdpeqX9y5Ep1u7DejyHy7NSQg9qrBjF9dFT4=
github.com/pterm/pterm v0.12.79/go.mod h1:1v/gzOF1N0FsjbgTHZ1wVycRkKiatFvJSJC4IGaQAAo=
github.com/rakyll/hey v0.1.4 h1:hhc8GIqHN4+rPFZvkM9lkCQGi7da0sINM83xxpFkbPA=
github.com/rakyll/hey v0.1.4/go.mod h1:nAOTOo+L52KB9SZq/M6J18kxjto4yVtXQDjU2HgjUPI=
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM=
Expand Down
26 changes: 25 additions & 1 deletion src/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ import (
"runtime/debug"
"strings"

runnerCLI "github.com/defenseunicorns/maru-runner/src/cmd"
runnerConfig "github.com/defenseunicorns/maru-runner/src/config"

"github.com/defenseunicorns/uds-cli/src/config"
"github.com/defenseunicorns/uds-cli/src/config/lang"
"github.com/defenseunicorns/uds-cli/src/pkg/utils"
Expand Down Expand Up @@ -75,7 +78,7 @@ func init() {
}
}

// only vendor zarf if specifically invoked
// vendored Zarf command
if len(os.Args) > 1 && (os.Args[1] == "zarf" || os.Args[1] == "z") {
zarfCmd := &cobra.Command{
Use: "zarf COMMAND",
Expand All @@ -93,6 +96,27 @@ func init() {
return
}

// vendored run command
if len(os.Args) > 1 && (os.Args[1] == "run" || os.Args[1] == "r") {
runnerCmd := &cobra.Command{
Use: "run",
Aliases: []string{"r"},
Run: func(_ *cobra.Command, _ []string) {
os.Args = os.Args[1:] // grab 'run' and onward from the CLI args
runnerConfig.CmdPrefix = "uds" // use vendored Zarf inside the runner
runnerConfig.EnvPrefix = "uds"
runnerCLI.RootCmd().SetArgs(os.Args)
runnerCLI.Execute()
},
DisableFlagParsing: true,
}
rootCmd.AddCommand(runnerCmd)

// disable UDS log file for the runner because the runner has its own log file
config.SkipLogFile = true
return
}

initViper()

v.SetDefault(V_LOG_LEVEL, "info")
Expand Down
101 changes: 0 additions & 101 deletions src/cmd/run.go

This file was deleted.

Loading

0 comments on commit 0de4186

Please sign in to comment.