From 06c01d3b9deb346422f18b5acd64677c9735fc3f Mon Sep 17 00:00:00 2001 From: Arseni Kalma Date: Mon, 22 Dec 2025 17:15:18 +0100 Subject: [PATCH 1/3] Add clean ecs persistant volume workflow --- .github/workflows/clean-ecs-volume.yml | 354 +++++++++++++++++++++++++ 1 file changed, 354 insertions(+) create mode 100644 .github/workflows/clean-ecs-volume.yml diff --git a/.github/workflows/clean-ecs-volume.yml b/.github/workflows/clean-ecs-volume.yml new file mode 100644 index 00000000000..6d6c1aacce1 --- /dev/null +++ b/.github/workflows/clean-ecs-volume.yml @@ -0,0 +1,354 @@ +name: Clean ECS Volume + +on: + workflow_dispatch: + inputs: + environment: + description: 'Environment (dev, staging, prod)' + required: true + default: 'dev' + type: choice + options: + - dev + region: + description: 'AWS Region' + required: true + default: 'eu-central-1' + type: string + service_name: + description: 'ECS Service name (without environment prefix)' + required: true + default: 'zebra' + type: string + +env: + AWS_REGION: ${{ inputs.region || 'eu-central-1' }} + +jobs: + clean-volume: + name: Clean ECS Volume + runs-on: ubuntu-latest + permissions: + id-token: write + contents: read + + steps: + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} + aws-region: ${{ env.AWS_REGION }} + + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y jq + + - name: Set variables + id: vars + run: | + ENVIRONMENT="${{ inputs.environment || 'dev' }}" + SERVICE_NAME="${{ inputs.service_name || 'zebra' }}" + CLUSTER_NAME="${ENVIRONMENT}-${SERVICE_NAME}-cluster" + ECS_SERVICE_NAME="${ENVIRONMENT}-${SERVICE_NAME}" + + echo "cluster_name=${CLUSTER_NAME}" >> $GITHUB_OUTPUT + echo "ecs_service_name=${ECS_SERVICE_NAME}" >> $GITHUB_OUTPUT + + echo "Cluster: ${CLUSTER_NAME}" + echo "Service: ${ECS_SERVICE_NAME}" + + - name: Get task definition and EFS details + id: get-efs + run: | + # Get the task definition ARN from the service + TASK_DEF_ARN=$(aws ecs describe-services \ + --cluster ${{ steps.vars.outputs.cluster_name }} \ + --services ${{ steps.vars.outputs.ecs_service_name }} \ + --query 'services[0].taskDefinition' \ + --output text) + + echo "task_def_arn=${TASK_DEF_ARN}" >> $GITHUB_OUTPUT + echo "Task Definition: ${TASK_DEF_ARN}" + + # Get EFS file system ID and mount point from task definition + EFS_FS_ID=$(aws ecs describe-task-definition \ + --task-definition "${TASK_DEF_ARN}" \ + --query 'taskDefinition.volumes[?name==`persistent-volume`].efsVolumeConfiguration.fileSystemId' \ + --output text) + + MOUNT_PATH=$(aws ecs describe-task-definition \ + --task-definition "${TASK_DEF_ARN}" \ + --query 'taskDefinition.containerDefinitions[0].mountPoints[?sourceVolume==`persistent-volume`].containerPath' \ + --output text) + + # Get subnet and security group from the service + SUBNETS=$(aws ecs describe-services \ + --cluster ${{ steps.vars.outputs.cluster_name }} \ + --services ${{ steps.vars.outputs.ecs_service_name }} \ + --query 'services[0].networkConfiguration.awsvpcConfiguration.subnets' \ + --output text) + + SECURITY_GROUPS=$(aws ecs describe-services \ + --cluster ${{ steps.vars.outputs.cluster_name }} \ + --services ${{ steps.vars.outputs.ecs_service_name }} \ + --query 'services[0].networkConfiguration.awsvpcConfiguration.securityGroups' \ + --output text) + + # Use first subnet and security group + SUBNET=$(echo $SUBNETS | awk '{print $1}') + SECURITY_GROUP=$(echo $SECURITY_GROUPS | awk '{print $1}') + + if [ -z "$EFS_FS_ID" ] || [ "$EFS_FS_ID" == "None" ]; then + echo "Error: Could not find EFS file system ID in task definition" + exit 1 + fi + + echo "efs_fs_id=${EFS_FS_ID}" >> $GITHUB_OUTPUT + echo "mount_path=${MOUNT_PATH:-/persistent}" >> $GITHUB_OUTPUT + echo "subnet=${SUBNET}" >> $GITHUB_OUTPUT + echo "security_group=${SECURITY_GROUP}" >> $GITHUB_OUTPUT + + echo "EFS File System ID: ${EFS_FS_ID}" + echo "Mount Path: ${MOUNT_PATH:-/persistent}" + echo "Subnet: ${SUBNET}" + echo "Security Group: ${SECURITY_GROUP}" + + - name: Get execution role ARN + id: get-role + run: | + EXEC_ROLE_ARN=$(aws ecs describe-task-definition \ + --task-definition ${{ steps.get-efs.outputs.task_def_arn }} \ + --query 'taskDefinition.executionRoleArn' \ + --output text) + + TASK_ROLE_ARN=$(aws ecs describe-task-definition \ + --task-definition ${{ steps.get-efs.outputs.task_def_arn }} \ + --query 'taskDefinition.taskRoleArn' \ + --output text) + + echo "execution_role_arn=${EXEC_ROLE_ARN}" >> $GITHUB_OUTPUT + echo "task_role_arn=${TASK_ROLE_ARN:-${EXEC_ROLE_ARN}}" >> $GITHUB_OUTPUT + + - name: Run cleanup task + id: cleanup-task + run: | + echo "Running cleanup task to remove all files from ECS volume..." + + # Create a temporary task definition JSON for the cleanup task + CLEANUP_TASK_DEF=$(cat </dev/null || true && find ${{ steps.get-efs.outputs.mount_path }} -mindepth 1 -delete 2>/dev/null || true && echo 'Cleanup completed successfully' && ls -la ${{ steps.get-efs.outputs.mount_path }} || echo 'Directory is empty'" + ], + "mountPoints": [ + { + "sourceVolume": "persistent-volume", + "containerPath": "${{ steps.get-efs.outputs.mount_path }}", + "readOnly": false + } + ], + "logConfiguration": { + "logDriver": "awslogs", + "options": { + "awslogs-group": "/${{ inputs.environment || 'dev' }}/ecs/cleanup-task", + "awslogs-region": "${{ env.AWS_REGION }}", + "awslogs-stream-prefix": "ecs" + } + } + } + ], + "volumes": [ + { + "name": "persistent-volume", + "efsVolumeConfiguration": { + "fileSystemId": "${{ steps.get-efs.outputs.efs_fs_id }}", + "rootDirectory": "/", + "transitEncryption": "ENABLED" + } + } + ] + } + EOF + ) + + # Register the task definition + TASK_DEF_JSON=$(echo "$CLEANUP_TASK_DEF" | jq .) + TASK_DEF_ARN=$(aws ecs register-task-definition \ + --cli-input-json "$TASK_DEF_JSON" \ + --query 'taskDefinition.taskDefinitionArn' \ + --output text) + + echo "task_def_arn=${TASK_DEF_ARN}" >> $GITHUB_OUTPUT + echo "Registered cleanup task definition: ${TASK_DEF_ARN}" + + # Create CloudWatch log group if it doesn't exist + aws logs create-log-group \ + --log-group-name "/${{ inputs.environment || 'dev' }}/ecs/cleanup-task" \ + 2>/dev/null || true + + # Run the cleanup task + NETWORK_CONFIG=$(cat <> $GITHUB_OUTPUT + echo "Started cleanup task: ${TASK_ARN}" + + # Wait for the task to complete + echo "Waiting for cleanup task to complete..." + aws ecs wait tasks-stopped \ + --cluster ${{ steps.vars.outputs.cluster_name }} \ + --tasks "${TASK_ARN}" + + # Get task exit code + EXIT_CODE=$(aws ecs describe-tasks \ + --cluster ${{ steps.vars.outputs.cluster_name }} \ + --tasks "${TASK_ARN}" \ + --query 'tasks[0].containers[0].exitCode' \ + --output text) + + echo "exit_code=${EXIT_CODE}" >> $GITHUB_OUTPUT + + if [ "$EXIT_CODE" != "0" ] && [ "$EXIT_CODE" != "None" ]; then + echo "Warning: Cleanup task exited with code ${EXIT_CODE}" + echo "Checking logs..." + aws logs tail "/${{ inputs.environment || 'dev' }}/ecs/cleanup-task" --since 5m || true + else + echo "Cleanup task completed successfully" + fi + + - name: Verify cleanup + run: | + echo "Verifying cleanup by checking EFS contents..." + + # Run a verification task + VERIFY_TASK_DEF=$(cat <> $GITHUB_STEP_SUMMARY + echo "- Cluster: ${{ steps.vars.outputs.cluster_name }}" >> $GITHUB_STEP_SUMMARY + echo "- Service: ${{ steps.vars.outputs.ecs_service_name }}" >> $GITHUB_STEP_SUMMARY + echo "- EFS File System: ${{ steps.get-efs.outputs.efs_fs_id }}" >> $GITHUB_STEP_SUMMARY + echo "- Mount Path: ${{ steps.get-efs.outputs.mount_path }}" >> $GITHUB_STEP_SUMMARY + echo "- Cleanup Task: ${{ steps.cleanup-task.outputs.task_arn }}" >> $GITHUB_STEP_SUMMARY + echo "- Exit Code: ${{ steps.cleanup-task.outputs.exit_code }}" >> $GITHUB_STEP_SUMMARY + + if [ "${{ steps.cleanup-task.outputs.exit_code }}" == "0" ] || [ "${{ steps.cleanup-task.outputs.exit_code }}" == "None" ]; then + echo "✅ ECS volume cleaned successfully" >> $GITHUB_STEP_SUMMARY + else + echo "⚠️ Cleanup completed with warnings. Check logs for details." >> $GITHUB_STEP_SUMMARY + fi From 685b3f50ff94bb730ccacf4bb5ea29d1790ec73d Mon Sep 17 00:00:00 2001 From: Arseni Kalma Date: Mon, 29 Dec 2025 08:54:43 +0100 Subject: [PATCH 2/3] Add simplification --- .github/workflows/clean-ecs-volume.yml | 346 ++++++------------ .../regtest-config.toml | 5 +- 2 files changed, 120 insertions(+), 231 deletions(-) diff --git a/.github/workflows/clean-ecs-volume.yml b/.github/workflows/clean-ecs-volume.yml index 6d6c1aacce1..e673abb1fb0 100644 --- a/.github/workflows/clean-ecs-volume.yml +++ b/.github/workflows/clean-ecs-volume.yml @@ -2,27 +2,11 @@ name: Clean ECS Volume on: workflow_dispatch: - inputs: - environment: - description: 'Environment (dev, staging, prod)' - required: true - default: 'dev' - type: choice - options: - - dev - region: - description: 'AWS Region' - required: true - default: 'eu-central-1' - type: string - service_name: - description: 'ECS Service name (without environment prefix)' - required: true - default: 'zebra' - type: string env: - AWS_REGION: ${{ inputs.region || 'eu-central-1' }} + AWS_REGION: eu-central-1 + ENVIRONMENT: dev + SERVICE_NAME: zebra jobs: clean-volume: @@ -36,7 +20,8 @@ jobs: - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v4 with: - role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} aws-region: ${{ env.AWS_REGION }} - name: Install dependencies @@ -47,19 +32,20 @@ jobs: - name: Set variables id: vars run: | - ENVIRONMENT="${{ inputs.environment || 'dev' }}" - SERVICE_NAME="${{ inputs.service_name || 'zebra' }}" - CLUSTER_NAME="${ENVIRONMENT}-${SERVICE_NAME}-cluster" - ECS_SERVICE_NAME="${ENVIRONMENT}-${SERVICE_NAME}" + CLUSTER_NAME="${{ env.ENVIRONMENT }}-${{ env.SERVICE_NAME }}-cluster" + ECS_SERVICE_NAME="${{ env.ENVIRONMENT }}-${{ env.SERVICE_NAME }}" + CONTAINER_NAME="${{ env.SERVICE_NAME }}-container" echo "cluster_name=${CLUSTER_NAME}" >> $GITHUB_OUTPUT echo "ecs_service_name=${ECS_SERVICE_NAME}" >> $GITHUB_OUTPUT + echo "container_name=${CONTAINER_NAME}" >> $GITHUB_OUTPUT echo "Cluster: ${CLUSTER_NAME}" echo "Service: ${ECS_SERVICE_NAME}" + echo "Container: ${CONTAINER_NAME}" - - name: Get task definition and EFS details - id: get-efs + - name: Get task definition and network config + id: get-config run: | # Get the task definition ARN from the service TASK_DEF_ARN=$(aws ecs describe-services \ @@ -71,17 +57,15 @@ jobs: echo "task_def_arn=${TASK_DEF_ARN}" >> $GITHUB_OUTPUT echo "Task Definition: ${TASK_DEF_ARN}" - # Get EFS file system ID and mount point from task definition - EFS_FS_ID=$(aws ecs describe-task-definition \ - --task-definition "${TASK_DEF_ARN}" \ - --query 'taskDefinition.volumes[?name==`persistent-volume`].efsVolumeConfiguration.fileSystemId' \ - --output text) - + # Get mount path from task definition MOUNT_PATH=$(aws ecs describe-task-definition \ --task-definition "${TASK_DEF_ARN}" \ --query 'taskDefinition.containerDefinitions[0].mountPoints[?sourceVolume==`persistent-volume`].containerPath' \ --output text) + echo "mount_path=${MOUNT_PATH:-/persistent}" >> $GITHUB_OUTPUT + echo "Mount Path: ${MOUNT_PATH:-/persistent}" + # Get subnet and security group from the service SUBNETS=$(aws ecs describe-services \ --cluster ${{ steps.vars.outputs.cluster_name }} \ @@ -99,128 +83,107 @@ jobs: SUBNET=$(echo $SUBNETS | awk '{print $1}') SECURITY_GROUP=$(echo $SECURITY_GROUPS | awk '{print $1}') - if [ -z "$EFS_FS_ID" ] || [ "$EFS_FS_ID" == "None" ]; then - echo "Error: Could not find EFS file system ID in task definition" - exit 1 - fi - - echo "efs_fs_id=${EFS_FS_ID}" >> $GITHUB_OUTPUT - echo "mount_path=${MOUNT_PATH:-/persistent}" >> $GITHUB_OUTPUT echo "subnet=${SUBNET}" >> $GITHUB_OUTPUT echo "security_group=${SECURITY_GROUP}" >> $GITHUB_OUTPUT - echo "EFS File System ID: ${EFS_FS_ID}" - echo "Mount Path: ${MOUNT_PATH:-/persistent}" echo "Subnet: ${SUBNET}" echo "Security Group: ${SECURITY_GROUP}" - - name: Get execution role ARN - id: get-role + - name: Get EFS and role details + id: get-efs run: | - EXEC_ROLE_ARN=$(aws ecs describe-task-definition \ - --task-definition ${{ steps.get-efs.outputs.task_def_arn }} \ - --query 'taskDefinition.executionRoleArn' \ - --output text) + # Get EFS file system ID and roles from task definition + TASK_DEF_JSON=$(aws ecs describe-task-definition --task-definition ${{ steps.get-config.outputs.task_def_arn }}) - TASK_ROLE_ARN=$(aws ecs describe-task-definition \ - --task-definition ${{ steps.get-efs.outputs.task_def_arn }} \ - --query 'taskDefinition.taskRoleArn' \ - --output text) + EFS_FS_ID=$(echo "$TASK_DEF_JSON" | jq -r '.taskDefinition.volumes[]? | select(.name=="persistent-volume") | .efsVolumeConfiguration.fileSystemId') + EXEC_ROLE_ARN=$(echo "$TASK_DEF_JSON" | jq -r '.taskDefinition.executionRoleArn') + TASK_ROLE_ARN=$(echo "$TASK_DEF_JSON" | jq -r '.taskDefinition.taskRoleArn // empty') + echo "efs_fs_id=${EFS_FS_ID}" >> $GITHUB_OUTPUT echo "execution_role_arn=${EXEC_ROLE_ARN}" >> $GITHUB_OUTPUT echo "task_role_arn=${TASK_ROLE_ARN:-${EXEC_ROLE_ARN}}" >> $GITHUB_OUTPUT + + echo "EFS File System ID: ${EFS_FS_ID}" - name: Run cleanup task id: cleanup-task run: | - echo "Running cleanup task to remove all files from ECS volume..." - - # Create a temporary task definition JSON for the cleanup task - CLEANUP_TASK_DEF=$(cat </dev/null || true && find ${{ steps.get-efs.outputs.mount_path }} -mindepth 1 -delete 2>/dev/null || true && echo 'Cleanup completed successfully' && ls -la ${{ steps.get-efs.outputs.mount_path }} || echo 'Directory is empty'" - ], - "mountPoints": [ - { - "sourceVolume": "persistent-volume", - "containerPath": "${{ steps.get-efs.outputs.mount_path }}", - "readOnly": false - } - ], - "logConfiguration": { - "logDriver": "awslogs", - "options": { - "awslogs-group": "/${{ inputs.environment || 'dev' }}/ecs/cleanup-task", - "awslogs-region": "${{ env.AWS_REGION }}", - "awslogs-stream-prefix": "ecs" - } - } + echo "Running cleanup task to remove all files from ECS volume at ${{ steps.get-config.outputs.mount_path }}..." + + # Prepare network configuration + NETWORK_CONFIG=$(jq -n \ + --arg subnet "${{ steps.get-config.outputs.subnet }}" \ + --arg sg "${{ steps.get-config.outputs.security_group }}" \ + '{ + awsvpcConfiguration: { + subnets: [$subnet], + securityGroups: [$sg], + assignPublicIp: "DISABLED" } - ], - "volumes": [ - { - "name": "persistent-volume", - "efsVolumeConfiguration": { - "fileSystemId": "${{ steps.get-efs.outputs.efs_fs_id }}", - "rootDirectory": "/", - "transitEncryption": "ENABLED" + }') + + # Build cleanup command + CLEANUP_CMD="echo 'Starting cleanup...' && rm -rf ${{ steps.get-config.outputs.mount_path }}/* ${{ steps.get-config.outputs.mount_path }}/.[!.]* ${{ steps.get-config.outputs.mount_path }}/..?* 2>/dev/null || true && find ${{ steps.get-config.outputs.mount_path }} -mindepth 1 -delete 2>/dev/null || true && echo 'Cleanup completed' && ls -la ${{ steps.get-config.outputs.mount_path }} && echo 'Volume is now empty' && sleep 10" + + # Build cleanup task definition using Alpine (no entrypoint issues) + CLEANUP_TASK_DEF=$(jq -n \ + --arg exec_role "${{ steps.get-efs.outputs.execution_role_arn }}" \ + --arg task_role "${{ steps.get-efs.outputs.task_role_arn }}" \ + --arg efs_id "${{ steps.get-efs.outputs.efs_fs_id }}" \ + --arg mount_path "${{ steps.get-config.outputs.mount_path }}" \ + --arg cmd "${CLEANUP_CMD}" \ + '{ + family: "cleanup-ecs-volume", + networkMode: "awsvpc", + requiresCompatibilities: ["FARGATE"], + cpu: "256", + memory: "512", + executionRoleArn: $exec_role, + taskRoleArn: $task_role, + containerDefinitions: [{ + name: "cleanup-container", + image: "alpine:latest", + essential: true, + command: ["/bin/sh", "-c", $cmd], + mountPoints: [{ + sourceVolume: "persistent-volume", + containerPath: $mount_path, + readOnly: false + }] + }], + volumes: [{ + name: "persistent-volume", + efsVolumeConfiguration: { + fileSystemId: $efs_id, + rootDirectory: "/", + transitEncryption: "ENABLED" } - } - ] - } - EOF - ) + }] + }') - # Register the task definition - TASK_DEF_JSON=$(echo "$CLEANUP_TASK_DEF" | jq .) - TASK_DEF_ARN=$(aws ecs register-task-definition \ - --cli-input-json "$TASK_DEF_JSON" \ + # Register cleanup task definition + CLEANUP_TASK_DEF_ARN=$(echo "$CLEANUP_TASK_DEF" | \ + aws ecs register-task-definition \ + --cli-input-json file:///dev/stdin \ --query 'taskDefinition.taskDefinitionArn' \ --output text) - echo "task_def_arn=${TASK_DEF_ARN}" >> $GITHUB_OUTPUT - echo "Registered cleanup task definition: ${TASK_DEF_ARN}" - - # Create CloudWatch log group if it doesn't exist - aws logs create-log-group \ - --log-group-name "/${{ inputs.environment || 'dev' }}/ecs/cleanup-task" \ - 2>/dev/null || true - - # Run the cleanup task - NETWORK_CONFIG=$(cat <> $GITHUB_OUTPUT echo "Started cleanup task: ${TASK_ARN}" @@ -237,118 +200,43 @@ jobs: --query 'tasks[0].containers[0].exitCode' \ --output text) - echo "exit_code=${EXIT_CODE}" >> $GITHUB_OUTPUT - - if [ "$EXIT_CODE" != "0" ] && [ "$EXIT_CODE" != "None" ]; then - echo "Warning: Cleanup task exited with code ${EXIT_CODE}" - echo "Checking logs..." - aws logs tail "/${{ inputs.environment || 'dev' }}/ecs/cleanup-task" --since 5m || true - else - echo "Cleanup task completed successfully" - fi - - - name: Verify cleanup - run: | - echo "Verifying cleanup by checking EFS contents..." - - # Run a verification task - VERIFY_TASK_DEF=$(cat <> $GITHUB_OUTPUT + echo "stop_reason=${STOP_REASON}" >> $GITHUB_OUTPUT + + echo "Task stopped with exit code: ${EXIT_CODE}" + echo "Stop reason: ${STOP_REASON}" - aws ecs wait tasks-stopped \ - --cluster ${{ steps.vars.outputs.cluster_name }} \ - --tasks "${VERIFY_TASK_ARN}" + if [ "$EXIT_CODE" != "0" ] && [ "$EXIT_CODE" != "None" ]; then + echo "::warning::Cleanup task exited with code ${EXIT_CODE}" + exit 1 + fi - echo "Verification logs:" - aws logs tail "/${{ inputs.environment || 'dev' }}/ecs/cleanup-task" --since 2m --filter-pattern "verify" || true + echo "✅ Cleanup completed successfully" - name: Cleanup summary if: always() run: | echo "## Cleanup Summary" >> $GITHUB_STEP_SUMMARY - echo "- Cluster: ${{ steps.vars.outputs.cluster_name }}" >> $GITHUB_STEP_SUMMARY - echo "- Service: ${{ steps.vars.outputs.ecs_service_name }}" >> $GITHUB_STEP_SUMMARY - echo "- EFS File System: ${{ steps.get-efs.outputs.efs_fs_id }}" >> $GITHUB_STEP_SUMMARY - echo "- Mount Path: ${{ steps.get-efs.outputs.mount_path }}" >> $GITHUB_STEP_SUMMARY - echo "- Cleanup Task: ${{ steps.cleanup-task.outputs.task_arn }}" >> $GITHUB_STEP_SUMMARY - echo "- Exit Code: ${{ steps.cleanup-task.outputs.exit_code }}" >> $GITHUB_STEP_SUMMARY - - if [ "${{ steps.cleanup-task.outputs.exit_code }}" == "0" ] || [ "${{ steps.cleanup-task.outputs.exit_code }}" == "None" ]; then - echo "✅ ECS volume cleaned successfully" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "**Environment Details:**" >> $GITHUB_STEP_SUMMARY + echo "- Cluster: \`${{ steps.vars.outputs.cluster_name }}\`" >> $GITHUB_STEP_SUMMARY + echo "- Service: \`${{ steps.vars.outputs.ecs_service_name }}\`" >> $GITHUB_STEP_SUMMARY + echo "- Mount Path: \`${{ steps.get-config.outputs.mount_path }}\`" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "**Task Details:**" >> $GITHUB_STEP_SUMMARY + echo "- Task ARN: \`${{ steps.cleanup-task.outputs.task_arn }}\`" >> $GITHUB_STEP_SUMMARY + echo "- Exit Code: \`${{ steps.cleanup-task.outputs.exit_code }}\`" >> $GITHUB_STEP_SUMMARY + echo "- Stop Reason: \`${{ steps.cleanup-task.outputs.stop_reason }}\`" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + + if [ "${{ steps.cleanup-task.outputs.exit_code }}" == "0" ]; then + echo "✅ **Status:** ECS volume cleaned successfully" >> $GITHUB_STEP_SUMMARY else - echo "⚠️ Cleanup completed with warnings. Check logs for details." >> $GITHUB_STEP_SUMMARY + echo "⚠️ **Status:** Cleanup completed with errors" >> $GITHUB_STEP_SUMMARY fi diff --git a/testnet-single-node-deploy/regtest-config.toml b/testnet-single-node-deploy/regtest-config.toml index 5e2322674d9..97b52be0538 100644 --- a/testnet-single-node-deploy/regtest-config.toml +++ b/testnet-single-node-deploy/regtest-config.toml @@ -12,9 +12,10 @@ NU5 = 1 NU6 = 1 NU7 = 1 -# This section may be omitted if a persistent Regtest chain state is desired +# Persist state to EFS volume [state] -ephemeral = true +ephemeral = false +cache_dir = "/persistent" # This section may be omitted if it's not necessary to send transactions to Zebra's mempool [rpc] From 7b02e6582c6f3acf6e5ef8f35aa9a50f7913e23f Mon Sep 17 00:00:00 2001 From: Arseni Kalma Date: Mon, 29 Dec 2025 09:04:58 +0100 Subject: [PATCH 3/3] Update regtest-config.toml --- testnet-single-node-deploy/regtest-config.toml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/testnet-single-node-deploy/regtest-config.toml b/testnet-single-node-deploy/regtest-config.toml index 97b52be0538..5e2322674d9 100644 --- a/testnet-single-node-deploy/regtest-config.toml +++ b/testnet-single-node-deploy/regtest-config.toml @@ -12,10 +12,9 @@ NU5 = 1 NU6 = 1 NU7 = 1 -# Persist state to EFS volume +# This section may be omitted if a persistent Regtest chain state is desired [state] -ephemeral = false -cache_dir = "/persistent" +ephemeral = true # This section may be omitted if it's not necessary to send transactions to Zebra's mempool [rpc]