Skip to content

Refactor the repo to support development with "ko".#54

Merged
google-prow-robot merged 2 commits into
knative:masterfrom
mattmoor:ko
May 17, 2018
Merged

Refactor the repo to support development with "ko".#54
google-prow-robot merged 2 commits into
knative:masterfrom
mattmoor:ko

Conversation

@mattmoor
Copy link
Copy Markdown
Member

You can read more about ko here, but the tl;dr is that it is an experimental tool to replicate the current DevX with Bazel without the baggage Bazel comes with (learning curve, BUILD files, Java dependency, ...).

I believe the supporting changes are generally useful these include:

  1. Moving config files out of the root directory. This is to support the Kubernetes-style of applying an entire directory of configuration, potentially recursively (see below for an example).
  2. Naming the image references we substitute around Go import paths. I find that this is a useful convention for expressing image provenance.

These changes will support side-by-side development with Bazel and ko, until we make a judgement call on whether to remove Bazel.

Here's an example of me running this locally:

$ time ko apply -f config/
2018/04/26 21:35:26 Go building github.com/elafros/eventing/cmd/controller
2018/04/26 21:35:36 Publishing us.gcr.io/convoy-adapter/github.com/elafros/eventing/cmd/controller:latest
2018/04/26 21:35:37 mounted sha256:4fe6b1eadc150125dbdff941f6e199cef0ac6b5c37795bf7cdb263f02a05f955
2018/04/26 21:35:37 mounted sha256:eb05f3dbdb543cc610527248690575bacbbcebabe6ecf665b189cf18b541e3ca
2018/04/26 21:35:37 mounted sha256:a027959537706a82d5fcf8d13f5624b002e39b652c21ec01e787233921434f9a
2018/04/26 21:35:37 pushed us.gcr.io/convoy-adapter/github.com/elafros/eventing/cmd/controller:latest
2018/04/26 21:35:37 Published us.gcr.io/convoy-adapter/github.com/elafros/eventing/cmd/controller@sha256:3afe5f28f3c500f7bf6d2be142cad9b75afcc2a601a3e5709277a91284fd9e15
namespace "bind-system" created
customresourcedefinition "binds.eventing.elafros.dev" created
clusterrolebinding "bind-controller-admin" created
deployment "bind-controller" created
customresourcedefinition "eventsources.eventing.elafros.dev" created
customresourcedefinition "eventtypes.eventing.elafros.dev" created
serviceaccount "bind-controller" created

real	0m13.700s
user	0m10.976s
sys	0m0.864s

@mattmoor mattmoor requested a review from vaikas April 27, 2018 04:44
@google-prow-robot google-prow-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Apr 27, 2018
Copy link
Copy Markdown
Contributor

@vaikas vaikas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do the samples need any changes?

@vaikas
Copy link
Copy Markdown
Contributor

vaikas commented Apr 28, 2018

/lgtm

@google-prow-robot google-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Apr 28, 2018
@google-prow-robot google-prow-robot removed the lgtm Indicates that a PR is ready to be merged. label Apr 28, 2018
@mattmoor
Copy link
Copy Markdown
Member Author

I updated the sample as well.

@vaikas
Copy link
Copy Markdown
Contributor

vaikas commented Apr 28, 2018

/lgtm

