Add two more runners for image building process

This commit is contained in:
Igor Pecovnik 2021-06-13 00:19:45 +02:00
parent af5c4b4b3a
commit af1811bdc4

View File

@ -66,7 +66,7 @@ jobs:
workdir: scripts
git-user-signingkey: true
git-commit-gpgsign: true
- name: Build beta images
env:
GPG_PASS: ${{ secrets.GPG_PASSPHRASE1 }}
@ -167,7 +167,7 @@ jobs:
workdir: scripts
git-user-signingkey: true
git-commit-gpgsign: true
- name: Build beta images
env:
GPG_PASS: ${{ secrets.GPG_PASSPHRASE1 }}
@ -268,7 +268,7 @@ jobs:
workdir: scripts
git-user-signingkey: true
git-commit-gpgsign: true
- name: Build beta images
env:
GPG_PASS: ${{ secrets.GPG_PASSPHRASE1 }}
@ -315,3 +315,205 @@ jobs:
sudo apt-get -y -qq install lftp
sudo chown -R $USER:$USER $(pwd)/build/output/images/
lftp -u upload, -e "set net:timeout 4;set net:max-retries 6;mirror --Remove-source-files -R --no-empty-dirs --parallel=8 --no-perms $(pwd)/build/output/images/ images/ ;bye" sftp://users.armbian.com
worker-4:
name: CLI worker 3/3
runs-on: [self-hosted, Linux, images]
if: ${{ github.repository_owner == 'Armbian' }}
steps:
- name: Fix permissions
run: |
# make sure no temporally dirs are mounted from previous runs
while :
do
sudo pkill compile.sh || true
sudo pkill arm-binfmt-P || true
sudo pkill aarch64-binfmt-P || true
[[ "$(df | grep "/.tmp" | wc -l)" -eq 0 ]] && sudo rm -rf build/.tmp && break
echo "Mounted temp directories. Trying to unmount."
df | grep ".tmp" | awk '{print $6}' | xargs sudo umount 2>/dev/null || true
sleep 10
done
sudo chown -R $USER:$USER .
- name: Checkout Armbian build script
uses: actions/checkout@v2
with:
fetch-depth: 0
repository: armbian/build
path: build
ref: nightly
clean: false
- name: Checkout Armbian support scripts
uses: actions/checkout@v2
with:
fetch-depth: 0
repository: armbian/scripts
token: ${{ secrets.SCRIPTS_ACCESS_TOKEN }}
path: scripts
clean: false
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v3
with:
gpg-private-key: ${{ secrets.GPG_KEY1 }}
passphrase: ${{ secrets.GPG_PASSPHRASE1 }}
workdir: scripts
git-user-signingkey: true
git-commit-gpgsign: true
- name: Build beta images
env:
GPG_PASS: ${{ secrets.GPG_PASSPHRASE1 }}
run: |
cd build
# use prepared configs
sudo cp ../scripts/configs/* userpatches/
# prepare host
[[ ! -f .ignore_changes ]] && sudo touch .ignore_changes
./compile.sh KERNEL_ONLY="yes" BOARD="bananapi" BRANCH="current" KERNEL_CONFIGURE="no" USE_TORRENT="yes" REPOSITORY_INSTALL="kernel" 'prepare_host'
# calculate how many images we can build in parallel
PARALLEL_BUILDS=$(awk '{printf("%d",$1/4000)}' <<<$(($(LC_ALL=C free -w 2>/dev/null | grep "^Mem" | awk '{print $2}' || LC_ALL=C free | grep "^Mem"| awk '{print $2}')/1024)))
# cleaning leftovers if any
rm -rf output/images/*
# split into 5 build chunks
cat config/targets-cli-beta.conf | grep -v "^$" | grep -v "^#" > userpatches/split.conf
split -d --number=l/5 --additional-suffix=.conf --suffix-length=1 userpatches/split.conf userpatches/split-
sudo ln -sf split-3.conf userpatches/targets.conf # Building chunk 4
./compile.sh all-new-beta-images MULTITHREAD="${PARALLEL_BUILDS}" GPG_PASS="${GPG_PASS}"
- name: Install SSH key for storage
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.KEY_TORRENTS }}
known_hosts: ${{ secrets.KNOWN_HOSTS_UPLOAD }}
if_key_exists: replace
- name: Deploy to server
if: ${{ success() }}
run: |
sudo apt-get -y -qq install lftp
sudo chown -R $USER:$USER $(pwd)/build/output/images/
lftp -u upload, -e "set net:timeout 4;set net:max-retries 6;mirror --Remove-source-files -R --no-empty-dirs --parallel=8 --no-perms $(pwd)/build/output/images/ images/ ;bye" sftp://users.armbian.com
worker-5:
name: CLI worker 3/3
runs-on: [self-hosted, Linux, images]
if: ${{ github.repository_owner == 'Armbian' }}
steps:
- name: Fix permissions
run: |
# make sure no temporally dirs are mounted from previous runs
while :
do
sudo pkill compile.sh || true
sudo pkill arm-binfmt-P || true
sudo pkill aarch64-binfmt-P || true
[[ "$(df | grep "/.tmp" | wc -l)" -eq 0 ]] && sudo rm -rf build/.tmp && break
echo "Mounted temp directories. Trying to unmount."
df | grep ".tmp" | awk '{print $6}' | xargs sudo umount 2>/dev/null || true
sleep 10
done
sudo chown -R $USER:$USER .
- name: Checkout Armbian build script
uses: actions/checkout@v2
with:
fetch-depth: 0
repository: armbian/build
path: build
ref: nightly
clean: false
- name: Checkout Armbian support scripts
uses: actions/checkout@v2
with:
fetch-depth: 0
repository: armbian/scripts
token: ${{ secrets.SCRIPTS_ACCESS_TOKEN }}
path: scripts
clean: false
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v3
with:
gpg-private-key: ${{ secrets.GPG_KEY1 }}
passphrase: ${{ secrets.GPG_PASSPHRASE1 }}
workdir: scripts
git-user-signingkey: true
git-commit-gpgsign: true
- name: Build beta images
env:
GPG_PASS: ${{ secrets.GPG_PASSPHRASE1 }}
run: |
cd build
# use prepared configs
sudo cp ../scripts/configs/* userpatches/
# prepare host
[[ ! -f .ignore_changes ]] && sudo touch .ignore_changes
./compile.sh KERNEL_ONLY="yes" BOARD="bananapi" BRANCH="current" KERNEL_CONFIGURE="no" USE_TORRENT="yes" REPOSITORY_INSTALL="kernel" 'prepare_host'
# calculate how many images we can build in parallel
PARALLEL_BUILDS=$(awk '{printf("%d",$1/4000)}' <<<$(($(LC_ALL=C free -w 2>/dev/null | grep "^Mem" | awk '{print $2}' || LC_ALL=C free | grep "^Mem"| awk '{print $2}')/1024)))
# cleaning leftovers if any
rm -rf output/images/*
# split into 5 build chunks
cat config/targets-cli-beta.conf | grep -v "^$" | grep -v "^#" > userpatches/split.conf
split -d --number=l/5 --additional-suffix=.conf --suffix-length=1 userpatches/split.conf userpatches/split-
sudo ln -sf split-4.conf userpatches/targets.conf # Building chunk 5
./compile.sh all-new-beta-images MULTITHREAD="${PARALLEL_BUILDS}" GPG_PASS="${GPG_PASS}"
- name: Install SSH key for storage
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.KEY_TORRENTS }}
known_hosts: ${{ secrets.KNOWN_HOSTS_UPLOAD }}
if_key_exists: replace
- name: Deploy to server
if: ${{ success() }}
run: |
sudo apt-get -y -qq install lftp
sudo chown -R $USER:$USER $(pwd)/build/output/images/
lftp -u upload, -e "set net:timeout 4;set net:max-retries 6;mirror --Remove-source-files -R --no-empty-dirs --parallel=8 --no-perms $(pwd)/build/output/images/ images/ ;bye" sftp://users.armbian.com