Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/lint-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.7
python-version: 3.14

- name: Set up chart-testing
uses: helm/chart-testing-action@v2.1.0
Expand Down
12 changes: 7 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM registry.access.redhat.com/ubi7/ubi as rhel7builder
FROM registry.access.redhat.com/ubi7/ubi AS rhel7builder

RUN yum install -y gcc openssl-devel && \
rm -rf /var/cache/dnf && \
Expand All @@ -12,7 +12,9 @@ ENV PATH=/root/.cargo/bin:${PATH}

RUN cargo build --release -p core-dump-composer

FROM registry.access.redhat.com/ubi8/ubi as rhel8builder
FROM registry.access.redhat.com/ubi8/ubi AS rhel8builder

ARG CRICTL_VERSION=1.33.0

RUN yum install -y gcc openssl-devel && \
rm -rf /var/cache/dnf && \
Expand All @@ -26,8 +28,8 @@ ENV PATH=/root/.cargo/bin:${PATH}

RUN cargo build --release

RUN curl -L https://github.com/kubernetes-sigs/cri-tools/releases/download/v1.22.0/crictl-v1.22.0-linux-amd64.tar.gz --output crictl-v1.22.0-linux-amd64.tar.gz
RUN tar zxvf crictl-v1.22.0-linux-amd64.tar.gz
RUN curl -L https://github.com/kubernetes-sigs/cri-tools/releases/download/v${CRICTL_VERSION}/crictl-v${CRICTL_VERSION}-linux-amd64.tar.gz --output crictl-v${CRICTL_VERSION}-linux-amd64.tar.gz
RUN tar zxvf crictl-v${CRICTL_VERSION}-linux-amd64.tar.gz

FROM registry.access.redhat.com/ubi8/ubi-minimal

Expand All @@ -43,4 +45,4 @@ COPY --from=rhel7builder /app-build/target/release/core-dump-composer ./
RUN mv core-dump-composer cdc
WORKDIR "/app"
COPY --from=rhel8builder /app-build/crictl ./
CMD ["./core-dump-agent"]
CMD ["./core-dump-agent"]
3 changes: 1 addition & 2 deletions core-dump-agent/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
extern crate dotenv;
extern crate s3;

use advisory_lock::{AdvisoryFileLock, FileLockMode};
use env_logger::Env;
use inotify::{EventMask, Inotify, WatchMask};
use log::{error, info, warn};
Expand Down Expand Up @@ -292,7 +291,7 @@ async fn process_file(zip_path: &Path, bucket: &Bucket) {

let f = File::open(zip_path).expect("no file found");

match f.try_lock(FileLockMode::Shared) {
match f.try_lock_shared() {
Ok(_) => { /* If we can lock then we are ok */ }
Err(e) => {
let l_inotify = env::var("USE_INOTIFY")
Expand Down
3 changes: 1 addition & 2 deletions core-dump-composer/src/events.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use crate::config::CoreParams;
use advisory_lock::{AdvisoryFileLock, FileLockMode};
use serde::Serialize;
use serde_json::Value;
use std::collections::HashMap;
Expand Down Expand Up @@ -87,7 +86,7 @@ impl CoreEvent {
pub fn write_event(&self, eventlocation: &str) -> Result<(), anyhow::Error> {
let full_path = format!("{}/{}-event.json", eventlocation, self.uuid);
let file = File::create(full_path)?;
file.lock(FileLockMode::Exclusive)?;
file.lock_shared()?;
serde_json::to_writer(&file, &self)?;
file.unlock()?;
Ok(())
Expand Down
3 changes: 1 addition & 2 deletions core-dump-composer/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ extern crate dotenv;

use crate::events::CoreEvent;

use advisory_lock::{AdvisoryFileLock, FileLockMode};
use libcrio::Cli;
use log::{debug, error, info, warn};
use serde_json::json;
Expand Down Expand Up @@ -131,7 +130,7 @@ fn handle(mut cc: config::CoreConfig) -> Result<(), anyhow::Error> {
process::exit(1);
}
};
file.lock(FileLockMode::Exclusive)?;
file.lock_shared()?;
let mut zip = ZipWriter::new(&file);

debug!(
Expand Down
16 changes: 8 additions & 8 deletions musl.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
FROM docker.io/alpine:3.15.4 as builder

FROM docker.io/alpine:3.23.3 AS builder
ARG ARCH
ARG CRICTL_VERSION=1.33.0

RUN apk update && apk add curl binutils build-base
RUN apk update && apk add curl binutils build-base openssl-dev openssl-libs-static

RUN if [ $ARCH == "amd64" ]; then curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain stable-x86_64-unknown-linux-musl -y; fi

RUN if [ $ARCH == "arm64" ]; then curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain 1.61.0-aarch64-unknown-linux-musl -y; fi
RUN if [ $ARCH == "arm64" ]; then curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain stable-aarch64-unknown-linux-musl -y; fi

RUN ls -a /root/.cargo/bin

Expand All @@ -17,10 +17,10 @@ WORKDIR "/app-build"
ENV PATH=/root/.cargo/bin:${PATH}
RUN cargo build --verbose --release

RUN curl -L https://github.com/kubernetes-sigs/cri-tools/releases/download/v1.22.0/crictl-v1.22.0-linux-$ARCH.tar.gz --output crictl-v1.22.0-linux-$ARCH.tar.gz
RUN tar zxvf crictl-v1.22.0-linux-$ARCH.tar.gz
RUN curl -L https://github.com/kubernetes-sigs/cri-tools/releases/download/v${CRICTL_VERSION}/crictl-v${CRICTL_VERSION}-linux-$ARCH.tar.gz --output crictl-v${CRICTL_VERSION}-linux-$ARCH.tar.gz
RUN tar zxvf crictl-v${CRICTL_VERSION}-linux-$ARCH.tar.gz

FROM docker.io/alpine:3.15.4
FROM docker.io/alpine:3.23.3

RUN apk update && apk add procps

Expand All @@ -32,4 +32,4 @@ RUN mv core-dump-composer cdc

WORKDIR "/app"
COPY --from=builder /app-build/crictl ./
CMD ["./core-dump-agent"]
CMD ["./core-dump-agent"]
Loading