Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ci): WAN nightly churn #1544

Merged
merged 1 commit into from
Apr 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
151 changes: 151 additions & 0 deletions .github/workflows/nightly_wan_churn.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
name: Nightly -- Perform long running network churn

on:
schedule:
- cron: "0 */12 * * *"
workflow_dispatch:


env:
CARGO_INCREMENTAL: 0 # bookkeeping for incremental builds has overhead, not useful in CI.
WORKFLOW_URL: https://github.com/maidsafe/stableset_net/actions/runs

jobs:
e2e:
name: E2E
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v4

- name: Install Rust
uses: dtolnay/rust-toolchain@stable

- uses: Swatinem/rust-cache@v2
continue-on-error: true

- name: Build safe
run: cargo build --release --bin safe
timeout-minutes: 30

- name: Start a WAN network
uses: maidsafe/sn-testnet-action@main
with:
action: create
re-attempts: 3
rust-log: debug
ansible-vault-password: ${{ secrets.SN_TESTNET_ANSIBLE_VAULT_PASSWORD }}
aws-access-key-id: ${{ secrets.SN_TESTNET_AWS_ACCESS_KEY_ID }}
aws-access-key-secret: ${{ secrets.SN_TESTNET_AWS_SECRET_ACCESS_KEY }}
aws-region: eu-west-2
do-token: ${{ secrets.SN_TESTNET_DO_PAT }}
ssh-secret-key: ${{ secrets.SN_TESTNET_SSH_KEY }}
security-group-id: sg-0d47df5b3f0d01e2a
subnet-id: subnet-018f2ab26755df7f9
node-count: 20
vm-count: 5
provider: digital-ocean
testnet-name: NightlyChurnE2E
custom-node-bin-org-name: maidsafe
custom-node-bin-branch-name: main

- name: Download material, 1.6G
shell: bash
run: |
wget https://releases.ubuntu.com/16.04/ubuntu-16.04.7-desktop-amd64.iso
ls -l

- name: Check env variables
shell: bash
run: |
echo "Peer is $SAFE_PEERS"
echo "Deployment inventory is $SN_INVENTORY"

- name: Obtain the funds from the faucet
run: |
# read the inventory file
inventory_path=/home/runner/.local/share/safe/testnet-deploy/NightlyChurnE2E-inventory.json
echo "Inventory Path: $inventory_path"
faucet_address=$(jq -r '.faucet_address' $inventory_path)
cargo run --bin safe --release -- wallet get-faucet ${faucet_address}
cargo run --bin safe --release -- wallet get-faucet ${faucet_address}
cargo run --bin safe --release -- wallet get-faucet ${faucet_address}
cargo run --bin safe --release -- wallet get-faucet ${faucet_address}
cargo run --bin safe --release -- wallet get-faucet ${faucet_address}
env:
SN_LOG: "all"
timeout-minutes: 2

- name: Start a client to upload
run: cargo run --bin safe -- --log-output-dest=data-dir files upload "ubuntu-16.04.7-desktop-amd64.iso" --retry-strategy quick
env:
SN_LOG: "all"
timeout-minutes: 45

- name: Cause random churn
uses: maidsafe/sn-testnet-action/network_commands@main
with:
action: churn-random
testnet-name: NightlyChurnE2E
churn-cycles: 3
retain-peer-id: false
random-churn-time-frame: 60
random-churn-count: 5

- name: Start a client to download files
run: cargo run --bin safe --release -- --log-output-dest=data-dir files download --retry-strategy quick
env:
SN_LOG: "all"
timeout-minutes: 30

- name: Fetch network logs
if: always()
uses: maidsafe/sn-testnet-action@main
with:
action: logs
re-attempts: 3
rust-log: debug
ansible-vault-password: ${{ secrets.SN_TESTNET_ANSIBLE_VAULT_PASSWORD }}
aws-access-key-id: ${{ secrets.SN_TESTNET_AWS_ACCESS_KEY_ID }}
aws-access-key-secret: ${{ secrets.SN_TESTNET_AWS_SECRET_ACCESS_KEY }}
aws-region: eu-west-2
do-token: ${{ secrets.SN_TESTNET_DO_PAT }}
ssh-secret-key: ${{ secrets.SN_TESTNET_SSH_KEY }}
node-count: 20
vm-count: 1
provider: digital-ocean
testnet-name: NightlyChurnE2E
custom-node-bin-org-name: maidsafe
custom-node-bin-branch-name: main

- name: Upload local logs
if: always()
uses: actions/upload-artifact@v4
with:
name: local_logs_NightlyChurnE2E
path: |
~/.local/share/safe/node/*/logs/*.log*
~/.local/share/safe/*/*/*.log*
~/.local/share/safe/client/logs/*/*.log*

- name: Stop the WAN network
if: always()
uses: maidsafe/sn-testnet-action@main
with:
action: destroy
re-attempts: 3
rust-log: debug
ansible-vault-password: ${{ secrets.SN_TESTNET_ANSIBLE_VAULT_PASSWORD }}
aws-access-key-id: ${{ secrets.SN_TESTNET_AWS_ACCESS_KEY_ID }}
aws-access-key-secret: ${{ secrets.SN_TESTNET_AWS_SECRET_ACCESS_KEY }}
aws-region: eu-west-2
do-token: ${{ secrets.SN_TESTNET_DO_PAT }}
ssh-secret-key: ${{ secrets.SN_TESTNET_SSH_KEY }}
node-count: 20
vm-count: 1
provider: digital-ocean
testnet-name: NightlyChurnE2E
custom-node-bin-org-name: maidsafe
custom-node-bin-branch-name: main
Loading