Skip to content

Commit

Permalink
Simple package orchestration (kptdev#2663)
Browse files Browse the repository at this point in the history
Remove Placeholder kptlib (kptdev#2665)

* Fix Makefile Formatting

* Remove dependency on kptlib
* Tidy modules
* Delete kptlib
* Remove kptlib replace Clause

Add Porch Workflow

Implement Direct Package Fetch (kptdev#2667)

* Update VSCode Workspace
* Add launch.json
* Move Clone Logic Into Own File
* Implement Git pacakge fetch

Initial fn Interface (kptdev#2676)

Initial version of the function interfaces.

Upgrade go-containerregistry to v0.8.0 (kptdev#2674)

* Tidy Porch Modules
* Ignore Modules In .build Directory

Porch

git: handle resolution of per-package versions (kptdev#2681)

We can have a git tag that looks like `packageDir/version`, this
allows for independent versioning of packages that share a git repo.

We need to try both ref forms when resolving git packages.

PackageDraft interface should not inherit from Package (kptdev#2678)

In particular, some of the methods such as GetResources are ambiguous
until we finish the draft (do we want the in-progress resources or the
upstream resources?)

Minor fixups to better surface errors (kptdev#2680)

In general, we should always return the error, unless we actually want
to mask it e.g. for security reasons (and in that case, we would
normally expect to log the underlying error instead of wrapping).

Clean up Makefile (kptdev#2685)

* Remove init and deinit (no longer useful)
* Fix module discovery
* Clean up directory references

Render and Eval via Simple Memory FS (kptdev#2684)

* Render and Eval via Simple Memory FS
  For now the filesystem is inserted at lower level; In future changes
  the mutation Apply will accept the filesystem abstraction to avoid
  back-and-forth between filesystem and PackageResources.
* Clean up Function Evaluation to use new interface
* Remove unnecessary kpt module

Working towards applying packages from a repository (kptdev#2686)

First steps (with lots of hard-coding and hacks) towards applying from
a repository to a cluster.

Add priority and fairness to RBAC roles (kptdev#2692)

aggregated-apiservers seem to query these resources, and spam the logs
(at least) if they don't have permission.

Applying: publish MVP status (kptdev#2695)

We start to expose the status of the sync operation.

Fix Docker Build (kptdev#2696)

Remove kpt directory from Docker build.

Tidy Go Modules (kptdev#2699)

* Fix Go Modules

* Run Tidy in Porch Workflow

Add Roundtrip Tests (kptdev#2703)

Expose Renderer api with FileSystem abstraction (kptdev#2683)

* Expose Renderer api with FileSystem abstraction

* Merge Fs methods in pkg.go

* Update name

* Merge ReadKptfile and address changes

* Update porch go.sum

* Update results write

* Suggested changes

Porch

Create fix-all and verify-fix-all (kptdev#2702)

* Create fix-all and verify-fix-all

We run all the formatters / header makers etc.

In CI, we run them and make sure that the git checkout is still clean.

Ideally we would also run generate, but it is very slow, and it also
requires GOPATH to be set.  We can do that in CI later.

* Add missing headers

Fix few file headers (kptdev#2707)

Define a FunctionEvaluator gRPC Interface (kptdev#2700)

* Add install-protoc.sh script
* Define a FunctionEvaluator interface
* Create an empty server implementation

Integrate porch with renderer interface (kptdev#2710)

* Integrate porch with renderer interview

* Suggested changes

* Add implementation

Porch

Introduce applyset abstraction (kptdev#2697)

Replacing our very primitive apply logic with something better using
server-side apply.

Git repository test (kptdev#2706)

We create a simple git server, and we try round-tripping a package.

Some hacks/todos uncovered that we need to tackle.

Create Kptfile in config/deploy (kptdev#2708)

Our package logic requires a Kptfile, so adding one (for now).

Update FunctionRunner Interface (kptdev#2714)

And make names more consistent.

Simple gRPC kpt function runner service (kptdev#2711)

Several functions are built into the server Docker image and are exec'd
with input.
Added simple client which can be used (in ./func directory):

```
go run ./client \
  --address=192.168.8.202:9445 \
  --package=./config/ \
  --image=gcr.io/kpt-fn/set-namespace:v0.2.0 \
  -- \
  namespace=foo
```

Use simple evaluator in tests (kptdev#2717)

This avoids dependency on docker in unit tests.
The price is that the simple functions don't support full semantics,
but they also run much faster.

Fix os calls (kptdev#2718)

git: create ApprovePackageRevision method, remove draft hack (kptdev#2712)

* git: create ApprovePackageRevision method, remove draft hack

Now that we can approve a package (in our tests at least), we can now
fetch the package on the non-draft ref.

* Update go-git to HEAD

We want to pick up go-git/go-git#325

Use apply-setters directly (kptdev#2719)

Upgrade kpt dependencies (kptdev#2727)

Use Lower-Level Function Runner Interface (kptdev#2730)

* Add capability to override function runner during fnrender
* Use Lower-Level Function Runner Interface
  The function framework operates at the level of IO streams so we need to
  use that in order to benefit from comment healing and other features.
* Fix tests to rely on files-on-disk.

Co-authored-by: droot <sunilarora@google.com>

Use kyaml In-Memory Filesystem (kptdev#2731)

Just noticed kyaml comes with in-memory filesystem implementation.
Use it instead of custom one.

Upgrade porch dependencies (kptdev#2726)

Remove direct dependency on deprecated kustomize/api package

Build Function Runner Docker Image (kptdev#2729)

tests: Fix test flake from timestamp sanitization (kptdev#2713) (kptdev#2742)

* Fix test flake from timestamp sanitization

When timestamps "overlap", sanitization did not work correctly.

For example:

in 1s ... in 2.1s

The first substitution would replace 1s => 0s

in 0s ... in 2.0s

The second substitution is predetermined, and replaces 2.1s => 0s, but
2.1s is no longer in the string.

* Use new sanitization function in tests, remove old function

Co-authored-by: Justin Santa Barbara <justinsb@google.com>

Porch

Create function-runner Deployment (kptdev#2733)

Use kpt Renderer in Porch (kptdev#2735)

* Use kpt Renderer in Porch
* Accept gRPC function runner endpoint

RemoteRootSyncSet: use specified OCI image (kptdev#2722)

Stop hard-coding and use the image the user specifies!

RemoteRootSyncSet: apply changes with force (kptdev#2723)

This lets us switch from client-side-applied to server-side-applied.

RemoteRootSyncSet: Remove hack where we set namespace (kptdev#2724)

It's now causing problems; we shouldn't need it and we should fix it
later in the logic anyway (with a default namespace).

Create push-images target to push all our images (kptdev#2721)

Also a few tweaks to make the porch image build faster.

Create dockerfile / makefile / manifest for pushing controllers to cluster (kptdev#2694)

This lets us start to run these on the server, instead of just locally.

Introduce mapTaskToMutation function (kptdev#2744)

This is a small refactor so that we can reuse this logic in future.

Fix kpt file system interactions (kptdev#2746)

* missing file.Close() call (filesys' memory filesystem doesn't support
  files opened multiple times)
* pass filesystem into newFnConfig (it reads fn config from file)

Porch

Pass Function Config to Eval (kptdev#2747)

* Move eval mutation into own file
* Pass Function Config to Eval
* Remove unused field (runner.fn)
* Move ConfigMap construction back to engine
* Eval preserves comments

Connect to gRPC function runner (kptdev#2745)

Fix crash (kptdev#2748)

If gRPC call fails, res is nill :(

Fix clone directory rewriting (kptdev#2749)

After changes to git cloning we return PackageResources with configs
at the "root directory". Therefore we don't need to rewrite config paths
anymore.

client generation: fix plural of packagerevisionresources (kptdev#2751)

The client was using packagerevisionresourceses (extra "es"), which
doesn't match the server name.

Update kpt dependencies (kptdev#2743)

* Upgrade dependencies
* Upgrade go to 1.17

Porch

Streamline Docker Image Building (kptdev#2752)

* Use the same naming pattern
* Enable nested Makefiles to inherit values from parent
* Enable explicit image tagging (i.e. using
  `IMAGE_TAG=$(git rev-parse --short HEAD) make build-images`
* Enable `make build-images` and `make push-images`

Run Porch With Consistent Working Dir (kptdev#2753)

`go run` doesn't support setting working directory; use `go build`
instead.

Add subpkgs test for porch (kptdev#2754)

* Add subpkgs test for porch

* Add runtime

Basic e2e Test (kptdev#2755)

* Basic e2e Test
* Simple harness to reduce some boilerplate
* Add a simple git repo test

Refactor Server Startup (kptdev#2770)

* Start background processing in Run function
* Shut down when stopCh is closed

Tidy in 1.17 compatible mode (kptdev#2769)

Occasionally `make tidy` fails complaining about 1.16 vs. 1.17 golang;
this should keep our mods 1.17 compatible with fewer `make tidy`
failures.

Create Engine using Options (kptdev#2771)

Create options for the common engine configuration options.

Support lazy credential resolution (kptdev#2772)

* Add CredentialResolver interface
* Add WithCredentialResolver engine option
* Use lazy credential resolution when interacting with Git

Pass Context to OpenRepository (kptdev#2773)

Use Context to Drive Server Shutdown (kptdev#2774)

Turns out k8s apiserver supports both and we can get the core context to
listen on instead of just getting the close channel.

Clean up Required/Optional API Fields (kptdev#2778)

Git branch and directory can be optional (defaulting to `main` and `/` respectively,
while `SecretRef.Name` is required since nameless secret reference is unhelpful.

Easier deployment onto GKE (kptdev#2776)

Support Creating Porch Deployment Config (kptdev#2777)

* Create `deployment-config` and `push-and-deploy` make targets
* Use kpt function to set images on the deployment config

Update Porch Deployment and Instructions (kptdev#2782)

* Set workload identity service accounts via set-annotations
* Simplify instructions
* Build at Git tag
* Combine Deployment Config in Same Directory
* Rename config files, assign 0 to CRDs.
* `kubectl apply` recursively just in case we add more config later

Use controller-gen v0.8.0 (kptdev#2780)

Use consistent version of controller-gen (v0.8.0)
crd:preserveUnknownFields marker has been removed (`false` was the
required value for v1 CRDs).

Set renderer when building CaDEngine (kptdev#2787)

Otherwise we crash when trying to render a package.

Fix missing error handling (kptdev#2784)

We weren't checking errors when building a CaDEngine.

Fix small typo (kptdev#2793)

Don't call into kpt render if we don't have a package (kptdev#2788)

When creating an empty package, we get an error otherwise (as kpt
render doesn't work if it doesn't have a package).

Porch

Split git_test To Use Git Server (kptdev#2797)

Enable e2e tests to use git server

Add CreatePackageRevision Test (kptdev#2800)

Simple test that creates a package by cloning from upstream repository.

Cache apply-setters:v0.1 function (kptdev#2799)

Some blueprints we encounter in tests use the older version of the function.

Return Git PackageRevisionResources Correctly (kptdev#2801)

Newly created Git package returned package resources at its old commit
SHA where no package contents existed, thus returning empty resources.
As package changes, advance the reference to return up-to-date package
revision contents.

Make Git Server hostable in cluster (kptdev#2798)

* Make Git Server hostable in cluster
* Add makefile targets to build and push its images

Add PackageRevision Approval API (kptdev#2810)

* Add PackageRevision .../approval subresource
* Generate client

Add Clone Package Test (kptdev#2807)

* Add Clone Package Test
* Fix issues with git server's reporting of symbolic references
  • Loading branch information
martinmaly committed Feb 18, 2022
1 parent 3d90e0e commit 4cce7a1
Show file tree
Hide file tree
Showing 267 changed files with 32,716 additions and 315 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/checkLicenses.yml
Expand Up @@ -21,10 +21,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Go 1.16
- name: Set up Go 1.17
uses: actions/setup-go@v1
with:
go-version: 1.16
go-version: 1.17
- run: |
./scripts/create-licenses.sh
# Upload the licenses list so it's available if needed
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2eEnvironment.yml
Expand Up @@ -33,7 +33,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.16
go-version: 1.17
- uses: actions/checkout@master
# Pinned to Commit to ensure action is consistent: https://docs.github.com/en/actions/learn-github-actions/security-hardening-for-github-actions#using-third-party-actions
# If you upgrade this version confirm the changes match your expectations
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/go.yml
Expand Up @@ -22,10 +22,10 @@ jobs:
name: Build
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.16
- name: Set up Go 1.17
uses: actions/setup-go@v1
with:
go-version: 1.16
go-version: 1.17
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/live-e2e.yml
Expand Up @@ -33,7 +33,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.16
go-version: 1.17
- uses: actions/checkout@master
# Pinned to Commit to ensure action is consistent: https://docs.github.com/en/actions/learn-github-actions/security-hardening-for-github-actions#using-third-party-actions
# If you upgrade this version confirm the changes match your expectations
Expand Down
48 changes: 48 additions & 0 deletions .github/workflows/porch.yml
@@ -0,0 +1,48 @@
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: Porch

on:
push:
paths-ignore:
- "docs/**"
- "site/**"
pull_request:
paths-ignore:
- "docs/**"
- "site/**"

jobs:
tests:
name: Porch Unit Tests
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.17
uses: actions/setup-go@v2
with:
go-version: 1.17.6
- name: Run Porch Unit Tests
uses: actions/checkout@v2
- name: Verify format / headers etc
run: hack/verify-fix-all.sh
working-directory: ./porch
- name: Build
run: make porch
working-directory: ./porch
- name: Test
run: make test
working-directory: ./porch
- name: Tidy
run: make tidy
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.16
go-version: 1.17
- name: Checkout
uses: actions/checkout@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/verifyContent.yml
Expand Up @@ -30,7 +30,7 @@ jobs:
steps:
- uses: actions/setup-go@v2
with:
go-version: 1.16
go-version: 1.17
- uses: actions/checkout@v2
- run: |
make build
Expand Down
108 changes: 92 additions & 16 deletions go.mod
@@ -1,29 +1,105 @@
module github.com/GoogleContainerTools/kpt

go 1.16
go 1.17

require (
github.com/cpuguy83/go-md2man/v2 v2.0.0
github.com/go-errors/errors v1.4.0
github.com/cpuguy83/go-md2man/v2 v2.0.1
github.com/go-errors/errors v1.4.2
github.com/google/go-cmp v0.5.7
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510
github.com/igorsobreira/titlecase v0.0.0-20140109233139-4156b5b858ac
github.com/otiai10/copy v1.6.0
github.com/otiai10/copy v1.7.0
github.com/philopon/go-toposort v0.0.0-20170620085441-9be86dbd762f
github.com/spf13/cobra v1.2.1
github.com/spf13/cobra v1.3.0
github.com/stretchr/testify v1.7.0
github.com/xlab/treeprint v0.0.0-20181112141820-a009c3971eca
github.com/xlab/treeprint v1.1.0
golang.org/x/mod v0.5.1
golang.org/x/net v0.0.0-20211216030914-fe4d6282115f // indirect
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
gotest.tools v2.2.0+incompatible
k8s.io/api v0.22.3
k8s.io/apiextensions-apiserver v0.22.2
k8s.io/apimachinery v0.22.3
k8s.io/cli-runtime v0.22.2
k8s.io/client-go v0.22.2
k8s.io/klog/v2 v2.10.0
k8s.io/kube-openapi v0.0.0-20211109043139-026bd182f079 // indirect
k8s.io/api v0.23.3
k8s.io/apiextensions-apiserver v0.23.3
k8s.io/apimachinery v0.23.3
k8s.io/cli-runtime v0.23.3
k8s.io/client-go v0.23.3
k8s.io/klog/v2 v2.40.1
k8s.io/kubectl v0.22.2
sigs.k8s.io/cli-utils v0.27.0
sigs.k8s.io/controller-runtime v0.10.1
sigs.k8s.io/kustomize/api v0.8.11
sigs.k8s.io/kustomize/kyaml v0.13.1-0.20211203194734-cd2c6a1ad117
sigs.k8s.io/controller-runtime v0.11.0
sigs.k8s.io/kustomize/api v0.11.1
sigs.k8s.io/kustomize/kyaml v0.13.3
)

require (
cloud.google.com/go v0.99.0 // indirect
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
github.com/Azure/go-autorest v14.2.0+incompatible // indirect
github.com/Azure/go-autorest/autorest v0.11.18 // indirect
github.com/Azure/go-autorest/autorest/adal v0.9.13 // indirect
github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect
github.com/Azure/go-autorest/logger v0.2.1 // indirect
github.com/Azure/go-autorest/tracing v0.6.0 // indirect
github.com/MakeNowJust/heredoc v0.0.0-20170808103936-bb23615498cd // indirect
github.com/PuerkitoBio/purell v1.1.1 // indirect
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a // indirect
github.com/chai2010/gettext-go v0.0.0-20160711120539-c6fed771bfd5 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/evanphx/json-patch v4.12.0+incompatible // indirect
github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d // indirect
github.com/form3tech-oss/jwt-go v3.2.3+incompatible // indirect
github.com/fvbommel/sortorder v1.0.1 // indirect
github.com/go-logr/logr v1.2.0 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect
github.com/go-openapi/jsonreference v0.19.5 // indirect
github.com/go-openapi/swag v0.19.14 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/btree v1.0.1 // indirect
github.com/google/gofuzz v1.1.0 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/googleapis/gnostic v0.5.5 // indirect
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/jonboulle/clockwork v0.2.2 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect
github.com/mailru/easyjson v0.7.6 // indirect
github.com/mitchellh/go-wordwrap v1.0.0 // indirect
github.com/mitchellh/mapstructure v1.4.3 // indirect
github.com/moby/spdystream v0.2.0 // indirect
github.com/moby/term v0.0.0-20210610120745-9d4ed1856297 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect
github.com/onsi/gomega v1.17.0 // indirect
github.com/peterbourgon/diskv v2.0.1+incompatible // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/russross/blackfriday v1.5.2 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/sergi/go-diff v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/spyzhov/ajson v0.4.2 // indirect
go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5 // indirect
golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 // indirect
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect
golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.27.1 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
k8s.io/component-base v0.23.3 // indirect
k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65 // indirect
k8s.io/utils v0.0.0-20211116205334-6203023598ed // indirect
sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
)

0 comments on commit 4cce7a1

Please sign in to comment.