Skip to content
Draft
Show file tree
Hide file tree
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
78 changes: 0 additions & 78 deletions .github/workflows/run-manager-integration-test-base.yml

This file was deleted.

43 changes: 0 additions & 43 deletions .github/workflows/run-manager-integration-test-run.yml

This file was deleted.

2 changes: 2 additions & 0 deletions .github/workflows/solana-build-anchor-programs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ jobs:
uses: actions/cache@v4
with:
path: validator-image.tar.gz
# FIXME: this key will make the cache succeed even if some other nix files which affect it change.
# we should *really* build this with nix instead of a manual hashFiles / cache here
key: validator-image-${{ runner.os }}-${{ hashFiles('shared/coordinator/src/coordinator.rs', 'architectures/decentralized/solana-coordinator/**/*.rs', 'architectures/decentralized/solana-coordinator/**/*.toml', 'architectures/decentralized/solana-coordinator/Cargo.lock', 'architectures/decentralized/solana-authorizer/**/*.rs', 'architectures/decentralized/solana-authorizer/**/*.toml', 'architectures/decentralized/solana-authorizer/Cargo.lock', 'docker/test/psyche_solana_validator_entrypoint.sh', 'nix/docker.nix', 'flake.lock') }}
lookup-only: true

Expand Down
140 changes: 67 additions & 73 deletions .github/workflows/solana-integration-test-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,79 +39,73 @@ jobs:
substituters = https://cache.nixos.org/ https://cache.garnix.io/ https://nix-community.cachix.org
trusted-public-keys = cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=

- name: Install just
run: |
nix profile install nixpkgs#just

# Step 1: Get Validator Image from cache
- name: Get Validator Image from cache
id: cache-validator
uses: actions/cache/restore@v4
- uses: qoomon/actions--parallel-steps@ecb0abb4521f949557e66afc198899327f3bbaf1
with:
path: validator-image.tar.gz
key: validator-image-${{ runner.os }}-${{ hashFiles('shared/coordinator/src/coordinator.rs', 'architectures/decentralized/solana-coordinator/**/*.rs', 'architectures/decentralized/solana-coordinator/**/*.toml', 'architectures/decentralized/solana-coordinator/Cargo.lock', 'architectures/decentralized/solana-authorizer/**/*.rs', 'architectures/decentralized/solana-authorizer/**/*.toml', 'architectures/decentralized/solana-authorizer/Cargo.lock', 'docker/test/psyche_solana_validator_entrypoint.sh', 'nix/docker.nix', 'flake.lock') }}
fail-on-cache-miss: true

- name: Load Validator Image
run: |
echo "Loading validator image from cache"
docker load < validator-image.tar.gz
docker images | grep psyche-solana-test-validator

echo "Disk usage after loading validator"
df -h

- name: Clean up validator tar file
run: |
# Remove the compressed validator image to free up disk space
rm -f validator-image.tar.gz
echo "Disk usage after removing validator tar"
df -h

# Step 2: Download Solana Test Client No Python Image

# Wait for Garnix right before downloading from Garnix cache
- name: Wait for Garnix checks
uses: ./.github/actions/wait-for-garnix

- name: Download Solana Test Client No Python Image
run: |
echo "Disk space before client build"
df -h

# Calculate the derivation hash
echo "Calculating derivation path"
DRV_PATH=$(nix eval --raw .#docker-psyche-solana-test-client-no-python.drvPath)
echo "Derivation path: $DRV_PATH"

OUT_PATH=$(nix derivation show $DRV_PATH | jq -r '.[].outputs.out.path')
echo "Output path: $OUT_PATH"

# download from Garnix cache first
echo "Attempting to fetch from Garnix cache"
nix-store --realise $OUT_PATH --option substitute true

# Load the image into Docker
$OUT_PATH | docker load

echo "Disk space after client build"
df -h

# Clean Nix store after client build
- name: Clean after client build
run: |
# Clean up the path file
rm -f client-image-path.txt

# Clean nix store garbage
nix-collect-garbage -d
nix store optimise

# Remove temp files
sudo rm -rf /tmp/* 2>/dev/null || true

echo "Disk space after cleanup"
df -h
steps: |
# Step 1: Get Validator Image from cache
- name: Get Validator Image from cache
id: validator-cache
uses: actions/cache/restore@v4
with:
path: validator-image.tar.gz
key: validator-image-${{ runner.os }}-${{ hashFiles('shared/coordinator/src/coordinator.rs', 'architectures/decentralized/solana-coordinator/**/*.rs', 'architectures/decentralized/solana-coordinator/**/*.toml', 'architectures/decentralized/solana-coordinator/Cargo.lock', 'architectures/decentralized/solana-authorizer/**/*.rs', 'architectures/decentralized/solana-authorizer/**/*.toml', 'architectures/decentralized/solana-authorizer/Cargo.lock', 'docker/test/psyche_solana_validator_entrypoint.sh', 'nix/docker.nix', 'flake.lock') }}
fail-on-cache-miss: true

- name: Load Validator Image
id: validator-load
needs: [ validator-cache ]
run: |
echo "Loading validator image from cache"
docker load < validator-image.tar.gz
docker images | grep psyche-solana-test-validator

echo "Disk usage after loading validator"
df -h

- name: Clean up validator tar file
id: validator-clean
needs: [ validator-load ]
run: |
# Remove the compressed validator image to free up disk space
rm -f validator-image.tar.gz
echo "Disk usage after removing validator tar"
df -h

# Step 2: Download Solana Test Client No Python Image

# Wait for Garnix right before downloading from Garnix cache
- name: Wait for Garnix checks
id: garnix-wait
uses: ./.github/actions/wait-for-garnix

- name: Download Solana Test Client No Python Image
id: nix-test-client
needs: [ garnix-wait ]
run: |
echo "Disk space before client build"
df -h

# download from Garnix cache
echo "Attempting to fetch from Garnix cache"
OUT_PATH=$(nix build .#docker-psyche-solana-test-client-no-python --no-link --print-out-paths)

# Load the image into Docker
$OUT_PATH | docker load

echo "Disk space after client build"
df -h

- name: Build run-manager binary
id: nix-run-manager
needs: [ garnix-wait ]
run: |
nix build --out-link run-manager .#run-manager

- name: Build integration tests binary
id: nix-integration-tests
needs: [ garnix-wait ]
run: |
nix build --out-link _keep_tests_binary .#test-psyche-decentralized-testing-integration_tests

- name: Verify Docker images exist
run: |
Expand All @@ -129,4 +123,4 @@ jobs:
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
run: |
nix develop --command cargo test --release -p psyche-decentralized-testing --test integration_tests -- --nocapture "${{ inputs.test-name }}"
cd architectures/decentralized/testing/ && nix run .#test-psyche-decentralized-testing-integration_tests -- --nocapture "${{ inputs.test-name }}"
Loading