Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added jumphost as a runner for benchmark-runtime workflow #1641

Merged
merged 10 commits into from
May 3, 2023
18 changes: 9 additions & 9 deletions .github/workflows/benchmark-runtime-weights.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:

## run the benchmarking remotely
benchmark:
runs-on: dev-builder
runs-on: jumphost
needs: build-docker
# see https://github.com/actions/runner/issues/491
if: |
Expand Down Expand Up @@ -99,10 +99,10 @@ jobs:
timeout-minutes: 10
id: start_instance
run: |
aws ec2 start-instances --instance-ids ${{ env.INSTANCE_ID }}
aws ec2 start-instances --region ap-southeast-1 --instance-ids ${{ env.INSTANCE_ID }}
sleep 5
instance_status="aws ec2 describe-instance-status --instance-ids ${{ env.INSTANCE_ID }} --query 'InstanceStatuses[0].InstanceStatus.Status' --output text"
system_status="aws ec2 describe-instance-status --instance-ids ${{ env.INSTANCE_ID }} --query 'InstanceStatuses[0].SystemStatus.Status' --output text"
instance_status="aws ec2 describe-instance-status --region ap-southeast-1 --instance-ids ${{ env.INSTANCE_ID }} --query 'InstanceStatuses[0].InstanceStatus.Status' --output text"
system_status="aws ec2 describe-instance-status --region ap-southeast-1 --instance-ids ${{ env.INSTANCE_ID }} --query 'InstanceStatuses[0].SystemStatus.Status' --output text"
SECONDS=0
while : ; do
if [ "$(eval $instance_status)" = "ok" ] && [ "$(eval $system_status)" = "ok" ]; then
Expand All @@ -112,7 +112,7 @@ jobs:
fi
done
echo "Remote instance reachable now after $SECONDS seconds"
remote_ip=`aws ec2 describe-instances --filters 'Name=instance-state-name,Values=running' 'Name=instance-id,Values=${{ env.INSTANCE_ID }}' --query 'Reservations[*].Instances[*].[PublicIpAddress]' --output text`
remote_ip=`aws ec2 describe-instances --region ap-southeast-1 --filters 'Name=instance-state-name,Values=running' 'Name=instance-id,Values=${{ env.INSTANCE_ID }}' --query 'Reservations[*].Instances[*].[PublicIpAddress]' --output text`
echo "Running instances ip address: $remote_ip"
echo "remote_ip=$remote_ip" >> $GITHUB_OUTPUT