@google-prow-robot google-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Apr 28, 2018
mattmoor added 2 commits May 17, 2018 15:20
You can read more about `ko` [here](https://github.com/google/go-containerregistry/tree/master/cmd/ko#ko), but the tl;dr is that it is an experimental tool to replicate the current DevX with Bazel without the baggage Bazel comes with (learning curve, BUILD files, Java dependency, ...).

I believe the supporting changes are generally useful these include:
1. Moving config files out of the root directory.  This is to support the Kubernetes-style of applying an entire directory of configuration, potentially recursively (see below for an example).
1. Naming the image references we substitute around Go import paths.  I find that this is a useful convention for expressing image provenance.

These changes will support side-by-side development with Bazel and `ko`, until we make a judgement call on whether to remove Bazel.

Here's an example of me running this locally:
```shell
$ time ko apply -f config/
2018/04/26 21:35:26 Go building github.com/elafros/eventing/cmd/controller
2018/04/26 21:35:36 Publishing us.gcr.io/convoy-adapter/github.com/elafros/eventing/cmd/controller:latest
2018/04/26 21:35:37 mounted sha256:4fe6b1eadc150125dbdff941f6e199cef0ac6b5c37795bf7cdb263f02a05f955
2018/04/26 21:35:37 mounted sha256:eb05f3dbdb543cc610527248690575bacbbcebabe6ecf665b189cf18b541e3ca
2018/04/26 21:35:37 mounted sha256:a027959537706a82d5fcf8d13f5624b002e39b652c21ec01e787233921434f9a
2018/04/26 21:35:37 pushed us.gcr.io/convoy-adapter/github.com/elafros/eventing/cmd/controller:latest
2018/04/26 21:35:37 Published us.gcr.io/convoy-adapter/github.com/elafros/eventing/cmd/controller@sha256:3afe5f28f3c500f7bf6d2be142cad9b75afcc2a601a3e5709277a91284fd9e15
namespace "bind-system" created
customresourcedefinition "binds.eventing.elafros.dev" created
clusterrolebinding "bind-controller-admin" created
deployment "bind-controller" created
customresourcedefinition "eventsources.eventing.elafros.dev" created
customresourcedefinition "eventtypes.eventing.elafros.dev" created
serviceaccount "bind-controller" created

real	0m13.700s
user	0m10.976s
sys	0m0.864s
```
@google-prow-robot google-prow-robot removed the lgtm Indicates that a PR is ready to be merged. label May 17, 2018
@vaikas
Copy link
Copy Markdown
Contributor

vaikas commented May 17, 2018

/lgtm
/approve

@google-prow-robot google-prow-robot added the lgtm Indicates that a PR is ready to be merged. label May 17, 2018
@google-prow-robot
Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mattmoor, vaikas-google

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@google-prow-robot google-prow-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 17, 2018
@google-prow-robot google-prow-robot merged commit 295de3e into knative:master May 17, 2018
dprotaso added a commit to dprotaso/eventing that referenced this pull request Sep 12, 2018
Includes the following changes
1e7c2e7 Update static_watcher.go
d688349 Include note about embedding the ManualWatcher in the InformedWatcher
767d6a5 Few changes to the configmap package
0122abd The test logger will now log the correct caller (knative#63)
e7a4b0d Dont call flag.parse in pkg/test (knative#62)
b213523 Update test-infra dependency (knative#61)
382a2bf Make kube_checks generic so that it can be used in serving (knative#58)
760afb6 cleanup (knative#57)
eedc0a9 Make verify-codegen.sh compatible with OS X (knative#54)
6eff182 Remove docker repo from e2e flags (knative#53)
4be5c07 Vendor the test-infra scripts (knative#52)
8c687df Update WaitForEndpointState to return response (knative#51)
8f6a3be Update knative/pkg/test (knative#50)
3ca4270 Add a logkey for the reconcile key. (knative#49)
62d2560 Add Istio DestinationRule and Policy into Istio apis and clients (knative#43)
f4a77d7 Add a common test clients file (knative#46)
450739d Add common test logging module (knative#45)
dprotaso added a commit to dprotaso/eventing that referenced this pull request Sep 12, 2018
Includes the following changes:
8fc80de Few changes to the configmap package (knative#59)
0122abd The test logger will now log the correct caller (knative#63)
e7a4b0d Dont call flag.parse in pkg/test (knative#62)
b213523 Update test-infra dependency (knative#61)
382a2bf Make kube_checks generic so that it can be used in serving (knative#58)
760afb6 cleanup (knative#57)
eedc0a9 Make verify-codegen.sh compatible with OS X (knative#54)
6eff182 Remove docker repo from e2e flags (knative#53)
4be5c07 Vendor the test-infra scripts (knative#52)
8c687df Update WaitForEndpointState to return response (knative#51)
8f6a3be Update knative/pkg/test (knative#50)
3ca4270 Add a logkey for the reconcile key. (knative#49)
62d2560 Add Istio DestinationRule and Policy into Istio apis and clients (knative#43)
f4a77d7 Add a common test clients file (knative#46)
450739d Add common test logging module (knative#45
knative-prow-robot pushed a commit that referenced this pull request Sep 17, 2018
* bump knative/pkg to 8fc80de

Includes the following changes:
8fc80de Few changes to the configmap package (#59)
0122abd The test logger will now log the correct caller (#63)
e7a4b0d Dont call flag.parse in pkg/test (#62)
b213523 Update test-infra dependency (#61)
382a2bf Make kube_checks generic so that it can be used in serving (#58)
760afb6 cleanup (#57)
eedc0a9 Make verify-codegen.sh compatible with OS X (#54)
6eff182 Remove docker repo from e2e flags (#53)
4be5c07 Vendor the test-infra scripts (#52)
8c687df Update WaitForEndpointState to return response (#51)
8f6a3be Update knative/pkg/test (#50)
3ca4270 Add a logkey for the reconcile key. (#49)
62d2560 Add Istio DestinationRule and Policy into Istio apis and clients (#43)
f4a77d7 Add a common test clients file (#46)
450739d Add common test logging module (#45

* Use updated methods that indicate that the configmap.Watcher is using an informer
matzew pushed a commit to matzew/eventing that referenced this pull request Apr 11, 2019
* Refactor the repo to support development with "ko".

You can read more about `ko` [here](https://github.com/google/go-containerregistry/tree/master/cmd/ko#ko), but the tl;dr is that it is an experimental tool to replicate the current DevX with Bazel without the baggage Bazel comes with (learning curve, BUILD files, Java dependency, ...).

I believe the supporting changes are generally useful these include:
1. Moving config files out of the root directory.  This is to support the Kubernetes-style of applying an entire directory of configuration, potentially recursively (see below for an example).
1. Naming the image references we substitute around Go import paths.  I find that this is a useful convention for expressing image provenance.

These changes will support side-by-side development with Bazel and `ko`, until we make a judgement call on whether to remove Bazel.

Here's an example of me running this locally:
```shell
$ time ko apply -f config/
2018/04/26 21:35:26 Go building github.com/elafros/eventing/cmd/controller
2018/04/26 21:35:36 Publishing us.gcr.io/convoy-adapter/github.com/elafros/eventing/cmd/controller:latest
2018/04/26 21:35:37 mounted sha256:4fe6b1eadc150125dbdff941f6e199cef0ac6b5c37795bf7cdb263f02a05f955
2018/04/26 21:35:37 mounted sha256:eb05f3dbdb543cc610527248690575bacbbcebabe6ecf665b189cf18b541e3ca
2018/04/26 21:35:37 mounted sha256:a027959537706a82d5fcf8d13f5624b002e39b652c21ec01e787233921434f9a
2018/04/26 21:35:37 pushed us.gcr.io/convoy-adapter/github.com/elafros/eventing/cmd/controller:latest
2018/04/26 21:35:37 Published us.gcr.io/convoy-adapter/github.com/elafros/eventing/cmd/controller@sha256:3afe5f28f3c500f7bf6d2be142cad9b75afcc2a601a3e5709277a91284fd9e15
namespace "bind-system" created
customresourcedefinition "binds.eventing.elafros.dev" created
clusterrolebinding "bind-controller-admin" created
deployment "bind-controller" created
customresourcedefinition "eventsources.eventing.elafros.dev" created
customresourcedefinition "eventtypes.eventing.elafros.dev" created
serviceaccount "bind-controller" created

real	0m13.700s
user	0m10.976s
sys	0m0.864s
```

* Update the sample as well.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants