Skip to content

Commit 1b1a33e

Browse files
Fix ctest and docker to work with monorepo
* Remove .git folder and git command check in cmake * Update docker container to work in monorepo * Update docker container to mount the top level folder in monorepo [rocm-systems] ROCm/rocm-systems#181 (commit 97d9f35)
1 parent bd659e3 commit 1b1a33e

File tree

3 files changed

+12
-22
lines changed

3 files changed

+12
-22
lines changed

CMakeLists.txt

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,13 @@ include(ExternalProject)
4242
include(GNUInstallDirs)
4343

4444
# version control info
45-
find_package(Git)
46-
if(Git_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/.git")
47-
execute_process(
48-
COMMAND git log --pretty=format:%h -n 1
49-
OUTPUT_VARIABLE ROCPROFCOMPUTE_GIT_REV
50-
OUTPUT_STRIP_TRAILING_WHITESPACE)
51-
message(STATUS "Git revision: ${ROCPROFCOMPUTE_GIT_REV}")
52-
set(GIT_CLONE TRUE)
53-
else()
54-
set(GIT_CLONE FALSER)
55-
endif()
45+
execute_process(
46+
COMMAND git log --pretty=format:%h -n 1
47+
OUTPUT_VARIABLE ROCPROFCOMPUTE_GIT_REV
48+
OUTPUT_STRIP_TRAILING_WHITESPACE)
49+
message(STATUS "Git revision: ${ROCPROFCOMPUTE_GIT_REV}")
50+
configure_file(${PROJECT_SOURCE_DIR}/cmake/VERSION.sha.in
51+
${PROJECT_SOURCE_DIR}/VERSION.sha @ONLY)
5652

5753
set(CMAKE_BUILD_TYPE "Release")
5854
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
@@ -162,12 +158,6 @@ if(LOCALHOST MATCHES "TheraS01|.*\.thera\.amd\.com|thera-hn")
162158
list(POP_BACK CMAKE_MESSAGE_INDENT)
163159
endif()
164160

165-
# git versioning file
166-
if(${GIT_CLONE})
167-
configure_file(${PROJECT_SOURCE_DIR}/cmake/VERSION.sha.in
168-
${PROJECT_SOURCE_DIR}/VERSION.sha @ONLY)
169-
endif()
170-
171161
# Setup testing collateral
172162

173163
option(ENABLE_TESTS "Enable compilation of testing collateral" OFF)

docker/Dockerfile.customrocmtest

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ RUN DEBIAN_FRONTEND=noninteractive TZ="America/Toronto" amdgpu-install --yes --u
4444
# Install any dependencies specified in requirements.txt
4545
# Run interactive bash shell
4646
CMD ["/bin/bash", "-c", "\
47-
python3.10 -m pip install -r requirements.txt -r requirements-test.txt \
47+
cd /app/projects/rocprofiler-compute \
48+
&& python3.10 -m pip install -r requirements.txt -r requirements-test.txt \
4849
&& exec /bin/bash \
4950
"]

docker/docker-compose.customrocmtest.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
services:
22
customrocmtest: # service name
33
build:
4-
context: ../
5-
dockerfile: docker/Dockerfile.customrocmtest
4+
context: ../../../
5+
dockerfile: projects/rocprofiler-compute/docker/Dockerfile.customrocmtest
66
devices:
77
- /dev/kfd
88
- /dev/dri
99
security_opt:
1010
- seccomp:unconfined
1111
volumes:
12-
- ../:/app
13-
- ../../rocprofiler-sdk:/rocprofiler-sdk
12+
- ../../../:/app
1413
ports:
1514
- 8050:8050
1615
tty: true

0 commit comments

Comments
 (0)