File tree Expand file tree Collapse file tree 4 files changed +13
-8
lines changed Expand file tree Collapse file tree 4 files changed +13
-8
lines changed Original file line number Diff line number Diff line change 1
1
/deployment
2
+ /build
Original file line number Diff line number Diff line change @@ -2,12 +2,9 @@ FROM fedora:40@sha256:4e007f288dce23966216be81ef62ba05d139b9338f327c1d1c73b7167d
2
2
3
3
RUN dnf -y install gcc-c++ git findutils make cmake
4
4
COPY . /tmp/pcm
5
- # TEMPORARY change to be remove before merge, to not conflict with local builds + use cache
6
- # WARNING this approach requires me to build locally before docker build to get updated
7
- RUN --mount=type=cache,target=/tmp/pcm/build2 cd /tmp/pcm && cd build2 && cmake -D CMAKE_BUILD_TYPE=Debug .. && make -j pcm pcm-sensor-server
5
+ RUN cd /tmp/pcm && mkdir build && cd build && cmake .. && make
8
6
9
7
FROM fedora:40@sha256:4e007f288dce23966216be81ef62ba05d139b9338f327c1d1c73b7167dd47312
10
- RUN yum install -y strace gdb util-linux
11
8
COPY --from=builder /tmp/pcm/build/bin/* /usr/local/bin/
12
9
ENV PCM_NO_PERF=1
13
10
Original file line number Diff line number Diff line change
1
+ FROM fedora:40@sha256:4e007f288dce23966216be81ef62ba05d139b9338f327c1d1c73b7167dd47312 as builder
2
+
3
+ RUN dnf -y install gcc-c++ git findutils make cmake strace gdb util-linux
4
+ COPY . /tmp/pcm
5
+ RUN --mount=type=cache,target=/tmp/pcm/build cd /tmp/pcm/build && cmake -D CMAKE_BUILD_TYPE=Debug ..
6
+ RUN --mount=type=cache,target=/tmp/pcm/build cd /tmp/pcm/build && cmake --build . -t pcm -t pcm-sensor-server -t pcm-tpmi && cp -v /tmp/pcm/build/bin/pcm* /bin/
7
+ #ENV PCM_NO_PERF=1
Original file line number Diff line number Diff line change @@ -328,17 +328,17 @@ chmod +x ~/.docker/cli-plugins/docker-buildx
328
328
docker buildx create --driver docker-container --name mydocker --use --bootstrap
329
329
330
330
# or with single line (from deployment/pcm/ directory)
331
- # Build local image for tests/development + fix /pcm/resctrl mounting (assuming project was configured with cmake previously):
332
- # Note: Warning: we're using patched Dockerfile (TODO to be removed, because "build" directory conflits with existing root "build" directory and for caching ability )
333
- (cd ../.. ; (cd build ; make -j pcm pcm-sensor-server) ; docker build . -t localhost:5001/pcm-local && docker push localhost:5001/pcm-local)
331
+ # Build local image for tests/development
332
+ # Following Dockerfile contains source code of pcm and some debugging utils (like gdb,strace for further analysis )
333
+ (cd ../.. ; docker build . -f Dockerfile.debug -t localhost:5001/pcm-local && docker push localhost:5001/pcm-local)
334
334
```
335
335
336
336
3 ) When deploying to kind cluster pcm use values to switch to local pcm-local image
337
337
```
338
338
helm install pcm . -f values-local-image.yaml
339
339
```
340
340
341
- 4 ) Replace pcm-sensor-server with pcm or sleep
341
+ 4 ) Replace pcm-sensor-server with pcm or sleep to be able to run ` gdb ` or ` strace ` for example
342
342
```
343
343
helm upgrade --install pcm . --set debugPcm=true
344
344
helm upgrade --install pcm . --set debugSleep=true
You can’t perform that action at this time.
0 commit comments