Expand All @@ -128,19 +128,19 @@ jobs:
arg="\\$arg";
fi
for c in $chain; do
ssh -x -o StrictHostKeychecking=no "${{ steps.start_instance.outputs.remote_ip }}" -l ${{ env.BENCHMARK_SSH_USER }} -i ${{ env.BENCHMARK_SSH_KEYPATH }} 'bash -s' < scripts/benchmark-weight-remote.sh "$c" "${GITHUB_REF#refs/heads/}" "$arg"
ssh -x -o StrictHostKeychecking=no ${{ secrets.BENCHMARK_INSTANCE_IP }} -l ${{ env.BENCHMARK_SSH_USER }} 'bash -s' < scripts/benchmark-weight-remote.sh "$c" "${GITHUB_REF#refs/heads/}" "$arg"
echo "copy generated weights files back ..."
scp -o StrictHostKeychecking=no -i ${{ env.BENCHMARK_SSH_KEYPATH }} "${{ env.BENCHMARK_SSH_USER }}@${{ steps.start_instance.outputs.remote_ip }}":/tmp/litentry-parachain/runtime/$c/src/weights/*.rs runtime/$c/src/weights/
scp -o StrictHostKeychecking=no "${{ env.BENCHMARK_SSH_USER }}"@"${{ secrets.BENCHMARK_INSTANCE_IP }}":/tmp/litentry-parachain/runtime/$c/src/weights/*.rs runtime/$c/src/weights/
done
echo "======================"
git status

- name: Stop remote instance
if: always()
run: |
aws ec2 stop-instances --instance-ids ${{ env.INSTANCE_ID }}
aws ec2 stop-instances --region ap-southeast-1 --instance-ids ${{ env.INSTANCE_ID }}
sleep 5
ret=`aws ec2 describe-instance-status --instance-ids ${{ env.INSTANCE_ID }} | jq '.InstanceStatuses[0].InstanceState.Name'`
ret=`aws ec2 describe-instance-status --region ap-southeast-1 --instance-ids ${{ env.INSTANCE_ID }} | jq '.InstanceStatuses[0].InstanceState.Name'`
echo "Remote instance running state: $ret"

- name: Create auto PR
Expand Down
25 changes: 18 additions & 7 deletions runtime/litentry/src/weights/cumulus_pallet_xcmp_queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
//! Autogenerated weights for `cumulus_pallet_xcmp_queue`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-03-15, STEPS: `20`, REPEAT: 50, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! DATE: 2023-05-02, STEPS: `20`, REPEAT: `50`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `parachain-benchmark`, CPU: `Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("litentry-dev"), DB CACHE: 20

Expand Down Expand Up @@ -47,17 +48,27 @@ use sp_std::marker::PhantomData;
/// Weight functions for `cumulus_pallet_xcmp_queue`.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> cumulus_pallet_xcmp_queue::WeightInfo for WeightInfo<T> {
// Storage: XcmpQueue QueueConfig (r:1 w:1)
/// Storage: XcmpQueue QueueConfig (r:1 w:1)
/// Proof Skipped: XcmpQueue QueueConfig (max_values: Some(1), max_size: None, mode: Measured)
fn set_config_with_u32() -> Weight {
// Minimum execution time: 9_104 nanoseconds.
Weight::from_ref_time(9_357_000)
// Proof Size summary in bytes:
// Measured: `109`
// Estimated: `604`
// Minimum execution time: 7_880 nanoseconds.
Weight::from_ref_time(8_246_000)
.saturating_add(Weight::from_proof_size(604))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
// Storage: XcmpQueue QueueConfig (r:1 w:1)
/// Storage: XcmpQueue QueueConfig (r:1 w:1)
/// Proof Skipped: XcmpQueue QueueConfig (max_values: Some(1), max_size: None, mode: Measured)
fn set_config_with_weight() -> Weight {
// Minimum execution time: 9_248 nanoseconds.
Weight::from_ref_time(9_459_000)
// Proof Size summary in bytes:
// Measured: `109`
// Estimated: `604`
// Minimum execution time: 8_119 nanoseconds.
Weight::from_ref_time(8_444_000)
.saturating_add(Weight::from_proof_size(604))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
Expand Down
88 changes: 60 additions & 28 deletions runtime/litentry/src/weights/frame_system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
//! Autogenerated weights for `frame_system`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-03-15, STEPS: `20`, REPEAT: 50, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! DATE: 2023-05-02, STEPS: `20`, REPEAT: `50`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `parachain-benchmark`, CPU: `Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("litentry-dev"), DB CACHE: 20

Expand Down Expand Up @@ -49,51 +50,82 @@ pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> frame_system::WeightInfo for WeightInfo<T> {
/// The range of component `b` is `[0, 3932160]`.
fn remark(b: u32, ) -> Weight {
// Minimum execution time: 4_693 nanoseconds.
Weight::from_ref_time(4_868_000)
// Standard Error: 6
.saturating_add(Weight::from_ref_time(825).saturating_mul(b.into()))
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_476 nanoseconds.
Weight::from_ref_time(2_561_000)
.saturating_add(Weight::from_proof_size(0))
// Standard Error: 0
.saturating_add(Weight::from_ref_time(521).saturating_mul(b.into()))
}
/// The range of component `b` is `[0, 3932160]`.
fn remark_with_event(b: u32, ) -> Weight {
// Minimum execution time: 17_330 nanoseconds.
Weight::from_ref_time(17_691_000)
// Standard Error: 13
.saturating_add(Weight::from_ref_time(2_960).saturating_mul(b.into()))
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 9_495 nanoseconds.
Weight::from_ref_time(9_983_000)
.saturating_add(Weight::from_proof_size(0))
// Standard Error: 7
.saturating_add(Weight::from_ref_time(2_531).saturating_mul(b.into()))
}
// Storage: System Digest (r:1 w:1)
// Storage: unknown [0x3a686561707061676573] (r:0 w:1)
/// Storage: System Digest (r:1 w:1)
/// Proof Skipped: System Digest (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: unknown `0x3a686561707061676573` (r:0 w:1)
/// Proof Skipped: unknown `0x3a686561707061676573` (r:0 w:1)
fn set_heap_pages() -> Weight {
// Minimum execution time: 10_645 nanoseconds.
Weight::from_ref_time(10_980_000)
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `495`
// Minimum execution time: 4_855 nanoseconds.
Weight::from_ref_time(5_161_000)
.saturating_add(Weight::from_proof_size(495))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(2))
}
// Storage: Skipped Metadata (r:0 w:0)
/// Storage: Skipped Metadata (r:0 w:0)
/// Proof Skipped: Skipped Metadata (max_values: None, max_size: None, mode: Measured)
/// The range of component `i` is `[0, 1000]`.
fn set_storage(i: u32, ) -> Weight {
// Minimum execution time: 4_911 nanoseconds.
Weight::from_ref_time(5_075_000)
// Standard Error: 3_317
.saturating_add(Weight::from_ref_time(970_578).saturating_mul(i.into()))
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_421 nanoseconds.
Weight::from_ref_time(2_509_000)
.saturating_add(Weight::from_proof_size(0))
// Standard Error: 3_307
.saturating_add(Weight::from_ref_time(1_063_604).saturating_mul(i.into()))
.saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(i.into())))
}
// Storage: Skipped Metadata (r:0 w:0)
/// Storage: Skipped Metadata (r:0 w:0)
/// Proof Skipped: Skipped Metadata (max_values: None, max_size: None, mode: Measured)
/// The range of component `i` is `[0, 1000]`.
fn kill_storage(i: u32, ) -> Weight {
// Minimum execution time: 4_944 nanoseconds.
Weight::from_ref_time(5_133_000)
// Standard Error: 3_047
.saturating_add(Weight::from_ref_time(712_929).saturating_mul(i.into()))
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_577 nanoseconds.
Weight::from_ref_time(2_654_000)
.saturating_add(Weight::from_proof_size(0))
// Standard Error: 1_489
.saturating_add(Weight::from_ref_time(734_754).saturating_mul(i.into()))
.saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(i.into())))
}
// Storage: Skipped Metadata (r:0 w:0)
/// Storage: Skipped Metadata (r:0 w:0)
/// Proof Skipped: Skipped Metadata (max_values: None, max_size: None, mode: Measured)
/// The range of component `p` is `[0, 1000]`.
fn kill_prefix(p: u32, ) -> Weight {
// Minimum execution time: 7_114 nanoseconds.
Weight::from_ref_time(7_265_000)
// Standard Error: 9_520
.saturating_add(Weight::from_ref_time(1_631_056).saturating_mul(p.into()))
// Proof Size summary in bytes:
// Measured: `85 + p * (69 ±0)`
// Estimated: `87 + p * (70 ±0)`
// Minimum execution time: 4_852 nanoseconds.
Weight::from_ref_time(5_043_000)
.saturating_add(Weight::from_proof_size(87))
// Standard Error: 1_506
.saturating_add(Weight::from_ref_time(1_557_506).saturating_mul(p.into()))
.saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(p.into())))
.saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(p.into())))
.saturating_add(Weight::from_proof_size(70).saturating_mul(p.into()))
}
}
79 changes: 56 additions & 23 deletions runtime/litentry/src/weights/pallet_asset_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
//! Autogenerated weights for `pallet_asset_manager`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-03-15, STEPS: `20`, REPEAT: 50, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! DATE: 2023-05-02, STEPS: `20`, REPEAT: `50`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `parachain-benchmark`, CPU: `Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("litentry-dev"), DB CACHE: 20

Expand Down Expand Up @@ -47,45 +48,77 @@ use sp_std::marker::PhantomData;
/// Weight functions for `pallet_asset_manager`.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_asset_manager::WeightInfo for WeightInfo<T> {
// Storage: AssetManager AssetTypeId (r:1 w:1)
// Storage: AssetManager ForeignAssetTracker (r:1 w:1)
// Storage: AssetManager AssetIdType (r:0 w:1)
// Storage: AssetManager AssetIdMetadata (r:0 w:1)
/// Storage: AssetManager AssetTypeId (r:1 w:1)
/// Proof Skipped: AssetManager AssetTypeId (max_values: None, max_size: None, mode: Measured)
/// Storage: AssetManager ForeignAssetTracker (r:1 w:1)
/// Proof Skipped: AssetManager ForeignAssetTracker (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: AssetManager AssetIdType (r:0 w:1)
/// Proof Skipped: AssetManager AssetIdType (max_values: None, max_size: None, mode: Measured)
/// Storage: AssetManager AssetIdMetadata (r:0 w:1)
/// Proof Skipped: AssetManager AssetIdMetadata (max_values: None, max_size: None, mode: Measured)
fn register_foreign_asset_type() -> Weight {
// Minimum execution time: 37_542 nanoseconds.
Weight::from_ref_time(38_328_000)
// Proof Size summary in bytes:
// Measured: `109`
// Estimated: `3406`
// Minimum execution time: 32_993 nanoseconds.
Weight::from_ref_time(33_594_000)
.saturating_add(Weight::from_proof_size(3406))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(4))
}
// Storage: AssetManager AssetIdType (r:1 w:0)
// Storage: AssetManager AssetIdMetadata (r:0 w:1)
/// Storage: AssetManager AssetIdType (r:1 w:0)
/// Proof Skipped: AssetManager AssetIdType (max_values: None, max_size: None, mode: Measured)
/// Storage: AssetManager AssetIdMetadata (r:0 w:1)
/// Proof Skipped: AssetManager AssetIdMetadata (max_values: None, max_size: None, mode: Measured)
fn update_foreign_asset_metadata() -> Weight {
// Minimum execution time: 25_504 nanoseconds.
Weight::from_ref_time(27_153_000)
// Proof Size summary in bytes:
// Measured: `269`
// Estimated: `3013`
// Minimum execution time: 20_116 nanoseconds.
Weight::from_ref_time(20_936_000)
.saturating_add(Weight::from_proof_size(3013))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
// Storage: AssetManager AssetIdType (r:1 w:0)
// Storage: AssetManager AssetIdUnitsPerSecond (r:0 w:1)
/// Storage: AssetManager AssetIdType (r:1 w:0)
/// Proof Skipped: AssetManager AssetIdType (max_values: None, max_size: None, mode: Measured)
/// Storage: AssetManager AssetIdUnitsPerSecond (r:0 w:1)
/// Proof Skipped: AssetManager AssetIdUnitsPerSecond (max_values: None, max_size: None, mode: Measured)
fn set_asset_units_per_second() -> Weight {
// Minimum execution time: 25_509 nanoseconds.
Weight::from_ref_time(25_974_000)
// Proof Size summary in bytes:
// Measured: `269`
// Estimated: `3013`
// Minimum execution time: 18_677 nanoseconds.
Weight::from_ref_time(19_671_000)
.saturating_add(Weight::from_proof_size(3013))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
// Storage: AssetManager AssetIdType (r:1 w:1)
// Storage: AssetManager AssetTypeId (r:1 w:1)
/// Storage: AssetManager AssetIdType (r:1 w:1)
/// Proof Skipped: AssetManager AssetIdType (max_values: None, max_size: None, mode: Measured)
/// Storage: AssetManager AssetTypeId (r:1 w:1)
/// Proof Skipped: AssetManager AssetTypeId (max_values: None, max_size: None, mode: Measured)
fn add_asset_type() -> Weight {
// Minimum execution time: 30_752 nanoseconds.
Weight::from_ref_time(31_291_000)
// Proof Size summary in bytes:
// Measured: `292`
// Estimated: `5534`
// Minimum execution time: 24_783 nanoseconds.
Weight::from_ref_time(25_802_000)
.saturating_add(Weight::from_proof_size(5534))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(2))
}
// Storage: AssetManager AssetTypeId (r:2 w:1)
// Storage: AssetManager AssetIdType (r:0 w:1)
/// Storage: AssetManager AssetTypeId (r:2 w:1)
/// Proof Skipped: AssetManager AssetTypeId (max_values: None, max_size: None, mode: Measured)
/// Storage: AssetManager AssetIdType (r:0 w:1)
/// Proof Skipped: AssetManager AssetIdType (max_values: None, max_size: None, mode: Measured)
fn remove_asset_type() -> Weight {
// Minimum execution time: 36_679 nanoseconds.
Weight::from_ref_time(37_751_000)
// Proof Size summary in bytes:
// Measured: `449`
// Estimated: `5848`
// Minimum execution time: 31_591 nanoseconds.
Weight::from_ref_time(33_017_000)
.saturating_add(Weight::from_proof_size(5848))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(2))
}
Expand Down
Loading