Skip to content

Commit

Permalink
Restore build_info.txt in Docker images (NVIDIA#1150)
Browse files Browse the repository at this point in the history
* Restore build_info.txt in Docker images
* Remove build_info.txt before calling migrate_assets
* Address PR comments
  • Loading branch information
bmhowe23 authored Feb 2, 2024
1 parent 92d72ca commit 3f0759a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/docker_images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ jobs:
build-args: |
base_image=${{ steps.prereqs.outputs.base_image }}
install="CMAKE_BUILD_TYPE=Debug"
git_source_sha=${{ github.sha }}
tags: ${{ steps.metadata.outputs.tags }}
labels: ${{ steps.metadata.outputs.labels }}
platforms: ${{ inputs.platforms }}
Expand Down Expand Up @@ -511,6 +512,7 @@ jobs:
build-args: |
base_image=${{ steps.prereqs.outputs.devdeps_image }}
install="CMAKE_BUILD_TYPE=Release CUDA_QUANTUM_VERSION=${{ steps.prereqs.outputs.image_tag }}"
git_source_sha=${{ github.sha }}
tags: ${{ steps.cudaqdev_metadata.outputs.tags }}
labels: ${{ steps.cudaqdev_metadata.outputs.labels }}
platforms: ${{ inputs.platforms }}
Expand Down
6 changes: 4 additions & 2 deletions docker/build/cudaq.dev.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ============================================================================ #
# Copyright (c) 2022 - 2023 NVIDIA Corporation & Affiliates. #
# Copyright (c) 2022 - 2024 NVIDIA Corporation & Affiliates. #
# All rights reserved. #
# #
# This source code and the accompanying materials are made available under #
Expand Down Expand Up @@ -47,6 +47,7 @@ RUN if [ -n "$mpi" ]; \
# creates a dev image that can be used as argument to docker/release/cudaq.Dockerfile
# to create the released cuda-quantum image.
ARG install=
ARG git_source_sha=xxxxxxxx
RUN if [ -n "$install" ]; \
then \
expected_prefix=$CUDAQ_INSTALL_PREFIX; \
Expand All @@ -58,5 +59,6 @@ RUN if [ -n "$install" ]; \
mkdir -p "$expected_prefix"; \
mv "$CUDAQ_INSTALL_PREFIX"/* "$expected_prefix"; \
rmdir "$CUDAQ_INSTALL_PREFIX"; \
fi \
fi; \
echo "source-sha: $git_source_sha" > "$CUDAQ_INSTALL_PREFIX/build_info.txt"; \
fi
4 changes: 2 additions & 2 deletions docker/release/cudaq.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ============================================================================ #
# Copyright (c) 2022 - 2023 NVIDIA Corporation & Affiliates. #
# Copyright (c) 2022 - 2024 NVIDIA Corporation & Affiliates. #
# All rights reserved. #
# #
# This source code and the accompanying materials are made available under #
Expand Down Expand Up @@ -92,7 +92,7 @@ ARG COPYRIGHT_NOTICE="=========================\n\
NVIDIA CUDA Quantum \n\
=========================\n\n\
Version: ${CUDA_QUANTUM_VERSION}\n\n\
Copyright (c) 2023 NVIDIA Corporation & Affiliates \n\
Copyright (c) 2024 NVIDIA Corporation & Affiliates \n\
All rights reserved.\n\n\
To run a command as administrator (user `root`), use `sudo <command>`.\n"
RUN echo -e "$COPYRIGHT_NOTICE" > "$CUDA_QUANTUM_PATH/Copyright.txt"
Expand Down
5 changes: 4 additions & 1 deletion docker/release/cudaq.ext.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ============================================================================ #
# Copyright (c) 2022 - 2023 NVIDIA Corporation & Affiliates. #
# Copyright (c) 2022 - 2024 NVIDIA Corporation & Affiliates. #
# All rights reserved. #
# #
# This source code and the accompanying materials are made available under #
Expand All @@ -15,6 +15,9 @@ USER root
ARG assets=./assets
COPY "$assets" "$CUDA_QUANTUM_PATH/assets/"
ADD ./scripts/migrate_assets.sh "$CUDA_QUANTUM_PATH/bin/migrate_assets.sh"
# Remove the base build_info.txt because the migration intentionally does not overwrite
# existing files, but adds its own entries to the build info.
RUN rm "$CUDA_QUANTUM_PATH/build_info.txt"
RUN if [ -d "$CUDA_QUANTUM_PATH/assets/documentation" ]; then \
rm -rf "$CUDA_QUANTUM_PATH/docs" && mkdir -p "$CUDA_QUANTUM_PATH/docs"; \
mv "$CUDA_QUANTUM_PATH/assets/documentation"/* "$CUDA_QUANTUM_PATH/docs"; \
Expand Down

0 comments on commit 3f0759a

Please sign in to comment.