From fec208a7cd4d05e8db67df32636431b07d44d795 Mon Sep 17 00:00:00 2001 From: "Ward Nakchbandi (Cosmic Fusion)" <83735213+CosmicFusion@users.noreply.github.com> Date: Sun, 27 Aug 2023 21:10:13 +0300 Subject: [PATCH] --- .github/workflows/amdgpu-wipe-clean.yml | 44 +++++++++++++++++++++++ .github/workflows/external-wipe-clean.yml | 2 +- .github/workflows/rocm-wipe-clean.yml | 44 +++++++++++++++++++++++ amdgpu-wipe-clean.sh | 13 +++++++ rocm-wipe-clean.sh | 13 +++++++ 5 files changed, 115 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/amdgpu-wipe-clean.yml create mode 100644 .github/workflows/rocm-wipe-clean.yml create mode 100644 amdgpu-wipe-clean.sh create mode 100644 rocm-wipe-clean.sh diff --git a/.github/workflows/amdgpu-wipe-clean.yml b/.github/workflows/amdgpu-wipe-clean.yml new file mode 100644 index 0000000..a2ad4ab --- /dev/null +++ b/.github/workflows/amdgpu-wipe-clean.yml @@ -0,0 +1,44 @@ +name: Wipe AMDGPU Pool Clean (Danger) + +on: + workflow_dispatch: + +jobs: + build: + runs-on: self-hosted + container: + image: ghcr.io/pikaos-linux/pika-package-container:latest + volumes: + - /proc:/proc + options: --privileged -it + + steps: + - uses: actions/checkout@v3 + + - name: Import GPG key + id: import_gpg + uses: crazy-max/ghaction-import-gpg@v5 + with: + gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} + passphrase: ${{ secrets.PASSPHRASE }} + + - name: Install SSH key + uses: shimataro/ssh-key-action@v2 + with: + key: ${{ secrets.SSH_KEY }} + name: id_rsa + known_hosts: ${{ secrets.KNOWN_HOSTS }} + if_key_exists: replace + + - name: Sync Repository + run: chmod +x ./amdgpu-wipe-clean.sh && ./amdgpu-wipe-clean.sh + + - name: Purge cache + uses: jakejarvis/cloudflare-purge-action@master + env: + # Zone is required by both authentication methods + CLOUDFLARE_ZONE: ${{ secrets.CLOUDFLARE_ZONE }} + + CLOUDFLARE_TOKEN: ${{ secrets.CLOUDFLARE_TOKEN }} + PURGE_URLS: ${{ vars.PURGE_URLS }} + diff --git a/.github/workflows/external-wipe-clean.yml b/.github/workflows/external-wipe-clean.yml index 5730d44..b44c0e2 100644 --- a/.github/workflows/external-wipe-clean.yml +++ b/.github/workflows/external-wipe-clean.yml @@ -1,4 +1,4 @@ -name: Fucking Destroy the pool (External) +name: Wipe External Pool Clean (Danger) on: workflow_dispatch: diff --git a/.github/workflows/rocm-wipe-clean.yml b/.github/workflows/rocm-wipe-clean.yml new file mode 100644 index 0000000..263ab0e --- /dev/null +++ b/.github/workflows/rocm-wipe-clean.yml @@ -0,0 +1,44 @@ +name: Wipe ROCm Pool Clean (Danger) + +on: + workflow_dispatch: + +jobs: + build: + runs-on: self-hosted + container: + image: ghcr.io/pikaos-linux/pika-package-container:latest + volumes: + - /proc:/proc + options: --privileged -it + + steps: + - uses: actions/checkout@v3 + + - name: Import GPG key + id: import_gpg + uses: crazy-max/ghaction-import-gpg@v5 + with: + gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} + passphrase: ${{ secrets.PASSPHRASE }} + + - name: Install SSH key + uses: shimataro/ssh-key-action@v2 + with: + key: ${{ secrets.SSH_KEY }} + name: id_rsa + known_hosts: ${{ secrets.KNOWN_HOSTS }} + if_key_exists: replace + + - name: Sync Repository + run: chmod +x ./rocm-wipe-clean.sh && ./rocm-wipe-clean.sh + + - name: Purge cache + uses: jakejarvis/cloudflare-purge-action@master + env: + # Zone is required by both authentication methods + CLOUDFLARE_ZONE: ${{ secrets.CLOUDFLARE_ZONE }} + + CLOUDFLARE_TOKEN: ${{ secrets.CLOUDFLARE_TOKEN }} + PURGE_URLS: ${{ vars.PURGE_URLS }} + diff --git a/amdgpu-wipe-clean.sh b/amdgpu-wipe-clean.sh new file mode 100644 index 0000000..94bf35f --- /dev/null +++ b/amdgpu-wipe-clean.sh @@ -0,0 +1,13 @@ +#! /bin/bash +set -e + +### In the Case of a major mishap we wipe the amdgpu pool clean and re run all repos +# Pull down existing ppa repo db files etc +mkdir -p ./output/repo +rsync -azP --exclude '*.deb' ferreo@direct.pika-os.com:/srv/www/pikappa/ ./output/repo + +# Remove our All package from the pool +reprepro -C amdgpu -V --basedir ./output/repo/ removefilter lunar 'Package (% *)' + +# Push the updated ppa repo to the server +rsync -azP ./output/repo/ ferreo@direct.pika-os.com:/srv/www/pikappa/ \ No newline at end of file diff --git a/rocm-wipe-clean.sh b/rocm-wipe-clean.sh new file mode 100644 index 0000000..a1c2448 --- /dev/null +++ b/rocm-wipe-clean.sh @@ -0,0 +1,13 @@ +#! /bin/bash +set -e + +### In the Case of a major mishap we wipe the rocm pool clean and re run all repos +# Pull down existing ppa repo db files etc +mkdir -p ./output/repo +rsync -azP --exclude '*.deb' ferreo@direct.pika-os.com:/srv/www/pikappa/ ./output/repo + +# Remove our All package from the pool +reprepro -C rocm -V --basedir ./output/repo/ removefilter lunar 'Package (% *)' + +# Push the updated ppa repo to the server +rsync -azP ./output/repo/ ferreo@direct.pika-os.com:/srv/www/pikappa/ \ No newline at end of file