Skip to content

Conversation

joestringer
Copy link
Member

This PR pulls in a few misc Makefile and logging changes I've been trying out locally to improve debugging and developer workflows. Particularly noteworthy is the addition of the ginkgo build to the regular default make command. This means that to make, you now need ginkgo installed on your developer machine. This has been described in the documentation since commit 6771144 ("Documentation: Add ginkgo to developer guide"), so hopefully shouldn't be a surprise to anyone at this point.

@joestringer joestringer added pending-review area/misc Impacts miscellaneous areas of the code not otherwise owned by another area. labels Jan 23, 2018
@joestringer joestringer requested review from a team January 23, 2018 23:00
@joestringer joestringer requested review from a team as code owners January 23, 2018 23:00
@@ -1024,6 +1024,7 @@ func NewDaemon(c *Config) (*Daemon, error) {
return nil, fmt.Errorf("Unable to reserve IPv4 loopback address: %s", err)
}
d.loopbackIPv4 = loopbackIPv4
log.Infof("Loopback IPv4: %s", d.loopbackIPv4.String())
Copy link
Member

Choose a reason for hiding this comment

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

Can you change line 1014 to Infof?

Copy link
Member Author

@joestringer joestringer Jan 24, 2018

Choose a reason for hiding this comment

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

Done.

@@ -2,6 +2,13 @@ provision = true
# If you set provision to false the test will run without compile the code
# again.

all: build
Copy link
Member

Choose a reason for hiding this comment

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

I'm on the fence here, does this means when I run make all on the root directory it will also build ginkgo? If yes can we move the build target to a test target?

Copy link
Member Author

@joestringer joestringer Jan 24, 2018

Choose a reason for hiding this comment

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

Yes, that's the intention. It would build the tests, but not run ginkgo.

There's a couple of instances that I think motivate this:

  • Late last year there was a case where someone refactored code in pkg/ and ended up unintentionally breaking the building of tests.
  • Just this week I've done the same thing with PRs, eg renaming a variable and missing some cases.

I think that the easiest way to pick up on stuff like this is for developers to run make on their local machines before pushing, and for the default make command to also at least compile the tests.

The main argument I see against this is that it makes the build take longer. At this point it's a couple of seconds on my laptop.

Copy link
Member Author

@joestringer joestringer Jan 24, 2018

Choose a reason for hiding this comment

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

@aanm What would you like the behaviour to be for make all and make -C test/ all ?

EDIT: I moved the ginkgo build into the root level tests-common, let me know what you think.

Copy link
Member

Choose a reason for hiding this comment

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

IMO make all would be to generate the binaries, make tests would execute the tests (including all the necessary ginkgo building). Gingko itself is not required to run cilium, that's why I think it doesn't make senses to build ginkgo as well

Copy link
Member Author

@joestringer joestringer Jan 24, 2018

Choose a reason for hiding this comment

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

OK, the latest version should achieve this. Specifically:

  • make does not build the ginkgo tests.
  • make tests builds ginkgo tests, but does not run them (it runs only unit tests).
  • make -C test, cd test/ && make will build ginkgo tests but not run them.
  • make -C test/ test, make -C test/ run or make -C test/ k8s builds & runs ginkgo tests.

EDIT: For a bit of context, you might expect make tests to run the tests, but it only runs the unit tests. IMO running all of the runtime and k8s tests on a local machine is not a reasonable thing to do off this target, considering the resource requirements and time to complete (dozens of minutes and would spin up perhaps 8 VMs, with each VM wanting 2-3GB of memory). Personally my workflow involves attempting specific runtime tests on my local machine via ginkgo foo, then relying on the CI on PRs to catch the rest of the issues.

Copy link
Member

Choose a reason for hiding this comment

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

@aanm Do you agree with this?

Copy link
Member

Choose a reason for hiding this comment

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

yes I think it looks good, thanks!

@joestringer joestringer force-pushed the submit/misc-2018-01-23 branch 3 times, most recently from 2927e05 to 896fe4f Compare January 24, 2018 01:52
This address is used for services when directing traffic from a
container to a service IP that is backed by itself. Log it so it's
easier to grep around and figure out where it came from.

Signed-off-by: Joe Stringer <joe@covalent.io>
tests/00-fmt.sh is invoked at build time to check the format of golang
source code, so there's no need to invoke it again under runtime tests.
Furthermore, the bash-based tests/ directory will be going away, so move
this script to contrib/ while we're at it.

Signed-off-by: Joe Stringer <joe@covalent.io>
Build the ginkgo tests as part of the regular make command, it doesn't
take long and ensures that we don't end up inadvertently breaking ginkgo
tests when refactoring common code.

Signed-off-by: Joe Stringer <joe@covalent.io>
A few of the BPF object targets were only depending on the C source, and
some were depending on nothing. Add the proper library dependencies to
the make targets to ensure that they are rebuilt whenever library files
change.

