forked from kata-containers/tests
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: memory-tested image vish/stress is single-arch image for amd64
since vish/stress is a single-arch image for amd64, we need to provide aarch64-specific image, including Dockefile from which the image was built, source code of lightweight memory stress utility(stress/main.go), etc. Fixes: kata-containers#567 Signed-off-by: Penny Zheng <[email protected]>
- Loading branch information
Showing
9 changed files
with
425 additions
and
4 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# | ||
# Copyright (c) 2018 ARM Limited | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
FROM golang:1.10.3-alpine3.8 | ||
|
||
MAINTAINER [email protected] | ||
|
||
ENV GOPATH=/go | ||
ENV PATH=$PATH:$GOPATH/bin | ||
|
||
RUN apk add --no-cache musl-dev git gcc | ||
RUN go get -u github.com/golang/dep/cmd/dep | ||
|
||
RUN mkdir -p $GOPATH/src/stress/ | ||
WORKDIR $GOPATH/src/stress | ||
RUN dep init | ||
ADD main.go . | ||
RUN dep ensure | ||
RUN go build -o stress . && go install | ||
|
||
ENTRYPOINT ["stress"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// | ||
// Copyright (c) 2018 ARM Limited | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package main | ||
|
||
import ( | ||
"flag" | ||
|
||
"code.cloudfoundry.org/bytefmt" | ||
) | ||
|
||
var ( | ||
argMemTotal = flag.String("mem-total", "0", "total memory to be consumed. Memory will be consumed via multiple allocations.") | ||
argMemStepSize = flag.String("mem-alloc-size", "4K", "amount of memory to be consumed in each allocation") | ||
buffer [][]byte | ||
) | ||
|
||
func main() { | ||
flag.Parse() | ||
total, _ := bytefmt.ToBytes(*argMemTotal) | ||
stepSize, _ := bytefmt.ToBytes(*argMemStepSize) | ||
allocateMemory(total, stepSize) | ||
} | ||
|
||
func allocateMemory(total, stepSize uint64) { | ||
for i := uint64(1); i*stepSize <= total; i++ { | ||
newBuffer := make([]byte, stepSize) | ||
for i := range newBuffer { | ||
newBuffer[i] = 0 | ||
} | ||
buffer = append(buffer, newBuffer) | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.