Skip to content

Commit

Permalink
Merge pull request #365 from rphillips/oom_detection
Browse files Browse the repository at this point in the history
oom detection
  • Loading branch information
saschagrunert authored May 10, 2022
2 parents dd1f4d1 + 5d30fbf commit 8868738
Show file tree
Hide file tree
Showing 13 changed files with 639 additions and 80 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
env:
CARGO_TERM_COLOR: always
GO_VERSION: '1.18'
ACTION_MSRV_TOOLCHAIN: 1.59.0
ACTION_MSRV_TOOLCHAIN: 1.60.0
jobs:
build:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -209,5 +209,7 @@ jobs:
path: target/x86_64-unknown-linux-musl/release
- run: chmod +x target/x86_64-unknown-linux-musl/release/conmonrs
- run: .github/install-deps
- name: create symlink
run: sudo ln -f -s $GOROOT/bin/* /usr/bin/
- name: Integration tests
run: RUNTIME_PATH="/usr/sbin/runc" make integration-static
142 changes: 138 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 8 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ release-static:
make release && \
strip -s target/x86_64-unknown-linux-musl/release/$(BINARY)"

lint:
lint: .install.golangci-lint
cargo fmt
$(GOTOOLS_BINDIR)/golangci-lint run

unit:
cargo test --bins --no-fail-fast
Expand All @@ -39,20 +40,23 @@ integration: .install.ginkgo release # It needs to be release so we correctly te
export CONMON_BINARY="$(MAKEFILE_PATH)target/release/$(BINARY)" && \
export RUNTIME_BINARY="$(RUNTIME_PATH)" && \
export MAX_RSS_KB=10240 && \
"$(GOTOOLS_BINDIR)/ginkgo" -v -r pkg/client
sudo -E "$(GOTOOLS_BINDIR)/ginkgo" -v -r pkg/client

integration-static: .install.ginkgo # It needs to be release so we correctly test the RSS usage
export CONMON_BINARY="$(MAKEFILE_PATH)target/x86_64-unknown-linux-musl/release/$(BINARY)" && \
if [ ! -f "$$CONMON_BINARY" ]; then \
$(MAKE) release-static; \
fi && \
export RUNTIME_BINARY="$(RUNTIME_PATH)" && \
export MAX_RSS_KB=2800 && \
$(GOTOOLS_BINDIR)/ginkgo -v -r pkg/client
export MAX_RSS_KB=3100 && \
sudo -E "$(GOTOOLS_BINDIR)/ginkgo" -v -r pkg/client

.install.ginkgo:
GOBIN=$(abspath $(GOTOOLS_BINDIR)) go install github.com/onsi/ginkgo/v2/ginkgo@latest

.install.golangci-lint:
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | BINDIR=$(abspath $(GOTOOLS_BINDIR)) sh -s v1.45.2

clean:
rm -rf target/

Expand Down
4 changes: 4 additions & 0 deletions conmon-rs/server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ tracing = "0.1.34"
tracing-journald = "0.3.0"
tracing-subscriber = "0.3.11"
uuid = { version = "1.0.0", features = ["v4", "fast-rng", "macro-diagnostics"] }
regex = "1.5.5"
notify = "5.0.0-pre.14"
tokio-eventfd = "0.2.0"
lazy_static = "1.4.0"

[build-dependencies]
shadow-rs = "0.11.0"
Expand Down
5 changes: 5 additions & 0 deletions conmon-rs/server/src/child.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ pub struct Child {
#[getset(get = "pub")]
exit_paths: Vec<PathBuf>,

#[getset(get = "pub")]
oom_exit_paths: Vec<PathBuf>,

#[getset(get = "pub")]
timeout: Option<Instant>,

Expand All @@ -26,13 +29,15 @@ impl Child {
id: String,
pid: u32,
exit_paths: Vec<PathBuf>,
oom_exit_paths: Vec<PathBuf>,
timeout: Option<Instant>,
io: SharedContainerIO,
) -> Self {
Self {
id,
pid,
exit_paths,
oom_exit_paths,
timeout,
io,
}
Expand Down
Loading

0 comments on commit 8868738

Please sign in to comment.