Skip to content
This repository was archived by the owner on Oct 7, 2020. It is now read-only.

Operator e2e Fix#456

Merged
istio-testing merged 8 commits intoistio:masterfrom
irisdingbj:e2e
Oct 28, 2019
Merged

Operator e2e Fix#456
istio-testing merged 8 commits intoistio:masterfrom
irisdingbj:e2e

Conversation

@irisdingbj
Copy link
Copy Markdown
Member

@irisdingbj irisdingbj commented Oct 24, 2019

bases on #404

@sdake I am trying to fix the e2e failure for operator controller here based on your above PR.

@irisdingbj irisdingbj requested a review from a team as a code owner October 24, 2019 10:25
@googlebot googlebot added the cla: yes Set by the Google CLA bot to indicate the author of a PR has signed the Google CLA. label Oct 24, 2019
@istio-testing istio-testing added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Oct 24, 2019
@irisdingbj irisdingbj changed the title Operator e2e Fix [WIP] Operator e2e Fix Oct 24, 2019
@istio-testing istio-testing added the do-not-merge/work-in-progress Block merging of a PR because it isn't ready yet. label Oct 24, 2019
Copy link
Copy Markdown
Member

@sdake sdake left a comment

Choose a reason for hiding this comment

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

looks good - minus the loss of metallb functionality. If removal of metallb gets things moving for e2e, can you follow up this work with a metallb implementation for folks running on Linux systems? After that, a further generalization of this script so that it works correctly for cni is in order - perhaps you can take that work on as a followup.

Cheers
-steve

Cheers
-steve

- 172.17.255.1-172.17.255.250
EOF

kubectl apply -f https://raw.githubusercontent.com/google/metallb/v0.8.1/manifests/metallb.yaml
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this part is suspect for prow. I'd suggest taking a look at removal of this for the prow case (but keep for the e2e case). Additionally I have read metallb does nt work on Mac,but does work on Linux, so we may need some host checking before using metallb and then use -use-local or whatever the test flag is for the actual e2e run based upon that conditional.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please be aware - make e2e should work locally on your system (if your on Linux)l. I didn't test mac local e2e, but that must work, although Linux dev environments take priority. make e2e was working locally and in prow for me prior to this submission of this PR, however, I noticed I was using master of sdake/istio - and may have had some minor changes in istio/istio that were not pushed (and are now sady lost as I have force pushed to sdake/istio)...

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

THis can work on my mac locally

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

if metallb works locally on your mac without ``--use-local-cluster=true` that would be ideal. Can you clarify your statement?

#kind cluster setup
pushd "${ISTIO_DIR}"
# shellcheck disable=SC1091
source "./prow/lib.sh"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

not sure what this is or does. Did you add prow/lib.sh to the repo? If its already in repo - make sure it does what you expect it to. @howardjohn and I were speaking of the need to generalize this work so it can be reused around all satellite repos (cni and operator to be specific at first) - although that generalization work can follow on making it work for the specific case of operator - which is essential for the release. If your struggling, I should be available for a conversation tonight on webex.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It is part of istio repo. So we can resue all the functions there.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

disagree - operator should stand alone in its dependencies on building the repository. If we need a common files prow.ib, we can do that, but it should be merged as a separate PR in common-files repo (see link above).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

see review for more information about why using a prow library is an undesirable approach. As painful as it may be, please copy the parts you need into this e2e.sh script. As followup work a refactor of the e2e for the various repos (istio/operator, istio/cni, istio/istio) can be done in https://github.com/istio/common-files.

Copy link
Copy Markdown
Member

@sdake sdake left a comment

Choose a reason for hiding this comment

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

looks pretty good, some more comments inline.

tests/e2e/e2e.sh Outdated
kubectl apply -f https://raw.githubusercontent.com/google/metallb/v0.8.1/manifests/metallb.yaml
kubectl apply -f ./metallb-config.yaml
}
GOPATH=$(cd ../../../; pwd)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

you shouldn't need to specify GOPATH. This should come from either the docker container in a local env or the docker container in make e2e local case. See : https://github.com/istio/tools/blob/master/docker/build-tools/Dockerfile#L59

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

rename it as ROOT to prevent confusion

tests/e2e/e2e.sh Outdated

setup_kind_cluster
setup_docker
HUB=istio-testing TAG=1.5-dev make -f Makefile.core.mk controller docker
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this should just be make. Make determines if it is running in a container environment or not, and this model would break container builds.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Changed to make controller docker as we only need these two targets.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

make docker controller are or should be dependencies of the top level Makefile.core.mk file so they build whenever e2e runs. You may need to specify docker and docker.save as PHONY target if not already done.

#kind cluster setup
pushd "${ISTIO_DIR}"
# shellcheck disable=SC1091
source "./prow/lib.sh"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

disagree - operator should stand alone in its dependencies on building the repository. If we need a common files prow.ib, we can do that, but it should be merged as a separate PR in common-files repo (see link above).

@irisdingbj irisdingbj changed the title [WIP] Operator e2e Fix Operator e2e Fix Oct 25, 2019
@istio-testing istio-testing removed the do-not-merge/work-in-progress Block merging of a PR because it isn't ready yet. label Oct 25, 2019
@irisdingbj irisdingbj changed the title Operator e2e Fix [WIP]Operator e2e Fix Oct 25, 2019
@istio-testing istio-testing added the do-not-merge/work-in-progress Block merging of a PR because it isn't ready yet. label Oct 25, 2019
@irisdingbj irisdingbj changed the title [WIP]Operator e2e Fix Operator e2e Fix Oct 25, 2019
@istio-testing istio-testing removed the do-not-merge/work-in-progress Block merging of a PR because it isn't ready yet. label Oct 25, 2019
@irisdingbj
Copy link
Copy Markdown
Member Author

/retest

tests/e2e/e2e.sh Outdated

export ARTIFACTS="${ARTIFACTS:-$(mktemp -d)}"
ROOT=$(cd ../../../; pwd)
HUB=istio-testing
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

it is better to accept these from the Makeile.core.mk file directly rather than have to maintain them in two places. On the call to e2e.sh i'd recommend HUB=$(HUB) TAG=$(TAG) tests/e2e/e2e.sh such that user overrides of HUB or TAG are used during the build process.

TAG=istio-testing

function setup_docker() {
HUB=istio-testing TAG=1.5-dev make controller docker
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

try with `HUB=$(HUB)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

