swarmpit / agent

Swarmpit docker agent
16 stars 13 forks source link

multi-arch docker image #4

Closed kenits closed 4 years ago

kenits commented 5 years ago

Hello. I propose to make a multiarch docker image for agent. What do you think about that? I made fork and some changes.

and some question about swarmpit/task/stats.go

func calculateCPUPercentUnix(previousCPU, previousSystem uint64, v *types.StatsJSON) float64

CPUStats don't have OnlineCPUs and as I understand always go to in if block

    var (
        cpuPercent  = 0.0
        cpuDelta    = float64(v.CPUStats.CPUUsage.TotalUsage) - float64(previousCPU)
        systemDelta = float64(v.CPUStats.SystemUsage) - float64(previousSystem)
        onlineCPUs  = float64(v.CPUStats.OnlineCPUs)
    )

    if onlineCPUs == 0.0 {
        onlineCPUs = float64(len(v.CPUStats.CPUUsage.PercpuUsage))
    }

I use manifest-tool to create a single tag for docker image and have some problem with travis and manifest-tool, don't know how to make it work together.

May some test https://hub.docker.com/r/kenits/swarmpit_agent edge? It's build by travis

nohaapav commented 5 years ago

Hi, regarding OnlineCPUs - this is taken from docker codebase see my comment in code. I'll check and overview your changes probably next week.

Thanks for the effort :)

arrdem commented 5 years ago

For the future - kenit's build setup worked perfectly once CGO_ENABLED=0 was added to the go build line(s).

mrq1911 commented 4 years ago

merged