Signed-off-by: Joe Stringer <joe@covalent.io>
Ensure this shows up in the cilium logs.

Signed-off-by: Joe Stringer <joe@covalent.io>
@joestringer joestringer force-pushed the submit/misc-2018-01-23 branch from 896fe4f to d872aac Compare January 24, 2018 18:50
@joestringer
Copy link
Member Author

test-me-please

Copy link

@manalibhutiyani manalibhutiyani left a comment

Choose a reason for hiding this comment

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

LGTM!

@aanm aanm merged commit 610d034 into cilium:master Jan 25, 2018
@joestringer joestringer deleted the submit/misc-2018-01-23 branch January 25, 2018 01:19
michi-covalent added a commit that referenced this pull request Jul 16, 2024
Install cloud CLIs so that you can run cilium-cli from inside a
container and connect to AKS / EKS / GKE clusters.

This commit also changes in-cluster scripts to use bash instead of sh.
Some of these scripts are not POSIX-compliant, and they don't work with
sh that comes with Ubuntu.

Ref: #2623
Ref: cilium/design-cfps#9

Signed-off-by: Michi Mutsuzaki <michi@isovalent.com>
michi-covalent added a commit that referenced this pull request Jul 16, 2024
Add image-repo and image-tag parameters to the cilium-cli action that
set up cilium-cli to run inside a container. Update aks-byocni.yaml to
run cilium-cli inside a container using the action instead of using
cilium-cli-test-job-chart.

Ref: #2623
Ref: cilium/design-cfps#9

Signed-off-by: Michi Mutsuzaki <michi@isovalent.com>
michi-covalent added a commit that referenced this pull request Jul 16, 2024
Update gke.yaml to run cilium-cli inside a container instead of using
cilium-cli-test-job-chart.

Ref: #2623
Ref: #2627
Ref: cilium/design-cfps#9

Signed-off-by: Michi Mutsuzaki <michi@isovalent.com>
michi-covalent added a commit that referenced this pull request Jul 16, 2024
Update externalworklads.yaml to run cilium-cli inside a container
instead of using cilium-cli-test-job-chart.

Ref: #2623
Ref: #2627
Ref: cilium/design-cfps#9

Signed-off-by: Michi Mutsuzaki <michi@isovalent.com>
michi-covalent added a commit that referenced this pull request Jul 16, 2024
Update {eks,eks-tunnel}.yaml to run cilium-cli inside a container
instead of using cilium-cli-test-job-chart.

Ref: #2623
Ref: #2627
Ref: cilium/design-cfps#9

Signed-off-by: Michi Mutsuzaki <michi@isovalent.com>
michi-covalent added a commit that referenced this pull request Jul 16, 2024
Update multicluster.yaml to run cilium-cli inside a container instead of
using cilium-cli-test-job-chart.

Ref: #2623
Ref: #2627
Ref: cilium/design-cfps#9

Signed-off-by: Michi Mutsuzaki <michi@isovalent.com>
michi-covalent added a commit that referenced this pull request Jul 16, 2024
Now all the cloud workflows run cilium-cli inside a container instead of
using cilium-cli-test-job-chart.

Also update eks-tunnel.yaml and remove the helm install step. I forgot
to remove it in 5146f46d.

Fixes: #2623

Signed-off-by: Michi Mutsuzaki <michi@isovalent.com>
michi-covalent added a commit that referenced this pull request Aug 5, 2024
[ cherry-picked from cilium/cilium-cli repository ]

Install cloud CLIs so that you can run cilium-cli from inside a
container and connect to AKS / EKS / GKE clusters.

This commit also changes in-cluster scripts to use bash instead of sh.
Some of these scripts are not POSIX-compliant, and they don't work with
sh that comes with Ubuntu.

Ref: #2623
Ref: cilium/design-cfps#9

Signed-off-by: Michi Mutsuzaki <michi@isovalent.com>
michi-covalent added a commit that referenced this pull request Aug 5, 2024
[ cherry-picked from cilium/cilium-cli repository ]

Add image-repo and image-tag parameters to the cilium-cli action that
set up cilium-cli to run inside a container. Update aks-byocni.yaml to
run cilium-cli inside a container using the action instead of using
cilium-cli-test-job-chart.

Ref: #2623
Ref: cilium/design-cfps#9

Signed-off-by: Michi Mutsuzaki <michi@isovalent.com>
michi-covalent added a commit that referenced this pull request Aug 5, 2024
[ cherry-picked from cilium/cilium-cli repository ]

Update gke.yaml to run cilium-cli inside a container instead of using
cilium-cli-test-job-chart.

Ref: #2623
Ref: #2627
Ref: cilium/design-cfps#9

Signed-off-by: Michi Mutsuzaki <michi@isovalent.com>
michi-covalent added a commit that referenced this pull request Aug 5, 2024
[ cherry-picked from cilium/cilium-cli repository ]

