Skip to content

Commit

Permalink
Merge branch 'master' into arshavir/brush-up-sns-timer-tests-3
Browse files Browse the repository at this point in the history
  • Loading branch information
aterga authored Oct 25, 2024
2 parents 7a1eaaf + b56d5e1 commit c0a8f56
Show file tree
Hide file tree
Showing 124 changed files with 7,635 additions and 6,766 deletions.
3 changes: 2 additions & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/.devcontainer/ @dfinity/idx
/buf.yaml @dfinity/ic-message-routing-owners
/cpp/ @dfinity/node
/hs/ @dfinity/utopia
/hs/spec_compliance @dfinity/research
/licenses/ @dfinity/idx
/bin/ict @dfinity/idx
/bin/ @dfinity/idx
Expand Down Expand Up @@ -230,6 +230,7 @@ go_deps.bzl @dfinity/idx
/rs/test_utilities/src/cycles_account_manager.rs @dfinity/execution
/rs/test_utilities/types/src/batch/ @dfinity/consensus
/rs/tests/ @dfinity/idx
/rs/tests/research @dfinity/research @dfinity/idx
/rs/tests/dashboards/IC/execution-metrics.json @dfinity/execution @dfinity/idx
/rs/tests/dashboards/IC/bitcoin.json @dfinity/execution @dfinity/idx
/rs/tests/driver/src/driver/simulate_network.rs @dfinity/networking
Expand Down
77 changes: 74 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ members = [
"rs/ic_os/build_tools/diroid",
"rs/ic_os/config",
"rs/ic_os/fstrim_tool",
"rs/ic_os/metrics_tool",
"rs/ic_os/os_tools/guestos_tool",
"rs/ic_os/os_tools/hostos_tool",
"rs/ic_os/build_tools/inject_files",
Expand Down Expand Up @@ -370,6 +371,7 @@ members = [
"rs/tests/crypto",
"rs/tests/driver",
"rs/tests/execution",
"rs/tests/financial_integrations",
"rs/tests/message_routing",
"rs/tests/message_routing/common",
"rs/tests/message_routing/rejoin_test_lib",
Expand All @@ -379,19 +381,21 @@ members = [
"rs/tests/networking",
"rs/tests/networking/canisters",
"rs/tests/networking/canister_http",
"rs/tests/networking/subnet_update_workload",
"rs/tests/nested",
"rs/tests/nns",
"rs/tests/nns/sns",
"rs/tests/nns/ic_mainnet_nns_recovery",
"rs/tests/nns/nns_dapp",
"rs/tests/node",
"rs/tests/research",
"rs/tests/research/spec_compliance",
"rs/tests/sdk",
"rs/tests/test_canisters/http_counter",
"rs/tests/test_canisters/kv_store",
"rs/tests/test_canisters/message",
"rs/tests/testing_verification",
"rs/tests/testing_verification/wabt-tests",
"rs/tests/testing_verification/spec_compliance",
"rs/tests/testing_verification/testnets",
"rs/tla_instrumentation/local_key",
"rs/tla_instrumentation/tla_instrumentation",
Expand Down
15 changes: 2 additions & 13 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,7 @@ oci = use_extension("@rules_oci//oci:extensions.bzl", "oci")
# file server used in tests
oci.pull(
name = "static-file-server",
# $ docker pull halverneus/static-file-server
# $ docker tag halverneus/static-file-server dfinitydev/halverneus-static-file-server:latest
# $ docker push dfinitydev/halverneus-static-file-server:latest
#latest: digest: sha256:...
image = "docker.io/dfinitydev/halverneus-static-file-server@sha256:80eb204716e0928e27e378ed817056c1167b2b1a878b1ac4ce496964dd9a3ccd",
image = "docker.io/halverneus/static-file-server@sha256:9e46688910b1cf9328c3b55784f08a63c53e70a276ccaf76bfdaaf2fbd0019fa",
platforms = [
"linux/amd64",
],
Expand All @@ -150,16 +146,9 @@ oci.pull(
use_repo(oci, "bitcoind", "bitcoind_linux_amd64")

# Tracing image used in tests
# we can't use the official image: https://github.com/bazel-contrib/rules_oci/issues/695
#
# Instead we copy the official image to our repository:
# $ docker pull jaegertracing/all-in-one
# $ docker tag jaegertracing/all-in-one dfinitydev/jaegertracing-all-in-one:latest
# $ docker push jaegertracing-all-in-one:latest
# > latest: digest: sha256:...
oci.pull(
name = "jaeger",
image = "docker.io/dfinitydev/jaegertracing-all-in-one@sha256:b85a6bbb949a62377010b8418d7a860c9d0ea7058d83e7cb5ade4fba046c4a76",
image = "docker.io/jaegertracing/all-in-one@sha256:836e9b69c88afbedf7683ea7162e179de63b1f981662e83f5ebb68badadc710f",
platforms = [
"linux/amd64",
],
Expand Down
4 changes: 4 additions & 0 deletions WORKSPACE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ canisters(
"genesis-token": "genesis-token-canister.wasm.gz",
"cycles-minting": "cycles-minting-canister.wasm.gz",
"sns-wasm": "sns-wasm-canister.wasm.gz",
"ck_btc_archive": "ic-icrc1-archive.wasm.gz",
"ck_btc_ledger": "ic-icrc1-ledger.wasm.gz",
"ck_btc_index": "ic-icrc1-index-ng.wasm.gz",
"ck_eth_archive": "ic-icrc1-archive-u256.wasm.gz",
"ck_eth_ledger": "ic-icrc1-ledger-u256.wasm.gz",
"ck_eth_index": "ic-icrc1-index-ng-u256.wasm.gz",
"sns_root": "sns-root-canister.wasm.gz",
Expand All @@ -46,8 +48,10 @@ canisters(
"genesis-token": "mainnet_nns_genesis-token-canister",
"cycles-minting": "mainnet_nns_cycles-minting-canister",
"sns-wasm": "mainnet_nns_sns-wasm-canister",
"ck_btc_archive": "mainnet_ckbtc_ic-icrc1-archive",
"ck_btc_ledger": "mainnet_ckbtc_ic-icrc1-ledger",
"ck_btc_index": "mainnet_ckbtc-index-ng",
"ck_eth_archive": "mainnet_cketh_ic-icrc1-archive-u256",
"ck_eth_ledger": "mainnet_cketh_ic-icrc1-ledger-u256",
"ck_eth_index": "mainnet_cketh-index-ng",
"sns_root": "mainnet_sns-root-canister",
Expand Down
21 changes: 15 additions & 6 deletions cpp/prestorecon-cpp/prestorecon.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <sys/stat.h>
#include <unistd.h>

#include <chrono>
#include <condition_variable>
#include <cstring>
#include <filesystem>
Expand Down Expand Up @@ -473,24 +474,25 @@ parse_args(int argc, char** argv)

int main(int argc, char** argv)
{
auto start_time = std::chrono::steady_clock::now();
auto args = parse_args(argc, argv);

GlobalWorkPool global_pool;
global_pool.add_work(WorkPool(args.paths));

std::vector<std::thread> threads;
std::vector<relabel_stats> stats(args.jobs);
auto selabel_hdl = selabel_open(SELABEL_CTX_FILE, nullptr, 0);

for (std::size_t n = 0; n < args.jobs; ++n) {
threads.emplace_back(
[&global_pool, &args, &stats, n] () {
auto hdl = selabel_open(SELABEL_CTX_FILE, nullptr ,0);
[&global_pool, &args, &stats, n, selabel_hdl] () {
parallel_work(
global_pool,
list_dir,
[hdl, &args, &stats, n] (const std::vector<std::pair<std::string, mode_t>>& paths) {
apply_labels(paths, hdl, args.verbosity, args.dry_run, stats[n]);
[selabel_hdl, &args, &stats, n] (const std::vector<std::pair<std::string, mode_t>>& paths) {
apply_labels(paths, selabel_hdl, args.verbosity, args.dry_run, stats[n]);
});
selabel_close(hdl);
}
);
}
Expand All @@ -503,7 +505,14 @@ int main(int argc, char** argv)
global_stats.inodes_relabeled += stats[n].inodes_relabeled;
}

std::cout << "Processed: " << global_stats.inodes_processed << " Relabeled: " << global_stats.inodes_relabeled << "\n";
selabel_close(selabel_hdl);

auto end_time = std::chrono::steady_clock::now();
long long elapsed_ms = std::chrono::duration_cast<std::chrono::milliseconds>(end_time - start_time).count();

std::cout << "Processed: " << global_stats.inodes_processed
<< " Relabeled: " << global_stats.inodes_relabeled
<< " Elapsed: " << elapsed_ms << "ms\n";

return 0;
}
3 changes: 2 additions & 1 deletion hs/spec_compliance/bin/ic-ref-test.hs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ main = do
ac <- preFlight os
let TestSubnet my_sub = lookupOption os
let PeerSubnet other_sub = lookupOption os
defaultMainWithIngredients ingredients (icTests my_sub other_sub ac)
tests <- icTests my_sub other_sub ac
defaultMainWithIngredients ingredients tests
where
ingredients =
[ rerunningTests
Expand Down
8 changes: 8 additions & 0 deletions hs/spec_compliance/src/IC/Management.hs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,14 @@ type InstallMode = V.Var ("install" R..== () R..+ "reinstall" R..== () R..+ "upg

type InstallCodeArgs = R.Rec ("mode" R..== InstallMode R..+ "canister_id" R..== Principal R..+ "wasm_module" R..== Blob R..+ "arg" R..== Blob R..+ "sender_canister_version" R..== Maybe W.Word64)

-- Canister installation using WASM chunks

type ChunkHash = R.Rec ("hash" R..== Blob)

type InstallChunkedCodeArgs = R.Rec ("mode" R..== InstallMode R..+ "target_canister" R..== Principal R..+ "store_canister" R..== Principal R..+ "chunk_hashes_list" R..== Vec.Vector ChunkHash R..+ "wasm_module_hash" R..== Blob R..+ "arg" R..== Blob R..+ "sender_canister_version" R..== Maybe W.Word64)

type UploadChunkArgs = R.Rec ("canister_id" R..== Principal R..+ "chunk" R..== Blob)

-- Canister history

type CandidChangeFromUser = R.Rec ("user_id" R..== Principal)
Expand Down
12 changes: 8 additions & 4 deletions hs/spec_compliance/src/IC/Test/Agent.hs
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,9 @@ data AgentConfig = AgentConfig
tc_subnets :: [AgentSubnetConfig],
tc_httpbin_proto :: String,
tc_httpbin :: String,
tc_timeout :: Int
tc_timeout :: Int,
tc_ucan_chunk_hash :: Maybe Blob,
tc_store_canister_id :: Maybe Blob
}

makeAgentConfig :: Bool -> String -> [AgentSubnetConfig] -> String -> String -> Int -> IO AgentConfig
Expand Down Expand Up @@ -258,7 +260,9 @@ makeAgentConfig allow_self_signed_certs ep' subnets httpbin_proto httpbin' to =
tc_subnets = subnets,
tc_httpbin_proto = httpbin_proto,
tc_httpbin = httpbin,
tc_timeout = to
tc_timeout = to,
tc_ucan_chunk_hash = Nothing,
tc_store_canister_id = Nothing
}
where
-- strip trailing slash
Expand Down Expand Up @@ -288,8 +292,8 @@ preFlight os = do

type HasAgentConfig = (?agentConfig :: AgentConfig)

withAgentConfig :: (forall. (HasAgentConfig) => a) -> AgentConfig -> a
withAgentConfig act tc = let ?agentConfig = tc in act
withAgentConfig :: AgentConfig -> (forall. (HasAgentConfig) => a) -> a
withAgentConfig tc act = let ?agentConfig = tc in act

agentConfig :: (HasAgentConfig) => AgentConfig
agentConfig = ?agentConfig
Expand Down
Loading

0 comments on commit c0a8f56

Please sign in to comment.