Move setup_environment commands to image generation #1533
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
setup_environment
step involves commands to convert a standard VM into a runner. Over time, the number of commands has increased in response to various customer issues, which has also lengthened the run time.We previously tried this, but certain commands had to run at runtime because the runner user was created by cloud-init. Recently, we separated the runner and runneradmin users. Now, cloud-init creates the runneradmin user, and we create the runner user in setup_environment. This allows us to move runner user related commands to image generation.
If the latest image is used, we only run the short version of the setup_environment script. If an older image is used, we run the long version of the
setup_environment
script. It allows us to deploy the new image to some hosts and test it before deploying it to all hosts.The new version saves the ".setup_info" file using "tee" instead of the ">" redirect, as the file should have different ownership.