making TAG=1.5-dev here and not istio-testing is confusing. This is NOT pulling from a real repo, it is building the images locally and using local images.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

ok thats fair.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

will address in a followon PR if we can get this PR merged today.

tests/e2e/e2e.sh Outdated
kind --loglevel debug --name istio-testing load docker-image istio-testing/operator:1.5-dev
}

function build_kind_images() {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

rename function to build_istio_images()

Copy link
Copy Markdown
Member

@sdake sdake left a comment

Choose a reason for hiding this comment

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

implementation looks ok. There are some problems around HUB,TAG variable usage and the git cloing specifically. If you tell me it wont work with a git clone in a temp dir, we can merge without that.

I'd really strongly like to avoid the usage of the prow library - but instead copy the relevant bits into this script so we can make a unified e2e script in common-tools as a followup PR.

set -eux

export ARTIFACTS="${ARTIFACTS:-$(mktemp -d)}"
ROOT=$(cd ../../../; pwd)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I continue not to like this use of (cd ../../../; pwd). There is an environment variable (IIRC) that contains PWD in the top level Makefile. Can you see if that can be used? If its not being passed to Makefile.core.mk - it can be easily added.

- 172.17.255.1-172.17.255.250
EOF

kubectl apply -f https://raw.githubusercontent.com/google/metallb/v0.8.1/manifests/metallb.yaml
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

if metallb works locally on your mac without ``--use-local-cluster=true` that would be ideal. Can you clarify your statement?

#kind cluster setup
pushd "${ISTIO_DIR}"
# shellcheck disable=SC1091
source "./prow/lib.sh"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

see review for more information about why using a prow library is an undesirable approach. As painful as it may be, please copy the parts you need into this e2e.sh script. As followup work a refactor of the e2e for the various repos (istio/operator, istio/cni, istio/istio) can be done in https://github.com/istio/common-files.

@sdake
Copy link
Copy Markdown
Member

sdake commented Oct 25, 2019

@howardjohn would you mind reviewing?

mkdir -p "${ARTIFACTS}/out"

ISTIO_DIR="${GOPATH}/src/istio.io/istio"
ISTIO_DIR="${ROOT}/src/istio.io/istio"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It needs to be src/istio.io/istio, since prow will should check out istio/istio for us instead of doing the clone here.
And to your other concern, I think the clone only happens if the folder doesn't exist

tests/e2e/e2e.sh Outdated
pushd "${ISTIO_DIR}"
# shellcheck disable=SC1091
source "./prow/lib.sh"
setup_kind_cluster kindest/node:v1.15.3
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't think we should explicitly set the node here, or this will break when we update kind. Really, any of this can break if we update ./prow/lib.sh so its already sort of at risk

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

right, my suggestion was to keep this per repo - and then follow this work up with a common-files replication. agree re node, we should bake node into the buildtools image imo.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

removed the node images here

Copy link
Copy Markdown
Member

@howardjohn howardjohn left a comment

Choose a reason for hiding this comment

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

This is pretty misleading, you are not actually testing the PR

You set the HUB and TAG, build docker images, but they are not used.

When you pass HUB and TAG to the test, it is not used because the operator part of the test doesn't support it.

When you render the operator install yaml, it has the hardcoded hub and tag: https://storage.googleapis.com/istio-prow/pr-logs/pull/istio_operator/456/e2e_operator/115/artifacts/simple-auth-test-a9a5b04cf9db4c37a5fe/yaml/istio-operator.yaml

So anything you are doing with docker and hubs and tags is entirely unused as far as I can tell

@howardjohn
Copy link
Copy Markdown
Member

howardjohn commented Oct 25, 2019 via email

@irisdingbj
Copy link
Copy Markdown
Member Author

This is pretty misleading, you are not actually testing the PR

You set the HUB and TAG, build docker images, but they are not used.

When you pass HUB and TAG to the test, it is not used because the operator part of the test doesn't support it.

When you render the operator install yaml, it has the hardcoded hub and tag: https://storage.googleapis.com/istio-prow/pr-logs/pull/istio_operator/456/e2e_operator/115/artifacts/simple-auth-test-a9a5b04cf9db4c37a5fe/yaml/istio-operator.yaml

So anything you are doing with docker and hubs and tags is entirely unused as far as I can tell

good catch! Thanks. I will fix this.

Copy link
Copy Markdown
Member

@howardjohn howardjohn left a comment

Choose a reason for hiding this comment

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

looks good, just a couple minor comments. I think this is in a good state though

@irisdingbj
Copy link
Copy Markdown
Member Author

looks good, just a couple minor comments. I think this is in a good state though

Thanks @howardjohn seems it fails for istioctl kube-inject this time.. not sure the reason yet

@howardjohn
Copy link
Copy Markdown
Member

the istioctl inject is not related to this pr, I have a PR on istio/istio to fix it

@istio-testing istio-testing added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Oct 28, 2019
@irisdingbj
Copy link
Copy Markdown
Member Author

istio/istio#18352

@irisdingbj
Copy link
Copy Markdown
Member Author

/retest

@sdake
Copy link
Copy Markdown
Member

sdake commented Oct 28, 2019

/test e2e_operator

Copy link
Copy Markdown
Member

@sdake sdake left a comment

Choose a reason for hiding this comment

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

This is pretty close and I feel comfortable merging assuming the unresolved issues are addressed in a followup iterative PR. Assuming this PR can pass the checks, we can merge it now and follow up with fixes for the outstanding issues. If this PR still blocks in the checks, @irisdingbj can you get it passing as soon as viable?

- istio-operator
- server
imagePullPolicy: Always
imagePullPolicy: IfNotPresent
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@ostromart I believe I like Always as a pull policy better. I understand why this PR changes the default pull policy. If Always is specified, docker will pull the image in all cases, even though it may not be rermotely pushed.

A sed operation on this line may make sense. Do you have any thoughts on what is bettter?

TAG=istio-testing

function setup_docker() {
HUB=istio-testing TAG=1.5-dev make controller docker
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

will address in a followon PR if we can get this PR merged today.

mkdir -p "${ARTIFACTS}/out"

ISTIO_DIR="${GOPATH}/src/istio.io/istio"
ISTIO_DIR="${ROOT}/src/istio.io/istio"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@howardjohn can you clarify your suggestion here?

make istioctl

HUB=gcr.io/istio-testing TAG=latest E2E_ARGS="--use_operator --test_logs_path=${ARTIFACTS}" make e2e_simple_run
HUB="${HUB}" TAG="${TAG}" E2E_ARGS="--use_operator --use_local_cluster=true --test_logs_path=${ARTIFACTS}" make e2e_simple_noauth_run
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this HUB in use doesn't match the HUB at line 26.

@@ -0,0 +1,44 @@
apiVersion: apps/v1
Copy link
Copy Markdown
Member

@sdake sdake Oct 28, 2019

Choose a reason for hiding this comment

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

why not use sed to generate this file dynamically to avoid duplication of the manifests which may become inconsistent over time?

@istio-testing istio-testing merged commit 3610717 into istio:master Oct 28, 2019
@istio-testing
Copy link
Copy Markdown

@irisdingbj: The following test failed, say /retest to rerun them all:

Test name Commit Details Rerun command
e2e_operator 7675f39 link /test e2e_operator
Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@sdake
Copy link
Copy Markdown
Member

sdake commented Oct 28, 2019

groan - I had forgot the e2e tests were non-voting. I'll take a look at fixing this up today - if not @irisdingbj - can you take a look at fixing when you start your day.

Cheers
-steve

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla: yes Set by the Google CLA bot to indicate the author of a PR has signed the Google CLA. 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.

5 participants