Skip to content

Commit

Permalink
Docker: Postpone hip/rocm regtests until container execution
Browse files Browse the repository at this point in the history
  • Loading branch information
oschuett committed Mar 11, 2022
1 parent 391b09e commit cc8ca8c
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 17 deletions.
11 changes: 3 additions & 8 deletions tools/docker/Dockerfile.test_hip_rocm_Mi100
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,10 @@ COPY ./data ./data
COPY ./tests ./tests
COPY ./tools/regtesting ./tools/regtesting

# Run regression tests.
# Postpone running the regression tests until the container is executed.
ARG TESTOPTS
COPY ./tools/docker/scripts/test_regtest.sh ./
RUN /bin/bash -c " \
TESTOPTS="${TESTOPTS}" \
./test_regtest.sh 'local_hip' 'psmp' |& tee report.log && \
rm -rf regtesting"

# Output the report if the image is old and was therefore pulled from the build cache.
CMD cat $(find ./report.log -mmin +10) | sed '/^Summary:/ s/$/ (cached)/'
ENV TESTOPTS="${TESTOPTS}"
CMD ["./test_regtest.sh", "local_hip", "psmp"]

#EOF
11 changes: 3 additions & 8 deletions tools/docker/Dockerfile.test_hip_rocm_Mi50
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,10 @@ COPY ./data ./data
COPY ./tests ./tests
COPY ./tools/regtesting ./tools/regtesting

# Run regression tests.
# Postpone running the regression tests until the container is executed.
ARG TESTOPTS
COPY ./tools/docker/scripts/test_regtest.sh ./
RUN /bin/bash -c " \
TESTOPTS="${TESTOPTS}" \
./test_regtest.sh 'local_hip' 'psmp' |& tee report.log && \
rm -rf regtesting"

# Output the report if the image is old and was therefore pulled from the build cache.
CMD cat $(find ./report.log -mmin +10) | sed '/^Summary:/ s/$/ (cached)/'
ENV TESTOPTS="${TESTOPTS}"
CMD ["./test_regtest.sh", "local_hip", "psmp"]

#EOF
23 changes: 22 additions & 1 deletion tools/docker/generate_dockerfiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,12 @@ def main() -> None:

for gpu_ver in "Mi50", "Mi100":
with OutputFile(f"Dockerfile.test_hip_rocm_{gpu_ver}", args.check) as f:
f.write(toolchain_hip_rocm(gpu_ver=gpu_ver) + regtest("psmp", "local_hip"))
# ROCm containers require --device, which is not available for docker build.
# https://rocmdocs.amd.com/en/latest/ROCm_Virtualization_Containers/ROCm-Virtualization-&-Containers.html#docker-hub
f.write(
toolchain_hip_rocm(gpu_ver=gpu_ver)
+ regtest_postponed("psmp", "local_hip")
)

with OutputFile(f"Dockerfile.test_conventions", args.check) as f:
f.write(toolchain_full() + conventions())
Expand Down Expand Up @@ -98,6 +103,22 @@ def regtest(version: str, arch: str = "local") -> str:
)


# ======================================================================================
def regtest_postponed(version: str, arch: str = "local") -> str:
return (
install_cp2k(version=version, arch=arch)
+ fr"""
# Postpone running the regression tests until the container is executed.
ARG TESTOPTS
COPY ./tools/docker/scripts/test_regtest.sh ./
ENV TESTOPTS="${{TESTOPTS}}"
CMD ["./test_regtest.sh", "{arch}", "{version}"]
#EOF
"""
)


# ======================================================================================
def performance(arch: str = "local") -> str:
return (
Expand Down

0 comments on commit cc8ca8c

Please sign in to comment.