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

[Power Support] Enable weaveworks scope on Power. #3231

Merged
merged 1 commit into from
Aug 24, 2018

Conversation

meghalidhoble
Copy link
Contributor

Observed this particular test was failing on ppc64le architecture. Added the test failure log below,
walker_linux_test.go:97:

                +++ have
                @@ -32,7 +32,7 @@
                   Cmdline: (string) (len=15) "curl google.com",
                   Threads: (int) 1,
                   Jiffies: (uint64) 0,
                -  RSSBytes: (uint64) 8192,
                +  RSSBytes: (uint64) 131072,
                   RSSBytesLimit: (uint64) 2048,
                   OpenFilesCount: (int) 3,
                   OpenFilesLimit: (uint64) 32768,

Hence modified the value for RSSBytes to accept variable value which is computed based on pageSize instead of hard-coded values, as suggested by Adam Harrison over slack channel.

I have verified this patch on x86 setup as well and all the tests pass there. Please provide your comments/suggestions on this.
Thanks,
Meghali

@meghalidhoble
Copy link
Contributor Author

There are some build changes as well, which should fix these error. Another PR is in-progress for the build fixes.

@bboreham
Copy link
Collaborator

Note there is a lint failure in this PR.

@meghalidhoble
Copy link
Contributor Author

Yes, @bboreham , I am looking into this. I am expecting my build-changes should get this resolved.

@@ -8,6 +8,7 @@ import (
"github.com/weaveworks/common/test"
"github.com/weaveworks/common/test/fs"
"github.com/weaveworks/scope/probe/process"
"os"

This comment was marked as abuse.

@bboreham
Copy link
Collaborator

Not sure we're talking about the same thing. The error is:

probe/process/walker_linux_test.go: run gofmt -s -w probe/process/walker_linux_test.go

@satyamz
Copy link
Contributor

satyamz commented Jun 21, 2018

@meghalidhoble Please run make lint locally to verify linting issues.

@@ -1,4 +1,4 @@
FROM node:8.4.0
FROM node:8.11

This comment was marked as abuse.

This comment was marked as abuse.

This comment was marked as abuse.

@@ -0,0 +1,284 @@
package endpoint

This comment was marked as abuse.

This comment was marked as abuse.

This comment was marked as abuse.

This comment was marked as abuse.

This comment was marked as abuse.

This comment was marked as abuse.

@meghalidhoble
Copy link
Contributor Author

Hi @satyamz , @bboreham,
I have observed that "make lint" is failing on my platform (ppc64le) without the test-patch as well.
I had tested using "make tests" and "make client-test", and both of them worked fine for me.
I need to debug this issue further, will get back to you on this.

@bboreham
Copy link
Collaborator

Please run gofmt -s -w probe/process/walker_linux_test.go then update the PR. This should clear the lint error.

@meghalidhoble
Copy link
Contributor Author

Thanks @bboreham , your suggestion helped to resolve the failure.

go install -race -tags netgo std; \
fi
RUN export arch_val="$(dpkg --print-architecture)"; \
if [ "$arch_val" != "ppc64el" ]; then \

This comment was marked as abuse.

@@ -1,14 +1,32 @@
FROM golang:1.10.2-stretch
FROM golang:1.10.2

This comment was marked as abuse.

This comment was marked as abuse.

@bboreham
Copy link
Collaborator

Please put into each commit message a description of the changes.
Some tips here
"code changes made" is not a useful description.

@meghalidhoble meghalidhoble changed the title Modified the test "walker_linux_test.go", so as to be able to run on ppc64le. [Power Support] Enable weaveworks scope on Power. Jun 26, 2018
@meghalidhoble
Copy link
Contributor Author

Hi @bboreham, @satyamz ,
Could you please provide your comments on the latest code changes I submitted?
I have ran the weave/scope docker image and the verified that the UI comes up. What more testing I can do around this, so as to make sure the changes works fine for the functionality?
Thanks.

@abdasgupta
Copy link

Hi @bboreham, @satyamz ,
Can we please merge this PR if no more modification is needed?

Copy link
Collaborator

@bboreham bboreham 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 much cleaner; I have some queries in the detail.
More generally, we still need to have every change described in commit messages - people will look back in a year and want to know why a line changed.

@@ -1,3 +1,7 @@
// +build linux,amd64 ppc64le

This comment was marked as abuse.

This comment was marked as abuse.

RUN apt-get update && \
RUN set -eux; \
export arch_val="$(dpkg --print-architecture)"; \
if [ "$arch_val" != "ppc64el" ]; then \

This comment was marked as abuse.

chmod +x shfmt && \
mv shfmt /usr/bin
export arch_val="$(dpkg --print-architecture)"; \
if [ "$arch_val" != "ppc64el" ]; then \

This comment was marked as abuse.

This comment was marked as abuse.

chmod +x shfmt && \
mv shfmt /usr/bin; \
else \
go get -u mvdan.cc/sh/cmd/shfmt && \

This comment was marked as abuse.

@@ -1,4 +1,5 @@
// +build linux,amd64 ppc64le
// +build linux
// +build amd64 ppc64le

This comment was marked as abuse.

This comment was marked as abuse.

meghalidhoble added a commit to meghalidhoble/scope that referenced this pull request Jul 10, 2018
backend/Dockerfile file - Minor if conditional changes to have cross-compile on amd64 only.
Also removed the sh-lint support (shfmt installation) for ppc64le completely, as the older version
of shfmt is not supported for ppc and newer version doesn't go well with application.
tools/lint file  - Added conditional to not run "sh lint" (make lint) for ppc64le.
 Fixes PR weaveworks#3231
meghalidhoble added a commit to meghalidhoble/scope that referenced this pull request Jul 10, 2018
…syntax

corrections. Hence pushing the change according to the shfmt run from x86
setup. This change was to skip the sh-lint run on powerpc.
PR weaveworks#3231
meghalidhoble added a commit to meghalidhoble/scope that referenced this pull request Jul 10, 2018
@meghalidhoble
Copy link
Contributor Author

Hi @bboreham ,
I have addressed most of your comments and have pushed a few new code changes, Could you please take a look and let me know if any comments/suggestions?

@bboreham
Copy link
Collaborator

@meghalidhoble please can you squash the commits into a smaller number so we don't have dead-ends and back-tracking in the history. Leave each commit explaining what it does.

meghalidhoble added a commit to meghalidhoble/scope that referenced this pull request Jul 11, 2018
…ppc64le)

