Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Temporary patch for incorrect test user key file ownership #1837

Merged
merged 1 commit into from
Nov 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions integration_test/gce/gce_testing.go
Original file line number Diff line number Diff line change
Expand Up @@ -1101,6 +1101,25 @@ func addFrameworkMetadata(imageSpec string, inputMetadata map[string]string) (ma
if _, ok := metadataCopy["startup-script"]; ok {
return nil, errors.New("the 'startup-script' metadata key is reserved for future use. Instead, wait for the instance to be ready and then run things with RunRemotely() or RunScriptRemotely()")
}
// TODO(b/380470389): we actually *can't* do RunRemotely() on DLVM images due to a bug.
// The workaround for the bug is to deploy a fix in-VM via startup scripts.
if strings.Contains(imageSpec, "common-gpu-debian-11-py310") {
metadataCopy["startup-script"] = fmt.Sprintf(`
#!/bin/bash
# Give time for the guest agent and jupyter stuff to finish modifying
# /etc/passwd and test_user home directory
sleep 120
HOMEDIR=/home/%[1]s
SSHFILE=$HOMEDIR/.ssh/authorized_keys
if [ ! -f "$SSHFILE" ]; then
sudo mkdir -p "$HOMEDIR/.ssh"
sudo touch "$SSHFILE"
fi
sudo chown -R %[1]s:%[1]s "$HOMEDIR"
sudo chmod 600 "$SSHFILE"`,
sshUserName,
jefferbrecht marked this conversation as resolved.
Show resolved Hide resolved
)
}
}
return metadataCopy, nil
}
Expand Down