Skip to content

Commit

Permalink
ci: wip
Browse files Browse the repository at this point in the history
  • Loading branch information
jacderida committed Feb 1, 2025
1 parent e36ca5f commit e9a12c3
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 29 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/benchmark-prs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
timeout-minutes: 30

- name: Start a local network
uses: maidsafe/ant-local-testnet-action@main
uses: jacderida/ant-local-testnet-action@chore-enable_logging
env:
ANT_LOG: "all"
with:
Expand All @@ -71,7 +71,9 @@ jobs:

- name: Start a client instance to compare memory usage
shell: bash
run: ./target/release/ant --local file upload "./the-test-data.zip"
run: |
mkdir -p $CLIENT_DATA_PATH/logs
./target/release/ant --local file upload "./the-test-data.zip" 2> $CLIENT_DATA_PATH/logs/ant.log
env:
ANT_LOG: "all"
timeout-minutes: 5
Expand Down
34 changes: 19 additions & 15 deletions .github/workflows/memcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
timeout-minutes: 30

- name: Start a local network
uses: maidsafe/ant-local-testnet-action@main
uses: jacderida/ant-local-testnet-action@chore-enable_logging
with:
action: start
enable-evm-testnet: true
Expand All @@ -56,7 +56,10 @@ jobs:
run: |
mkdir -p $RESTART_TEST_NODE_DATA_PATH
./target/release/antnode \
--root-dir $RESTART_TEST_NODE_DATA_PATH --log-output-dest $RESTART_TEST_NODE_DATA_PATH --local --rewards-address "0x03B770D9cD32077cC0bF330c13C114a87643B124" &
--root-dir $RESTART_TEST_NODE_DATA_PATH \
--log-output-dest $RESTART_TEST_NODE_DATA_PATH \
--local \
--rewards-address "0x03B770D9cD32077cC0bF330c13C114a87643B124" &
sleep 10
env:
ANT_LOG: "all"
Expand All @@ -70,34 +73,33 @@ jobs:
shell: bash

- name: File upload
run: ./target/release/ant --local file upload --public "./the-test-data.zip" > ./upload_output 2>&1
run: |
mkdir -p "${CLIENT_DATA_PATH}/logs"
./target/release/ant \
--local \
file upload \
--public "./the-test-data.zip" \
> ./upload_output_second \
2> "${CLIENT_DATA_PATH}/logs/ant.log"
env:
ANT_LOG: "v"
timeout-minutes: 15

- name: showing the upload terminal output
run: cat upload_output
run: cat upload_output_second
shell: bash
if: always()

- name: parse address
run: |
UPLOAD_ADDRESS=$(rg "At address: ([0-9a-f]*)" -o -r '$1' ./upload_output)
UPLOAD_ADDRESS=$(rg "At address: ([0-9a-f]*)" -o -r '$1' ./upload_output_second)
echo "UPLOAD_ADDRESS=$UPLOAD_ADDRESS" >> $GITHUB_ENV
shell: bash

# Uploading same file using different client shall not incur any payment neither uploads
# Note rg will throw an error directly in case of failed to find a matching pattern.
- name: Start a different client to upload the same file
run: |
pwd
ls -l $ANT_DATA_PATH
mv $CLIENT_DATA_PATH $ANT_DATA_PATH/client_first
ls -l $ANT_DATA_PATH
ls -l $ANT_DATA_PATH/client_first
ls -l $ANT_DATA_PATH/client_first/logs
mkdir $ANT_DATA_PATH/client
ls -l $ANT_DATA_PATH
./target/release/ant --local file upload --public "./the-test-data.zip" > ./upload_output_second 2>&1
rg 'All chunks already exist on the network.' ./upload_output_second -c --stats
env:
Expand Down Expand Up @@ -127,7 +129,9 @@ jobs:
# Currently, there will be `Existing record found`, but NO `Existing record loaded`
# Due to the failure on decryption (as different seed used)
- name: Assert we've reloaded some chunks
run: rg "Existing record found" $RESTART_TEST_NODE_DATA_PATH
run: |
ls -al $RESTART_TEST_NODE_DATA_PATH
rg "Existing record found" $RESTART_TEST_NODE_DATA_PATH/antnode.log
- name: Wait at least 1min for replication to happen # it is throttled to once/30s.
run: sleep 60
Expand Down Expand Up @@ -180,7 +184,7 @@ jobs:

- name: Stop the local network and upload logs
if: always()
uses: maidsafe/ant-local-testnet-action@main
uses: jacderida/ant-local-testnet-action@chore-enable_logging
with:
action: stop
log_file_prefix: safe_test_logs_memcheck
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ jobs:
timeout-minutes: 30

- name: Start a local network
uses: maidsafe/ant-local-testnet-action@main
uses: jacderida/ant-local-testnet-action@chore-enable_logging
with:
action: start
enable-evm-testnet: true
Expand Down Expand Up @@ -315,8 +315,8 @@ jobs:
[System.IO.File]::WriteAllBytes($fileName, $byteArray)
# Run autonomi commands
./target/release/ant --log-output-dest data-dir --local file upload "random_file_$i.bin" --public
./target/release/ant --log-output-dest data-dir --local file upload "random_file_$i.bin"
./target/release/ant --local file upload "random_file_$i.bin" --public
./target/release/ant --local file upload "random_file_$i.bin"
}
env:
ANT_LOG: "v"
Expand Down Expand Up @@ -558,7 +558,7 @@ jobs:
timeout-minutes: 30

- name: Start a local network
uses: maidsafe/ant-local-testnet-action@main
uses: jacderida/ant-local-testnet-action@chore-enable_logging
with:
action: start
enable-evm-testnet: true
Expand Down Expand Up @@ -705,7 +705,7 @@ jobs:
timeout-minutes: 30

- name: Start a local network
uses: maidsafe/ant-local-testnet-action@main
uses: jacderida/ant-local-testnet-action@chore-enable_logging
with:
action: start
enable-evm-testnet: true
Expand Down Expand Up @@ -1014,7 +1014,7 @@ jobs:
timeout-minutes: 30

- name: Start a local network
uses: maidsafe/ant-local-testnet-action@main
uses: jacderida/ant-local-testnet-action@chore-enable_logging
with:
action: start
enable-evm-testnet: true
Expand Down
6 changes: 0 additions & 6 deletions ant-node/src/bin/antnode/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,6 @@ fn init_logging(
};

if targets.is_empty() {
println!("Logging is not enabled");
return Ok(("stderr".to_string(), None, None));
}

Expand Down Expand Up @@ -591,11 +590,6 @@ fn init_logging(
log_builder.initialize()?
};

println!(
"Initialised logging. Logs will be output to {:?}",
output_dest
);

Ok((
output_dest.to_string(),
Some(reload_handle),
Expand Down

0 comments on commit e9a12c3

Please sign in to comment.