1)backend/Dockerfile 2) probe/endpoint/dns_snooper.go
3) client/Dockerfile 4) docker/Dockerfile.cloud-agent
5) probe/process/walker_linux_test.go & 6) tools/lint

1)'backend/Dockerfile' : Conditional added so that the cross-compiling should
   be done on amd64. Also removed support for sh-lint for ppc64le for now.
   As the version for shfmt mentioned in the dockerfile is not available for
   ppc64le and the later version does't work fine with existing application.
2)'probe/endpoint/dns_snooper.go' : Renamed this file so as to reuse for ppc64le
   and added a build-constraint. Now this file will be build for amd64 on linux
   and ppc64le on linux.
3)'client/Dockerfile' : Modified the version of the base image for node from
   8.4.0 to 8.11, as this version supports multiarch.
4)'docker/Dockerfile.cloud-agent' : Modified the version of the base image for
   golang from 1.10.2-strech to 1.10.2, which supports multiarch.
5) 'probe/process/walker_linux_test.go' : Test fixed to run for ppc64le,
    modified the code to accept RSSBytes based on pageSize value per
    architecture, instead of hard-coded values.
6)'tools/lint' : Modified the file to skip the sh-lint implementation for ppc64le.

PR weaveworks#3231
@meghalidhoble
Copy link
Contributor Author

Hi @bboreham , squashed all the commits to a single commit, with all the implementation details for each file being modified. Please take a look.

@bboreham
Copy link
Collaborator

Sadly, it is inappropriate to directly modify anything in the tools directory because it is a vendored copy of https://github.com/weaveworks/build-tools. Need to modify it upstream and then bring that commit in.

I'm sure this is maddening.

I might just change it to do nothing if it can't find shfmt, as is done for shellcheck, rather than have an architecture-specific test.

meghalidhoble added a commit to meghalidhoble/scope that referenced this pull request Jul 17, 2018
…heck.

Why the change : Need to skip the shfmt validation, for ppc64le as shfmt specified
version is not available. Hence added a check to run shfmt if the binary found,
else skip the validation completely.

PR weaveworks#3231
meghalidhoble added a commit to meghalidhoble/scope that referenced this pull request Jul 17, 2018
Why the change : make lint fails while sh-lint is being executed.

PR weaveworks#3231
meghalidhoble added a commit to meghalidhoble/scope that referenced this pull request Jul 18, 2018
Why : Corrected comment and re-formatted as per guidelines

PR weaveworks#3231
@meghalidhoble
Copy link
Contributor Author

Hi @bboreham ,
I have addressed the concern raised for tools directory changes, hence I have removed the architecture specific changes. Sorry for multiple commits, I will squash those commits and will combine to a single commit. Let me know if these changes look ok.

@bboreham
Copy link
Collaborator

Multiple commits is fine as long as they all form a progression and are all self-explanatory.

However the issue is that to change a file under the tools directory in this repo you need to change it in https://github.com/weaveworks/build-tools first and then do a git subtree to update the directory in this repo, as described in tools/README.md.

@meghalidhoble
Copy link
Contributor Author

Hi @bboreham , I have raised a pull request at build-tools repo with the lint changes, once those changes are approved, I will run git subtree to update the directory in this repo.

…ppc64le)

1)backend/Dockerfile 2) probe/endpoint/dns_snooper.go
3) client/Dockerfile 4) docker/Dockerfile.cloud-agent
5) probe/process/walker_linux_test.go & 6) tools/lint

1)'backend/Dockerfile' : Conditional added so that the cross-compiling should
   be done on amd64. Also removed support for sh-lint for ppc64le for now.
   As the version for shfmt mentioned in the dockerfile is not available for
   ppc64le and the later version does't work fine with existing application.
2)'probe/endpoint/dns_snooper.go' : Renamed this file so as to reuse for ppc64le
   and added a build-constraint. Now this file will be build for amd64 on linux
   and ppc64le on linux.
3)'client/Dockerfile' : Modified the version of the base image for node from
   8.4.0 to 8.11, as this version supports multiarch.
4)'docker/Dockerfile.cloud-agent' : Modified the version of the base image for
   golang from 1.10.2-strech to 1.10.2, which supports multiarch.
5) 'probe/process/walker_linux_test.go' : Test fixed to run for ppc64le,
    modified the code to accept RSSBytes based on pageSize value per
    architecture, instead of hard-coded values.
6)'tools/lint' : Modified the file to skip the sh-lint implementation for ppc64le.

PR weaveworks#3231
@bboreham bboreham merged commit 321c570 into weaveworks:master Aug 24, 2018
@bboreham
Copy link
Collaborator

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants