Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ambient beta get started guide patch #14788

Merged

Conversation

nauticalmike
Copy link
Contributor

@nauticalmike nauticalmike commented Mar 26, 2024

Description

adjusting ambient getting started guide to include in-pod ztunnel log proxy status #14355

Reviewers

  • Ambient
  • Docs
  • Installation
  • Networking
  • Performance and Scalability
  • Extensions and Telemetry
  • Security
  • Test and Release
  • User Experience
  • Developer Infrastructure
  • Localization/Translation

@nauticalmike nauticalmike requested a review from a team as a code owner March 26, 2024 02:25
Copy link

linux-foundation-easycla bot commented Mar 26, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

@istio-testing istio-testing added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. needs-ok-to-test labels Mar 26, 2024
@istio-testing
Copy link
Contributor

Hi @nauticalmike. Thanks for your PR.

I'm waiting for a istio member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@ericvn
Copy link
Contributor

ericvn commented Mar 26, 2024

/ok-to-test

@istio-testing istio-testing added ok-to-test Set this label allow normal testing to take place for a PR not submitted by an Istio org member. and removed needs-ok-to-test labels Mar 26, 2024
@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 Mar 26, 2024
@ericvn
Copy link
Contributor

ericvn commented Mar 26, 2024

make snips is used to generate the file from the index.md.

@nauticalmike
Copy link
Contributor Author

make snips is used to generate the file from the index.md.

thanks Eric, I was using make gen but it was messing up my snips

@nauticalmike
Copy link
Contributor Author

@ericvn what's the next step here?

Co-authored-by: Frank Budinsky <frankb@ca.ibm.com>
@@ -65,7 +65,7 @@ _verify_contains snip_verify_traffic_notsleep_to_productpage "$snip_verify_traff
_verify_contains snip_adding_your_application_to_the_ambient_mesh_1 "$snip_adding_your_application_to_the_ambient_mesh_1_out"

# test traffic after ambient mode is enabled
_verify_contains snip_adding_your_application_to_the_ambient_mesh_3 "$snip_adding_your_application_to_the_ambient_mesh_3_out"
_verify_contains snip_adding_your_application_to_the_ambient_mesh_3 "received netns, starting proxy"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@frankbu I decided to do the validation directly on the test script as the snips keeps on failing. I see someone did the same before here on line 77

Copy link
Contributor Author

Choose a reason for hiding this comment

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

test failed again... running out of ideas here...

Copy link
Member

@dhawton dhawton Mar 28, 2024

Choose a reason for hiding this comment

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

VERIFY FAILED snip_adding_your_application_to_the_ambient_mesh_3 (timeout after 120s):
received:
""
expected:
"received netns, starting proxy"

Copy link
Member

Choose a reason for hiding this comment

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

Might be worth troubleshooting by dropping the grep in that snip and just having it dump the logs, just to see what is being logged in the ztunnel pods.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks @dhawton I found that one, I tried several combinations to get that snippet of the doc in but the test keeps on failing for different reasons. The idea here is to show the logs after the ns labeling, but when I use the whole output like:

kubectl logs ds/ztunnel -n istio-system  | grep inpod
Found 3 pods, using pod/ztunnel-jrxln
inpod_enabled: true
inpod_uds: /var/run/ztunnel/ztunnel.sock
inpod_port_reuse: true
inpod_mark: 1337
2024-03-26T00:02:06.161802Z  INFO ztunnel::inpod::workloadmanager: handling new stream
2024-03-26T00:02:06.162099Z  INFO ztunnel::inpod::statemanager: pod received snapshot sent
2024-03-26T00:41:05.518194Z  INFO ztunnel::inpod::statemanager: pod WorkloadUid("7ef61e18-725a-4726-84fa-05fc2a440879") received netns, starting proxy

the test _verify_like or _verify_contains doesn't match but I can see a similar print on the artifacts output, my last attempt just removed the snips.sh out reference and match the contains directly like:

_verify_contains snip_adding_your_application_to_the_ambient_mesh_3 "received netns, starting proxy"

but as you can see the output is empty

Copy link
Contributor Author

Choose a reason for hiding this comment

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

that's the thing, on my previous validations I was able to see an output like described above but one pod instead of 3 and obviously different time stamps and workloadid but neither the _verify_like or _verify_contains matched anything...

Copy link
Member

Choose a reason for hiding this comment

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

I can't see the output of the log really, I can only tell grep had no match... the received netns statement is ~2 months old, so it's in the commit of Istio that the docs is using atm. Wonder if it's not starting up, or hasn't finished initializing when the test is being run?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dhawton here you can see even though I added back the snip ref it also doesn't match to anything. I'm going to try right now just 'grepping' the proxy string

@nauticalmike
Copy link
Contributor Author

/retest

@@ -62,10 +62,9 @@ _verify_contains snip_verify_traffic_sleep_to_ingress "$snip_verify_traffic_slee
_verify_contains snip_verify_traffic_sleep_to_productpage "$snip_verify_traffic_sleep_to_productpage_out"
_verify_contains snip_verify_traffic_notsleep_to_productpage "$snip_verify_traffic_notsleep_to_productpage_out"

