Merge pull request #3231 from meghalidhoble/master

[Power Support] Enable weaveworks scope on Power.
This commit is contained in:
Bryan Boreham
2018-08-24 15:27:57 +01:00
committed by GitHub
5 changed files with 34 additions and 11 deletions

View File

@@ -1,14 +1,30 @@
FROM golang:1.10.2-stretch
FROM golang:1.10.2
ENV SCOPE_SKIP_UI_ASSETS true
RUN apt-get update && \
apt-get install -y libpcap-dev time file shellcheck git gcc-arm-linux-gnueabihf curl build-essential python-pip && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN set -eux; \
export arch_val="$(dpkg --print-architecture)"; \
apt-get update && \
if [ "$arch_val" = "amd64" ]; then \
apt-get install -y libpcap-dev python-requests time file shellcheck git gcc-arm-linux-gnueabihf curl build-essential python-pip; \
else \
apt-get install -y libpcap-dev python-requests time file shellcheck git curl build-essential python-pip; \
fi; \
\
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN go clean -i net && \
go install -tags netgo std && \
go install -race -tags netgo std
RUN curl -fsSL -o shfmt https://github.com/mvdan/sh/releases/download/v1.3.0/shfmt_v1.3.0_linux_amd64 && \
chmod +x shfmt && \
mv shfmt /usr/bin
export arch_val="$(dpkg --print-architecture)"; \
if [ "$arch_val" != "ppc64el" ]; then \
go install -race -tags netgo std; \
fi;
RUN export arch_val="$(dpkg --print-architecture)"; \
if [ "$arch_val" = "amd64" ]; then \
curl -fsSL -o shfmt https://github.com/mvdan/sh/releases/download/v1.3.0/shfmt_v1.3.0_linux_amd64 && \
chmod +x shfmt && \
mv shfmt /usr/bin; \
fi;
# Skipped installing shfmt, as the version v1.3.0 isn't supported for ppc64le
# and the later version of shfmt doesn't work with the application well
RUN go get -tags netgo \
github.com/fzipp/gocyclo \
github.com/golang/lint/golint \

View File

@@ -1,4 +1,4 @@
FROM node:8.4.0
FROM node:8.11
WORKDIR /home/weave
COPY package.json yarn.lock /home/weave/
ENV NPM_CONFIG_LOGLEVEL=warn NPM_CONFIG_PROGRESS=false

View File

@@ -1,4 +1,4 @@
FROM alpine:3.5
FROM alpine:3.7
WORKDIR /home/weave
RUN apk add --update bash conntrack-tools iproute2 util-linux curl && \
rm -rf /var/cache/apk/*

View File

@@ -1,3 +1,7 @@
// +build linux,amd64 linux,ppc64le
// Build constraint to use this file for amd64 & ppc64le on Linux
package endpoint
import (

View File

@@ -1,6 +1,7 @@
package process_test
import (
"os"
"reflect"
"testing"
@@ -79,9 +80,11 @@ var mockFS = fs.Dir("",
func TestWalker(t *testing.T) {
fs_hook.Mock(mockFS)
defer fs_hook.Restore()
var pageSize uint64
pageSize = (uint64)(os.Getpagesize() * 2)
want := map[int]process.Process{
3: {PID: 3, PPID: 2, Name: "curl", Cmdline: "curl google.com", Threads: 1, RSSBytes: 8192, RSSBytesLimit: 2048, OpenFilesCount: 3, OpenFilesLimit: 32768},
3: {PID: 3, PPID: 2, Name: "curl", Cmdline: "curl google.com", Threads: 1, RSSBytes: pageSize, RSSBytesLimit: 2048, OpenFilesCount: 3, OpenFilesLimit: 32768},
2: {PID: 2, PPID: 1, Name: "bash", Cmdline: "bash", Threads: 1, OpenFilesCount: 2},
4: {PID: 4, PPID: 3, Name: "apache", Cmdline: "apache", Threads: 1, OpenFilesCount: 1},
1: {PID: 1, PPID: 0, Name: "init", Cmdline: "init", Threads: 1, OpenFilesCount: 0},