This test will only succeed after #1284 and #1446 have been resolved.
Consider this situation:
- nodeA (authorized)
- nodeB (authorized) bootstrapped to nodeA
- nodeC bootstrapped to nodeA
- nodeD bootstrapped to nodeB
Next:
- trigger a build from nodeA and wait for blocks to be published/broadcast
- verify the the logs for the new artifact are available on all nodes
- verify you can download an artifact on all nodes
- trigger a build from nodeB and wait for blocks to be published/broadcast
- verify the the logs for the new artifact are available on all nodes
- verify you can download an artifact on all nodes
Manual scenario to test this. Open 6 terminals,
Terminal X
go to the pyrsia build pipeline prototype and run
cargo run
Terminal A
build, set up and run node A
cargo build --workspace
mkdir -p /tmp/pyrsia-manual-tests/nodeA
mkdir -p /tmp/pyrsia-manual-tests/nodeB
mkdir -p /tmp/pyrsia-manual-tests/nodeC
mkdir -p /tmp/pyrsia-manual-tests/nodeD
cp target/debug/pyrsia_node /tmp/pyrsia-manual-tests/nodeA
cp target/debug/pyrsia_node /tmp/pyrsia-manual-tests/nodeB
cp target/debug/pyrsia_node /tmp/pyrsia-manual-tests/nodeC
cp target/debug/pyrsia_node /tmp/pyrsia-manual-tests/nodeD
cd /tmp/pyrsia-manual-tests/nodeA
RUST_LOG=pyrsia=debug DEV_MODE=on ./pyrsia_node --pipeline-service-endpoint http://localhost:8080 --listen-only -H 0.0.0.0 -p 7881 --init-blockchain
Terminal B
run node B:
cd /tmp/pyrsia-manual-tests/nodeB
RUST_LOG=debug ./pyrsia_node --bootstrap-url http://localhost:7881/status --pipeline-service-endpoint http://localhost:8080 -p 7882
Terminal C
run node C
cd /tmp/pyrsia-manual-tests/nodeC
RUST_LOG=debug ./pyrsia_node --bootstrap-url http://localhost:7881/status -p 7883
Terminal D
run node D, bootstrapping to node B
cd /tmp/pyrsia-manual-tests/nodeD
RUST_LOG=debug ./pyrsia_node --bootstrap-url http://localhost:7882/status -p 7884
Terminal Y
Back in the root of the pyrsia repo, let's use the Pyrsia CLI to run through our scenario.
First set up the authorized nodes:
NODE_A_PEER_ID=`curl -s http://localhost:7881/status | jq -r .peer_id`
NODE_B_PEER_ID=`curl -s http://localhost:7882/status | jq -r .peer_id`
echo $NODE_A_PEER_ID
echo $NODE_B_PEER_ID
./target/debug/pyrsia config -e --port 7881
./target/debug/pyrsia authorize --peer $NODE_A_PEER_ID
./target/debug/pyrsia authorize --peer $NODE_B_PEER_ID
Trigger a build from node A:
./target/debug/pyrsia config -e --port 7881
./target/debug/pyrsia build docker --image alpine:3.16.0
Wait for the build to finish and check logs on all nodes:
./target/debug/pyrsia config -e --port 7881
./target/debug/pyrsia inspect-log docker --image alpine:3.16.0
./target/debug/pyrsia config -e --port 7882
./target/debug/pyrsia inspect-log docker --image alpine:3.16.0
./target/debug/pyrsia config -e --port 7883
./target/debug/pyrsia inspect-log docker --image alpine:3.16.0
./target/debug/pyrsia config -e --port 7884
./target/debug/pyrsia inspect-log docker --image alpine:3.16.0
All 4 inspect-log queries should return the transparency logs.
Next, check if the artifacts itself are accessible on all nodes:
curl http://0.0.0.0:7881/v2/library/alpine/manifests/3.16.0
curl http://0.0.0.0:7882/v2/library/alpine/manifests/3.16.0
curl http://0.0.0.0:7883/v2/library/alpine/manifests/3.16.0
curl http://0.0.0.0:7884/v2/library/alpine/manifests/3.16.0
All curl commands should output the manifest for the requested Docker image.
Then, check if a build by node B works in the same way:
./target/debug/pyrsia config -e --port 7882
./target/debug/pyrsia build docker --image alpine:3.16.1
Wait for the build to finish and check logs on all nodes:
./target/debug/pyrsia config -e --port 7881
./target/debug/pyrsia inspect-log docker --image alpine:3.16.1
./target/debug/pyrsia config -e --port 7882
./target/debug/pyrsia inspect-log docker --image alpine:3.16.1
./target/debug/pyrsia config -e --port 7883
./target/debug/pyrsia inspect-log docker --image alpine:3.16.1
./target/debug/pyrsia config -e --port 7884
./target/debug/pyrsia inspect-log docker --image alpine:3.16.1
All 4 inspect-log queries should return the transparency logs.
Next, check if the artifacts itself are accessible on all nodes:
curl http://0.0.0.0:7881/v2/library/alpine/manifests/3.16.1
curl http://0.0.0.0:7882/v2/library/alpine/manifests/3.16.1
curl http://0.0.0.0:7883/v2/library/alpine/manifests/3.16.1
curl http://0.0.0.0:7884/v2/library/alpine/manifests/3.16.1