Skip to content

Commit 4b3b2ff

Browse files
Merge pull request #4465 from RachaelSTamakloe/add-gcluster-build-info
add gcluster-build-info to hcs image build
2 parents efb855f + c073cbe commit 4b3b2ff

File tree

4 files changed

+26
-0
lines changed

4 files changed

+26
-0
lines changed

examples/machine-learning/build-service-images/a3m/blueprint.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ deployment_groups:
3030
enabled: true
3131
world_writable: true
3232
runners:
33+
- $(vars.runner_write_gcluster_build_info)
3334
- $(vars.runner_install_cluster_health_scanner)
3435
- type: data
3536
destination: /etc/apt/preferences.d/block-broken-nvidia-container

examples/machine-learning/build-service-images/build.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,25 @@ if [[ ! -d "$RECIPE" ]]; then
2929
exit 1
3030
fi
3131

32+
GCLUSTER_VERSION="$(gcluster --version 2>&1 || echo 'gcluster not found')"
33+
readonly GCLUSTER_VERSION
34+
GIT_STATUS="$(git status --porcelain 2>&1 || echo 'not a git repository')"
35+
readonly GIT_STATUS
36+
37+
INFO_STRING=$(
38+
cat <<EOF
39+
gcluster version:
40+
$GCLUSTER_VERSION
41+
42+
Git Status:
43+
$GIT_STATUS
44+
EOF
45+
)
46+
47+
GCLUSTER_BUILD_INFO=$(echo -n "$INFO_STRING")
48+
readonly GCLUSTER_BUILD_INFO
49+
echo "$GCLUSTER_BUILD_INFO" >./gcluster-build-info
50+
3251
readonly FAMILY="$RECIPE-$SUFFIX"
3352
LONG_DEPLOYMENT_NAME="$USER-$FAMILY"
3453
readonly DEPLOYMENT_NAME="${LONG_DEPLOYMENT_NAME:0:31}"

examples/machine-learning/build-service-images/common/blueprint.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ deployment_groups:
3030
enabled: true
3131
world_writable: true
3232
runners:
33+
- $(vars.runner_write_gcluster_build_info)
3334
- $(vars.runner_install_cluster_health_scanner)
3435
- type: data # see https://github.com/GoogleCloudPlatform/cluster-toolkit/pull/4152
3536
destination: /etc/apt/preferences.d/block-broken-nvidia-container

examples/machine-learning/build-service-images/shared.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ vars:
3333
APT::Periodic::Update-Package-Lists "0";
3434
APT::Periodic::Unattended-Upgrade "0";
3535
36+
runner_write_gcluster_build_info:
37+
type: data
38+
destination: /etc/gcluster-build-info
39+
source: $(ghpc_stage("../gcluster-build-info"))
40+
3641
runner_install_slurm:
3742
type: shell
3843
destination: install_slurm.sh

0 commit comments

Comments
 (0)