Update externalworklads.yaml to run cilium-cli inside a container
instead of using cilium-cli-test-job-chart.

Ref: #2623
Ref: #2627
Ref: cilium/design-cfps#9

Signed-off-by: Michi Mutsuzaki <michi@isovalent.com>
michi-covalent added a commit that referenced this pull request Aug 5, 2024
[ cherry-picked from cilium/cilium-cli repository ]

Update {eks,eks-tunnel}.yaml to run cilium-cli inside a container
instead of using cilium-cli-test-job-chart.

Ref: #2623
Ref: #2627
Ref: cilium/design-cfps#9

Signed-off-by: Michi Mutsuzaki <michi@isovalent.com>
michi-covalent added a commit that referenced this pull request Aug 5, 2024
[ cherry-picked from cilium/cilium-cli repository ]

Update multicluster.yaml to run cilium-cli inside a container instead of
using cilium-cli-test-job-chart.

Ref: #2623
Ref: #2627
Ref: cilium/design-cfps#9

Signed-off-by: Michi Mutsuzaki <michi@isovalent.com>
michi-covalent added a commit that referenced this pull request Aug 5, 2024
[ cherry-picked from cilium/cilium-cli repository ]

Now all the cloud workflows run cilium-cli inside a container instead of
using cilium-cli-test-job-chart.

Also update eks-tunnel.yaml and remove the helm install step. I forgot
to remove it in 5146f46d.

Fixes: #2623

Signed-off-by: Michi Mutsuzaki <michi@isovalent.com>
github-merge-queue bot pushed a commit that referenced this pull request Aug 16, 2024
[ cherry-picked from cilium/cilium-cli repository ]

Install cloud CLIs so that you can run cilium-cli from inside a
container and connect to AKS / EKS / GKE clusters.

This commit also changes in-cluster scripts to use bash instead of sh.
Some of these scripts are not POSIX-compliant, and they don't work with
sh that comes with Ubuntu.

Ref: #2623
Ref: cilium/design-cfps#9

Signed-off-by: Michi Mutsuzaki <michi@isovalent.com>
github-merge-queue bot pushed a commit that referenced this pull request Aug 16, 2024
[ cherry-picked from cilium/cilium-cli repository ]

Add image-repo and image-tag parameters to the cilium-cli action that
set up cilium-cli to run inside a container. Update aks-byocni.yaml to
run cilium-cli inside a container using the action instead of using
cilium-cli-test-job-chart.

Ref: #2623
Ref: cilium/design-cfps#9

Signed-off-by: Michi Mutsuzaki <michi@isovalent.com>
github-merge-queue bot pushed a commit that referenced this pull request Aug 16, 2024
[ cherry-picked from cilium/cilium-cli repository ]

Update gke.yaml to run cilium-cli inside a container instead of using
cilium-cli-test-job-chart.

Ref: #2623
Ref: #2627
Ref: cilium/design-cfps#9

Signed-off-by: Michi Mutsuzaki <michi@isovalent.com>
github-merge-queue bot pushed a commit that referenced this pull request Aug 16, 2024
[ cherry-picked from cilium/cilium-cli repository ]

Update externalworklads.yaml to run cilium-cli inside a container
instead of using cilium-cli-test-job-chart.

Ref: #2623
Ref: #2627
Ref: cilium/design-cfps#9

Signed-off-by: Michi Mutsuzaki <michi@isovalent.com>
github-merge-queue bot pushed a commit that referenced this pull request Aug 16, 2024
[ cherry-picked from cilium/cilium-cli repository ]

Update {eks,eks-tunnel}.yaml to run cilium-cli inside a container
instead of using cilium-cli-test-job-chart.

Ref: #2623
Ref: #2627
Ref: cilium/design-cfps#9

Signed-off-by: Michi Mutsuzaki <michi@isovalent.com>
github-merge-queue bot pushed a commit that referenced this pull request Aug 16, 2024
[ cherry-picked from cilium/cilium-cli repository ]

Update multicluster.yaml to run cilium-cli inside a container instead of
using cilium-cli-test-job-chart.

Ref: #2623
Ref: #2627
Ref: cilium/design-cfps#9

Signed-off-by: Michi Mutsuzaki <michi@isovalent.com>
github-merge-queue bot pushed a commit that referenced this pull request Aug 16, 2024
[ cherry-picked from cilium/cilium-cli repository ]

Now all the cloud workflows run cilium-cli inside a container instead of
using cilium-cli-test-job-chart.

Also update eks-tunnel.yaml and remove the helm install step. I forgot
to remove it in 5146f46d.

Fixes: #2623

Signed-off-by: Michi Mutsuzaki <michi@isovalent.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/misc Impacts miscellaneous areas of the code not otherwise owned by another area.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants