-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(ci): update cd workflows for arm64 (#1838)
## Problem Currently we only deploy amd64 badger CLI tool builds. We would like arm64 builds too. ## Solution Use an arm64 self-hosted runner to build arm64 badger CLI tool.
- Loading branch information
1 parent
1d0ae37
commit a717126
Showing
3 changed files
with
92 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# GH Actions Runner | ||
|
||
How to bake an AWS Virtual Machine for GH Actions? | ||
|
||
1. Get a Github Actions Runner Token from the UI | ||
``` | ||
export TOKEN=<GITHUB ACTIONS RUNNER TOKEN> | ||
``` | ||
2. Download the setup script onto the machine | ||
``` | ||
wget https://raw.githubusercontent.com/dgraph-io/badger/main/contrib/gh-runner/gh-runner.sh | ||
``` | ||
3. Run the script to attach this machine to Github Actions Runner Pool | ||
``` | ||
sh gh-runner.sh | ||
``` | ||
NOTE: This script is based on a similar [script](https://github.com/dgraph-io/dgraph/tree/main/contrib/gh-runner) located in the dgraph repository. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/bash | ||
# Machine Setup | ||
sudo apt-get update | ||
sudo apt-get -y upgrade | ||
sudo apt-get -y install build-essential #Libc packages | ||
# Install & Setup GH Actions Runner | ||
mkdir actions-runner && cd actions-runner | ||
if [ "$(uname -m)" = "aarch64" ]; then | ||
echo "Detected arm64 architecture" | ||
# Download the latest runner package | ||
curl -o actions-runner-linux-arm64-2.299.1.tar.gz -L https://github.com/actions/runner/releases/download/v2.299.1/actions-runner-linux-arm64-2.299.1.tar.gz | ||
# Optional: Validate the hash | ||
echo "debe1cc9656963000a4fbdbb004f475ace5b84360ace2f7a191c1ccca6a16c00 actions-runner-linux-arm64-2.299.1.tar.gz" | shasum -a 256 -c | ||
# Extract the installer | ||
tar xzf ./actions-runner-linux-arm64-2.299.1.tar.gz | ||
elif [ "$(uname -m)" = "x86_64" ]; then | ||
echo "Detected amd64 architecture" | ||
# Download the latest runner package | ||
curl -o actions-runner-linux-x64-2.299.1.tar.gz -L https://github.com/actions/runner/releases/download/v2.299.1/actions-runner-linux-x64-2.299.1.tar.gz | ||
# Optional: Validate the hash | ||
echo "147c14700c6cb997421b9a239c012197f11ea9854cd901ee88ead6fe73a72c74 actions-runner-linux-x64-2.299.1.tar.gz" | shasum -a 256 -c | ||
# Extract the installer | ||
tar xzf ./actions-runner-linux-x64-2.299.1.tar.gz | ||
else | ||
echo "Unrecognized architecture" | ||
exit 1 | ||
fi | ||
# Create the runner and start the configuration experience | ||
./config.sh --url https://github.com/dgraph-io/badger --token $TOKEN | ||
# Start GH Actions | ||
sudo ./svc.sh install | ||
sudo ./svc.sh start |