Skaled Manually-Running Tests #741
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
name: Skaled Manually-Running Tests | |
on: | |
workflow_dispatch: | |
inputs: | |
suite: | |
description: 'Test Suite' | |
default: 'stability' | |
required: true | |
test: | |
description: 'Test' | |
default: 'down_up' | |
required: true | |
skaled_provider: | |
description: 'Skaled Provider (binary_from_container|binary_as_artifact|container)' | |
default: 'endpoint_by_terraform_with_containers' | |
required: true | |
num_nodes: | |
description: 'Num Nodes' | |
default: '16' | |
required: true | |
skaled_release: | |
description: 'Skaled Release' | |
default: 'develop-latest' | |
required: true | |
kick_interval: | |
description: 'KICK_INTERVAL (stability test)' | |
default: '450' | |
required: true | |
jobs: | |
main_job: | |
runs-on: self-hosted | |
timeout-minutes: 4200 | |
env: | |
ACTIONS_ALLOW_UNSECURE_COMMANDS: true | |
PROJECT: skaled | |
SUITE: ${{ github.event.inputs.suite || 'stability' }} | |
TEST: ${{ github.event.inputs.test || 'down_up' }} | |
SKALED_PROVIDER: skaled_providers/${{ github.event.inputs.skaled_provider || 'endpoint_by_terraform_with_containers' }} | |
SKALED_RELEASE: ${{ github.event.inputs.skaled_release || 'develop-latest' }} | |
NUM_NODES: ${{ github.event.inputs.num_nodes || '16' }} | |
AWS_ACCESS_KEY: ${{ secrets.AWS_ACCESS_KEY }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
TF_VAR_access_key: ${{ secrets.AWS_ACCESS_KEY }} | |
TF_VAR_secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
NO_ULIMIT_CHECK: 1 | |
KICK_INTERVAL: ${{ github.event.inputs.kick_interval || '1800' }} | |
steps: | |
- name: Add secrets | |
run: | | |
touch ~/.netrc | |
chmod 600 ~/.netrc | |
echo "machine github.com" > ~/.netrc | |
echo "login dimalit" >> ~/.netrc | |
echo "password ${{ secrets.DIMALIT_ACCESS_TOKEN }}" >> ~/.netrc | |
echo "${{ secrets.D4_AWS_PEM }}" > ~/d4_aws.pem | |
echo "${{ secrets.GRAFANA_CI_KEY }}" > ~/grafana_ci | |
chmod 600 ~/grafana_ci | |
- uses: hashicorp/setup-terraform@v1.1.0 | |
with: | |
terraform_wrapper: false | |
- name: Clean up | |
run: | | |
pwd | |
mounts=$(mount | awk -F ' on | type' '{print $2}' | grep '/btrfs$')||true | |
echo $mounts | |
for m in $mounts; do sudo umount $m; done | |
sudo rm -rf * | |
- uses: actions/checkout@v2 | |
with: | |
ssh-key: '${{secrets.RUNNER_SSH_KEY}}' | |
submodules: 'recursive' | |
- run: cd skaled_providers/endpoint_by_terraform_with_containers/tf/tf_scripts && terraform init | |
- name: Prepare SGX keys/certs | |
run: | | |
echo "${{ secrets.sgx_key }}" > sgx_certs/sgx.key | |
chmod 600 sgx_certs/sgx.key | |
sudo mkdir /skale_node_data || true | |
sudo cp -r sgx_certs /skale_node_data | |
sudo chown -R $USER:$USER /skale_node_data/sgx_certs/* | |
- name: Update Environment | |
run: | | |
./update_environment.sh $PROJECT+$SUITE | |
- name: Run Tests | |
continue-on-error: true | |
run: | | |
export DATA_DIR="$HOME/data_dir" | |
echo "::set-env name=DATA_DIR::$DATA_DIR" | |
sudo rm -rf $DATA_DIR || true | |
mkdir $DATA_DIR | |
./run_tests.sh $PROJECT+$SUITE+$TEST | |
- name: Clean up AWS | |
if: ${{ always() && env.SKALED_PROVIDER == 'skaled_providers/endpoint_by_terraform_with_containers' }} | |
continue-on-error: true | |
run: | | |
cd skaled_providers/endpoint_by_terraform_with_containers | |
NUM_NODES=${{ env.NUM_NODES }} ./free_skaled.sh | |
- uses: actions/upload-artifact@v4 | |
if: ${{ always() && env.SKALED_PROVIDER == 'skaled_providers/endpoint_by_terraform_with_containers' }} | |
continue-on-error: true | |
with: | |
name: aws_config | |
path: | | |
skaled_providers/endpoint_by_terraform_with_containers/tf/output.json | |
- name: Save logs | |
if: ${{ always() && env.SKALED_PROVIDER == 'skaled_providers/endpoint_by_container' }} | |
run: | | |
sudo docker logs $(docker ps -a -q) 2>aleth.err 1>aleth.out || true | |
sudo chown $USER:$USER aleth.* | |
continue-on-error: true | |
- uses: actions/upload-artifact@v4 | |
if: ${{ always() && env.SKALED_PROVIDER == 'skaled_providers/endpoint_by_container' }} | |
continue-on-error: true | |
with: | |
path: | | |
skaled_providers/endpoint_by_container/data_dir/config.json | |
aleth.* | |
- uses: actions/upload-artifact@v4 | |
if: ${{ always() && startsWith(env.SKALED_PROVIDER, 'skaled_providers/binary_') }} | |
continue-on-error: true | |
with: | |
name: data_dir | |
path: | | |
${{ env.DATA_DIR }}/**/aleth.* | |
${{ env.DATA_DIR }}/**/config.json | |
- uses: actions/upload-artifact@v4 | |
if: ${{ always() && env.TEST == 'skaled_chart' }} | |
continue-on-error: true | |
with: | |
name: skaled_chart | |
path: | | |
integration_tests/skaled/load_js/skaled_chart.png | |
integration_tests/skaled/load_js/skaled_chart.txt |