Skip to content

Commit

Permalink
Add docker image workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
jonlamb-gh committed Nov 13, 2024
1 parent da5d3d1 commit 51cfd60
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Docker Image

on:
workflow_dispatch:

jobs:
package:
name: Build 22.04 Docker Image
timeout-minutes: 60
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Build docker image
run: docker build -t ghcr.io/jonlamb-gh/trace-recorder-to-ctf:latest .

- name: Push docker image
run: docker push ghcr.io/jonlamb-gh/trace-recorder-to-ctf:latest
30 changes: 30 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
FROM ubuntu:22.04

LABEL org.opencontainers.image.source=https://github.com/jonlamb-gh/trace-recorder-to-ctf
LABEL org.opencontainers.image.description="Docker image for trace-recorder-to-ctf"
LABEL org.opencontainers.image.licenses=MIT

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get upgrade -y && apt-get install --no-install-recommends --assume-yes \
patchelf lintian adduser help2man gzip \
cmake make gcc g++ libusb-1.0-0-dev stunnel \
curl build-essential protobuf-compiler libssl-dev \
python3 python3-pip python3-venv \
libglib2.0-dev pkg-config libtool flex bison autoconf ca-certificates automake

RUN curl https://sh.rustup.rs -sSf | bash -s -- -y --profile minimal -c rustfmt -c clippy
ENV PATH="/root/.cargo/bin:${PATH}"

RUN mkdir -p /trace-recorder-to-ctf
COPY assets/ /trace-recorder-to-ctf/assets/
COPY Cargo.lock /trace-recorder-to-ctf/
COPY Cargo.toml /trace-recorder-to-ctf/
COPY LICENSE-MIT /trace-recorder-to-ctf/
COPY macros/ /trace-recorder-to-ctf/macros/
COPY README.md /trace-recorder-to-ctf/
COPY src/ /trace-recorder-to-ctf/src/

RUN cd /trace-recorder-to-ctf && ls -l && cargo install --path .

ENTRYPOINT ["/root/.cargo/bin/trace-recorder-to-ctf"]
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,25 @@ babeltrace2 --clock-seconds ./ctf_trace
[0.000535150] (+0.000139862) trace-recorder sched_wakeup: { cpu_id = 0 }, { id = 0x30, event_count = 25, timer = 96327 }, { src_event_type = "TASK_READY", comm = "CLI", tid = 536904392, prio = 1, target_cpu = 0 }
```

## Docker

You can also use the Docker image `ghcr.io/jonlamb-gh/trace-recorder-to-ctf:latest`:

```bash
mkdir -p /tmp/output

# Volumes:
# * input file test_system.psf at /test_system.psf
# * output directory /tmp/output at /output
docker run -u $(id -u):$(id -g) -it -v /tmp/test_system.psf:/test_system.psf:ro -v /tmp/output:/output:rw ghcr.io/jonlamb-gh/trace-recorder-to-ctf:latest -o /output/test_system /test_system.psf

tree /tmp/output/
/tmp/output/
└── test_system
├── metadata
└── stream
```

## Concept Mapping

The converter produces CTF data that integrates with several of the out-of-box trace-compass LTTng kernel analyses.
Expand Down

0 comments on commit 51cfd60

Please sign in to comment.