-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8e8f862
commit 134452e
Showing
7 changed files
with
128 additions
and
2 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: 'Archive sandbox logs' | ||
inputs: | ||
test-object: | ||
description: 'object under test' | ||
required: true | ||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: Save sandbox logs | ||
uses: jwalton/gh-docker-logs@v2 | ||
with: | ||
dest: './logs-${{ inputs.test-object }}' | ||
|
||
- name: Compress logs | ||
shell: bash | ||
run: tar cvzf ./logs-${{ inputs.test-object }}.tgz ./logs-${{ inputs.test-object }} | ||
|
||
- name: Upload logs | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: logs-${{ inputs.test-object }}.tgz | ||
path: ./logs-${{ inputs.test-object }}.tgz |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: 'Archive sandbox volume' | ||
inputs: | ||
test-object: | ||
description: 'object under test' | ||
required: true | ||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: save volume | ||
shell: bash | ||
run: docker run --rm -v sandbox_sandbox:/bckp-vol -v ./:/bckp busybox tar -zcvf /bckp/devnet-vol.tar.gz /bckp-vol | ||
working-directory: .github/actions/archive-volumes | ||
|
||
- name: Upload Volume | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: sandbox_volume_${{ inputs.test-object }} | ||
path: .github/actions/archive-volumes/devnet-vol.tar.gz |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Start Devnet Container | ||
|
||
- Starts a Devnet provider | ||
- Optionally perform a few aditional migrations | ||
|
||
## Examples | ||
|
||
#### Typical Use Case | ||
|
||
```yaml | ||
- name: Start devnet | ||
uses: ./.github/actions/devnet | ||
with: | ||
migrations: packages/apps/graph/cwd-extra-migrations | ||
``` |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name: 'Start Kadena sandbox' | ||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: Start sandbox | ||
shell: bash | ||
run: docker compose up -d | ||
working-directory: .github/actions/sandbox | ||
|
||
- name: Check sandbox health | ||
shell: bash | ||
run: ./healthcheck.sh | ||
working-directory: .github/actions/sandbox |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
version: '3' | ||
services: | ||
devnet: | ||
image: kadena/devnet@sha256:b63feb2de2a46c77199569845f9dc5e44609260dcf1e874b5fb04907d1426e64 | ||
ports: | ||
- 8080:8080 # HTTP | ||
- 5432:5432 # Postgres | ||
- 9999:9999 # Info | ||
- 1789:1789 | ||
environment: | ||
- MINING_BATCH_PERIOD=0.05 | ||
- MINING_CONFIRMATION_PERIOD=1 | ||
volumes: | ||
- sandbox:/data | ||
volumes: | ||
sandbox: |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/bash | ||
counter=0 | ||
max_attempts=30 | ||
retry_interval=10 | ||
|
||
while [[ $counter -lt $max_attempts ]]; do | ||
echo "Checking sandbox health..." | ||
response=$(curl -s 'http://localhost:9999/process/chainweb-data') | ||
is_ready=$(echo "$response" | jq -r '.is_ready') | ||
|
||
if [[ "$is_ready" == "Ready" ]]; then | ||
echo "Sandbox healthy" | ||
exit 0 # Success exit code | ||
else | ||
echo "Sandbox not healthy, retrying in $retry_interval seconds..." | ||
sleep $retry_interval | ||
counter=$((counter+1)) | ||
fi | ||
done | ||
|
||
echo "Sandbox not healthy after $max_attempts attempts, exiting." | ||
exit 1 # Error exit code |
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