From 641d0f68e59ff873f667d22f8d4114bb3a7212e3 Mon Sep 17 00:00:00 2001 From: ptaylor Date: Thu, 4 Jan 2024 16:16:27 -0800 Subject: [PATCH] add flags to skip the lifecycle scripts --- features/src/rapids-build-utils/devcontainer-feature.json | 2 +- .../opt/rapids-build-utils/bin/post-attach-command.sh | 4 ++++ .../opt/rapids-build-utils/bin/post-start-command.sh | 4 ++++ .../opt/rapids-build-utils/bin/update-content-command.sh | 4 ++++ .../opt/devcontainer/bin/post-attach-command-entrypoint.sh | 2 ++ .../src/utils/opt/devcontainer/bin/post-attach-command.sh | 4 ++++ 6 files changed, 19 insertions(+), 1 deletion(-) diff --git a/features/src/rapids-build-utils/devcontainer-feature.json b/features/src/rapids-build-utils/devcontainer-feature.json index b43c4027..606355de 100644 --- a/features/src/rapids-build-utils/devcontainer-feature.json +++ b/features/src/rapids-build-utils/devcontainer-feature.json @@ -1,7 +1,7 @@ { "name": "NVIDIA RAPIDS devcontainer build utilities", "id": "rapids-build-utils", - "version": "24.2.5", + "version": "24.2.6", "description": "A feature to install the RAPIDS devcontainer build utilities", "containerEnv": { "BASH_ENV": "/etc/bash.bash_env" diff --git a/features/src/rapids-build-utils/opt/rapids-build-utils/bin/post-attach-command.sh b/features/src/rapids-build-utils/opt/rapids-build-utils/bin/post-attach-command.sh index d7c91093..79e3a52b 100755 --- a/features/src/rapids-build-utils/opt/rapids-build-utils/bin/post-attach-command.sh +++ b/features/src/rapids-build-utils/opt/rapids-build-utils/bin/post-attach-command.sh @@ -1,5 +1,9 @@ #! /usr/bin/env bash +if test -n "${SKIP_POST_ATTACH_COMMAND:-}"; then + exit 0; +fi + if test -n "${PYTHON_PACKAGE_MANAGER:-}"; then rapids-make-${PYTHON_PACKAGE_MANAGER}-env || true; fi diff --git a/features/src/rapids-build-utils/opt/rapids-build-utils/bin/post-start-command.sh b/features/src/rapids-build-utils/opt/rapids-build-utils/bin/post-start-command.sh index 0b1796c8..eb09991b 100755 --- a/features/src/rapids-build-utils/opt/rapids-build-utils/bin/post-start-command.sh +++ b/features/src/rapids-build-utils/opt/rapids-build-utils/bin/post-start-command.sh @@ -1,3 +1,7 @@ #! /usr/bin/env bash +if test -n "${SKIP_POST_START_COMMAND:-}"; then + exit 0; +fi + rapids-make-vscode-workspace --update; diff --git a/features/src/rapids-build-utils/opt/rapids-build-utils/bin/update-content-command.sh b/features/src/rapids-build-utils/opt/rapids-build-utils/bin/update-content-command.sh index 287c9741..3ee53b54 100755 --- a/features/src/rapids-build-utils/opt/rapids-build-utils/bin/update-content-command.sh +++ b/features/src/rapids-build-utils/opt/rapids-build-utils/bin/update-content-command.sh @@ -1,5 +1,9 @@ #! /usr/bin/env bash +if test -n "${SKIP_UPDATE_CONTENT_COMMAND:-}"; then + exit 0; +fi + rapids-generate-scripts; rapids-make-vscode-workspace --update; diff --git a/features/src/utils/opt/devcontainer/bin/post-attach-command-entrypoint.sh b/features/src/utils/opt/devcontainer/bin/post-attach-command-entrypoint.sh index 858410eb..a5ce2bb2 100755 --- a/features/src/utils/opt/devcontainer/bin/post-attach-command-entrypoint.sh +++ b/features/src/utils/opt/devcontainer/bin/post-attach-command-entrypoint.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash +SKIP_POST_ATTACH_COMMAND=; + . devcontainer-utils-post-attach-command; exec "$@"; diff --git a/features/src/utils/opt/devcontainer/bin/post-attach-command.sh b/features/src/utils/opt/devcontainer/bin/post-attach-command.sh index 312bace1..a72f469e 100755 --- a/features/src/utils/opt/devcontainer/bin/post-attach-command.sh +++ b/features/src/utils/opt/devcontainer/bin/post-attach-command.sh @@ -1,5 +1,9 @@ #! /usr/bin/env bash +if test -n "${SKIP_POST_ATTACH_COMMAND:-}"; then + exit 0; +fi + find ~/ -maxdepth 1 -exec bash -c "\ [ \$(stat --format '%u:%g' '{}') != $(id -u):$(id -g) ] \ && sudo chown -R $(id -u):$(id -g) {}" \;