Introduces scripts that automate the creation and provisioning of packet.net Windows Github Actions Runners using terraform. Provisioning steps are extracted from the wiki documentation.
[#174630303]
To be discussed
Terraform drops sensitive information in the form of .tfstate files in the working directory. These are git-ignored as part of this PR, but one would need to decide a way to keep these in sync across workstations. For instance, terraform provides an authenticated GCS Backend as an alternative destination for .tfstate files.
Usage
For managing a Windows Github Actions Runner, one only needs to interact with the terraform wrapper script at: ./runners/scripts/terraformw.sh. The script wraps terraform commands; performing any prep steps before the main operations.
Configure LastPass First
The script assumes that the following 2 credential notes are available in LastPass:
PACKET_AUTH_TOKEN: An authentication token that allows terraform to manage instances on your behalf.
lpass show --note 'Shared-Cloud Native Buildpacks/packet-auth-token'
PACKET_PROJECT_ID: The GUID representing a packet project where instances will be created.
lpass show --note 'Shared-Cloud Native Buildpacks/packet-project-id'
Create a runner
To create a runner, invoke the terraform wrapper script without any arguments:
The process will standup a windows machine and perform much of the provisioning steps covered the wiki documentation. These steps include: Installing Hyper-V/Docker-Desktop, Preparing the actions-runner-win-x64-*.zip archive, Rebooting the Machine, and more.
However after the creation process is completed, one must still manually log into the machine and turn on the Docker-Desktop Application. (I've been unable to find out how to do this well programmatically).
Destroying a runner
To destroy a runner, invoke the terraform wrapper script with the destroy argument:
Introduces scripts that automate the creation and provisioning of packet.net Windows Github Actions Runners using terraform. Provisioning steps are extracted from the wiki documentation.
[#174630303]
To be discussed
.tfstate
files in the working directory. These are git-ignored as part of this PR, but one would need to decide a way to keep these in sync across workstations. For instance, terraform provides an authenticated GCS Backend as an alternative destination for.tfstate
files.Usage
For managing a Windows Github Actions Runner, one only needs to interact with the terraform wrapper script at:
./runners/scripts/terraformw.sh
. The script wraps terraform commands; performing any prep steps before the main operations.Configure LastPass First
The script assumes that the following 2 credential notes are available in LastPass:
lpass show --note 'Shared-Cloud Native Buildpacks/packet-auth-token'
lpass show --note 'Shared-Cloud Native Buildpacks/packet-project-id'
Create a runner
To create a runner, invoke the terraform wrapper script without any arguments:
The process will standup a windows machine and perform much of the provisioning steps covered the wiki documentation. These steps include: Installing Hyper-V/Docker-Desktop, Preparing the
actions-runner-win-x64-*.zip
archive, Rebooting the Machine, and more.However after the creation process is completed, one must still manually log into the machine and turn on the Docker-Desktop Application. (I've been unable to find out how to do this well programmatically).
Destroying a runner
To destroy a runner, invoke the terraform wrapper script with the
destroy
argument:Viewing runner credentials
To view credentials for a runner, invoke the terraform wrapper script with the
output
argument:The password for the machine is marked 'sensitive'. To view the password, you must explicitly request to view its contents:
Other
main.tf
. The documentation can be found here.provision.ps1
file.terraformw.sh
.