snip_adding_your_application_to_the_ambient_mesh_1
_verify_contains snip_adding_your_application_to_the_ambient_mesh_1 "$snip_adding_your_application_to_the_ambient_mesh_1_out"
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not surprised it's failing now, since you're not calling snip_adding_your_application_to_the_ambient_mesh_2

Why didn't you change to the code I suggested in my previous comment? #14788 (review)

Suggested change
_verify_contains snip_adding_your_application_to_the_ambient_mesh_1 "$snip_adding_your_application_to_the_ambient_mesh_1_out"
_verify_contains snip_adding_your_application_to_the_ambient_mesh_1 "$snip_adding_your_application_to_the_ambient_mesh_1_out"
snip_adding_your_application_to_the_ambient_mesh_2

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not calling it because when I generate the snips there is no snip_adding_your_application_to_the_ambient_mesh_2 and that is because as pointed out before there is no need to validate this section:

{{< text syntax=bash snip_id=none >}}
$ kubectl label namespace default istio.io/dataplane-mode=ambient
{{< /text >}}

as I'm not referencing any output on the document.

Are you saying that even though in this case I should remove the snip_id=none let it generate the snip_adding_your_application_to_the_ambient_mesh_2 and just not call any validation from the test.sh?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I said that you don't need to validate the output of the snip, not that you don't need to call it. If you don't call the snip that adds the label, how could it possibly get labelled so that the following snips will work?

Just put it back to generate all the snips the way you had it previously and change the test to what I said yesterday.

_verify_same snip_adding_your_application_to_the_ambient_mesh_1 "$snip_adding_your_application_to_the_ambient_mesh_1_out"

# test traffic after ambient mode is enabled
snip_adding_your_application_to_the_ambient_mesh_2
_verify_like snip_adding_your_application_to_the_ambient_mesh_3 "$snip_adding_your_application_to_the_ambient_mesh_3_out"
_verify_same snip_adding_your_application_to_the_ambient_mesh_4 "$snip_adding_your_application_to_the_ambient_mesh_4_out"
_verify_same snip_adding_your_application_to_the_ambient_mesh_5 "$snip_adding_your_application_to_the_ambient_mesh_5_out"
_verify_same snip_adding_your_application_to_the_ambient_mesh_6 "$snip_adding_your_application_to_the_ambient_mesh_6_out"

Either that, or disable the test (rename it to test-disable.sh) and I'll fix it in a followup.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@frankbu why 4 5 and 6 are _verify_same?
they are related to sections of the doc that I'm not modifying and the current version of the test does
_verify_contains here should I change those from your suggestion of _verify_same to _verify_contains?

Copy link
Collaborator

Choose a reason for hiding this comment

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

_verify_same and _verify_contains will both work in these cases, but _verify_same is a better check since it really is checking that the output is "exactly the same as expected", which it is in this case. _verify_contains checks that the expected string is part of the output, which could include more text.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

understood, I think I tested with that and succeed locally but failed here. I will send one like this and we'll see, thanks.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

https://github.com/istio/istio.io/blob/master/tests/README.md#verify-functions

yeap, that's the one I have been using but I don't get consistent outputs when run here

@nauticalmike
Copy link
Contributor Author

/retest

Co-authored-by: Frank Budinsky <frankb@ca.ibm.com>
@dhawton
Copy link
Member

dhawton commented Mar 28, 2024

/test doc.test.profile-default

@istio-testing istio-testing merged commit 523307b into istio:master Mar 28, 2024
12 checks passed
wilsonwu added a commit to wilsonwu/istio.io that referenced this pull request Mar 28, 2024
@dhawton
Copy link
Member

dhawton commented Mar 28, 2024

/cherry-pick release-1.21

@wilsonwu wilsonwu mentioned this pull request Mar 28, 2024
11 tasks
@istio-testing
Copy link
Contributor

@dhawton: #14788 failed to apply on top of branch "release-1.21":

Applying: adjusting ambient getting started guide to include in-pod ztunnel log proxy status
Applying: removing boilerplate reference
Applying: removing trailing whitespaces
Applying: removing whitespaces from snips
Using index info to reconstruct a base tree...
M	content/en/docs/ops/ambient/getting-started/snips.sh
Falling back to patching base and 3-way merge...
Auto-merging content/en/docs/ops/ambient/getting-started/snips.sh
CONFLICT (content): Merge conflict in content/en/docs/ops/ambient/getting-started/snips.sh
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0004 removing whitespaces from snips
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherry-pick release-1.21

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.

@istio-testing
Copy link
Contributor

@dhawton: new issue created for failed cherrypick: #14801

In response to this:

/cherry-pick release-1.21

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.

istio-testing pushed a commit that referenced this pull request Mar 29, 2024
* Sync #14788 into Chinese

* improve

* Apply suggestions from code review

Co-authored-by: Michael <haifeng.yao@daocloud.io>
Co-authored-by: Xiaopeng Han <hanxiaop8@outlook.com>

---------

Co-authored-by: Michael <haifeng.yao@daocloud.io>
Co-authored-by: Xiaopeng Han <hanxiaop8@outlook.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ambient kind/docs ok-to-test Set this label allow normal testing to take place for a PR not submitted by an Istio org member. 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.

None yet

7 participants