Skip to content

Commit

Permalink
README update + better Dockerfile.debug
Browse files Browse the repository at this point in the history
  • Loading branch information
ppalucki committed Jun 7, 2024
1 parent d75b013 commit 92fbe0c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
3 changes: 2 additions & 1 deletion Dockerfile.debug
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ FROM fedora:40@sha256:4e007f288dce23966216be81ef62ba05d139b9338f327c1d1c73b7167d

RUN dnf -y install gcc-c++ git findutils make cmake strace gdb util-linux
COPY . /tmp/pcm
RUN --mount=type=cache,target=/tmp/pcm/build cd /tmp/pcm/build && cmake -D CMAKE_BUILD_TYPE=Debug .. && cmake --build . -t pcm pcm-sensor-server pcm-tpmi -j && cp -v /tmp/pcm/build/bin/pcm* /bin/
RUN --mount=type=cache,target=/tmp/pcm/build cd /tmp/pcm/build && cmake -D CMAKE_BUILD_TYPE=Debug .. && cmake --build . -t pcm pcm-sensor-server pcm-tpmi -j && mkdir -p /usr/local/bin && cp -v /tmp/pcm/build/bin/pcm* /usr/local/bin/
#ENV PCM_NO_PERF=1
ENTRYPOINT [ "/usr/local/bin/pcm-sensor-server", "-p", "9738", "-r" ]
18 changes: 11 additions & 7 deletions deployment/pcm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ For validation to verify that all metrics are available without msr, unload "msr
```
rmmod msr
echo 2 > /proc/sys/kernel/perf_event_paranoid
cat /proc/sys/kernel/perf_event_paranoid # expected value 2
```

#### 2) Create kind based Kubernetes cluster
Expand Down Expand Up @@ -292,6 +293,7 @@ helm install pcm . -f values-vm.yaml

#### Heterogeneous (mixed VM/metal instances) cluster

values-metal.yaml requires node-feature-discovery to be preinstallaed
```
helm install pcm-vm . -f values-vm.yaml
helm install pcm-metal . -f values-metal.yaml
Expand All @@ -316,20 +318,22 @@ wget https://kind.sigs.k8s.io/examples/kind-with-registry.sh
bash kind-with-registry.sh
```

2) Build docker image and upload to local registry (from project root directory)
```
docker build . -t localhost:5001/pcm-local
docker push localhost:5001/pcm-local
2) Build docker image and upload to local registry

```
# optionally create buildx based builder
mkdir ~/.docker/cli-plugins
curl -sL https://github.com/docker/buildx/releases/download/v0.14.0/buildx-v0.14.0.linux-amd64 -o ~/.docker/cli-plugins/docker-buildx
chmod +x ~/.docker/cli-plugins/docker-buildx
docker buildx create --driver docker-container --name mydocker --use --bootstrap
# or with single line (from deployment/pcm/ directory)
# Build local image for tests/development
# Following Dockerfile contains source code of pcm and some debugging utils (like gdb,strace for further analysis)
# Build production image from **project root directory**:
docker build . -t localhost:5001/pcm-local
docker push localhost:5001/pcm-local
# Build/push **debug** image with single line
# Debug Dockerfile contains source code of pcm and some debugging utils (like gdb,strace for further analysis)
# Run from deployment/pcm/ directory:
(cd ../.. ; docker build . -f Dockerfile.debug -t localhost:5001/pcm-local && docker push localhost:5001/pcm-local)
```

Expand Down

0 comments on commit 92fbe0c

Please sign in to comment.