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

Unify gh-pages scripts #46

Closed
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
51 changes: 4 additions & 47 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
name: Docs

on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened, ready_for_review, labeled]
merge_group:
workflow_call:
outputs:
run:
value: ${{ github.run_id }}

concurrency:
group: ${{ github.ref }}
Expand Down Expand Up @@ -95,47 +96,3 @@ jobs:
path: ./artifacts/
retention-days: 1
if-no-files-found: error

publish-rustdoc:
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
environment: subsystem-benchmarks
needs: [build-rustdoc, build-implementers-guide]
steps:
- uses: actions/checkout@v4
with:
ref: gh-pages
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ secrets.POLKADOTSDK_GHPAGES_APP_ID }}
private-key: ${{ secrets.POLKADOTSDK_GHPAGES_APP_KEY }}
- name: Ensure destination dir does not exist
run: |
rm -rf book/
rm -rf ${REF_NAME}
env:
REF_NAME: ${{ github.head_ref || github.ref_name }}
- name: Download rustdocs
uses: actions/download-artifact@v4
with:
name: ${{ github.sha }}-doc
path: ${{ github.head_ref || github.ref_name }}
- name: Download guide
uses: actions/download-artifact@v4
with:
name: ${{ github.sha }}-guide
path: /tmp
- run: mkdir -p book
- name: Move book files
run: mv /tmp/book/html/* book/
- name: Push to GH-Pages branch
uses: github-actions-x/commit@v2.9
with:
github-token: ${{ steps.app-token.outputs.token }}
push-branch: "gh-pages"
commit-message: "___Updated docs for ${{ github.head_ref || github.ref_name }}___"
force-add: "true"
files: ${{ github.head_ref || github.ref_name }}/ book/
name: devops-parity
email: devops-team@parity.io
58 changes: 58 additions & 0 deletions .github/workflows/publish-gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Publish GH-Pages

on:
push:
branches:
- master

jobs:
build-docs:
# TODO: remove once GHA-migration migration is complete or this workflow is fully stable
if: false
uses: ./.github/workflows/docs.yml
secrets: inherit

publish-rustdoc:
runs-on: ubuntu-latest
environment: subsystem-benchmarks
needs: [build-docs]
steps:
- uses: actions/checkout@v4
with:
ref: gh-pages
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ secrets.POLKADOTSDK_GHPAGES_APP_ID }}
private-key: ${{ secrets.POLKADOTSDK_GHPAGES_APP_KEY }}
- name: Ensure destination dir does not exist
run: |
rm -rf book/
rm -rf ${REF_NAME}
env:
REF_NAME: ${{ github.head_ref || github.ref_name }}
- name: Download rustdocs
uses: actions/download-artifact@v4
with:
name: ${{ github.sha }}-doc
path: ${{ github.head_ref || github.ref_name }}
run-id: ${{ needs.build-docs.outputs.run }}
- name: Download guide
uses: actions/download-artifact@v4
with:
name: ${{ github.sha }}-guide
path: /tmp
run-id: ${{ needs.build-docs.outputs.run }}
- run: mkdir -p book
- name: Move book files
run: mv /tmp/book/html/* book/
- name: Push to GH-Pages branch
uses: github-actions-x/commit@v2.9
with:
github-token: ${{ steps.app-token.outputs.token }}
push-branch: "gh-pages"
commit-message: "___Updated docs for ${{ github.head_ref || github.ref_name }}___"
force-add: "true"
files: ${{ github.head_ref || github.ref_name }}/ book/
name: devops-parity
email: devops-team@parity.io
9 changes: 5 additions & 4 deletions Cargo.lock

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

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,7 @@ chrono = { version = "0.4.31" }
cid = { version = "0.9.0" }
clap = { version = "4.5.10" }
clap-num = { version = "1.0.2" }
clap_complete = { version = "4.0.2" }
clap_complete = { version = "4.5.13" }
coarsetime = { version = "0.1.22" }
codec = { version = "3.6.12", default-features = false, package = "parity-scale-codec" }
collectives-westend-emulated-chain = { path = "cumulus/parachains/integration-tests/emulated/chains/parachains/collectives/collectives-westend" }
Expand Down Expand Up @@ -1178,7 +1178,7 @@ sc-transaction-pool-api = { path = "substrate/client/transaction-pool/api", defa
sc-utils = { path = "substrate/client/utils", default-features = false }
scale-info = { version = "2.11.1", default-features = false }
schemars = { version = "0.8.13", default-features = false }
schnellru = { version = "0.2.1" }
schnellru = { version = "0.2.3" }
schnorrkel = { version = "0.11.4", default-features = false }
seccompiler = { version = "0.4.0" }
secp256k1 = { version = "0.28.0", default-features = false }
Expand Down
2 changes: 1 addition & 1 deletion cumulus/client/relay-chain-minimal-node/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ async fn new_minimal_relay_chain<Block: BlockT, Network: NetworkBackend<RelayBlo
collator_pair: CollatorPair,
relay_chain_rpc_client: Arc<BlockChainRpcClient>,
) -> Result<NewMinimalNode, RelayChainError> {
let role = config.role.clone();
let role = config.role;
let mut net_config = sc_network::config::FullNetworkConfiguration::<_, _, Network>::new(
&config.network,
config.prometheus_config.as_ref().map(|cfg| cfg.registry.clone()),
Expand Down
2 changes: 1 addition & 1 deletion cumulus/client/relay-chain-minimal-node/src/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ pub(crate) fn build_collator_network<Network: NetworkBackend<Block, Hash>>(
spawn_handle.spawn("peer-store", Some("networking"), peer_store.run());

let network_params = sc_network::config::Params::<Block, Hash, Network> {
role: config.role.clone(),
role: config.role,
executor: {
let spawn_handle = Clone::clone(&spawn_handle);
Box::new(move |fut| {
Expand Down
3 changes: 1 addition & 2 deletions cumulus/polkadot-parachain/polkadot-parachain-lib/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -322,10 +322,9 @@ impl<Config: CliConfig> CliConfiguration<Self> for RelayChainCli<Config> {
_support_url: &String,
_impl_version: &String,
_logger_hook: F,
_config: &sc_service::Configuration,
) -> sc_cli::Result<()>
where
F: FnOnce(&mut sc_cli::LoggerBuilder, &sc_service::Configuration),
F: FnOnce(&mut sc_cli::LoggerBuilder),
{
unreachable!("PolkadotCli is never initialized; qed");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,15 @@ pub(crate) trait NodeSpec {
})
.transpose()?;

let heap_pages = config.default_heap_pages.map_or(DEFAULT_HEAP_ALLOC_STRATEGY, |h| {
HeapAllocStrategy::Static { extra_pages: h as _ }
});
let heap_pages =
config.executor.default_heap_pages.map_or(DEFAULT_HEAP_ALLOC_STRATEGY, |h| {
HeapAllocStrategy::Static { extra_pages: h as _ }
});

let executor = sc_executor::WasmExecutor::<ParachainHostFunctions>::builder()
.with_execution_method(config.wasm_method)
.with_max_runtime_instances(config.max_runtime_instances)
.with_runtime_cache_size(config.runtime_cache_size)
.with_execution_method(config.executor.wasm_method)
.with_max_runtime_instances(config.executor.max_runtime_instances)
.with_runtime_cache_size(config.executor.runtime_cache_size)
.with_onchain_heap_alloc_strategy(heap_pages)
.with_offchain_heap_alloc_strategy(heap_pages)
.build();
Expand Down
3 changes: 1 addition & 2 deletions cumulus/test/service/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,9 @@ impl CliConfiguration<Self> for RelayChainCli {
_support_url: &String,
_impl_version: &String,
_logger_hook: F,
_config: &sc_service::Configuration,
) -> CliResult<()>
where
F: FnOnce(&mut sc_cli::LoggerBuilder, &sc_service::Configuration),
F: FnOnce(&mut sc_cli::LoggerBuilder),
{
unreachable!("PolkadotCli is never initialized; qed");
}
Expand Down
77 changes: 41 additions & 36 deletions cumulus/test/service/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,9 @@ use sc_network::{
};
use sc_service::{
config::{
BlocksPruning, DatabaseSource, KeystoreConfig, MultiaddrWithPeerId, NetworkConfiguration,
OffchainWorkerConfig, PruningMode, RpcBatchRequestConfig, RpcEndpoint, WasmExecutionMethod,
BlocksPruning, DatabaseSource, ExecutorConfiguration, KeystoreConfig, MultiaddrWithPeerId,
NetworkConfiguration, OffchainWorkerConfig, PruningMode, RpcBatchRequestConfig,
RpcConfiguration, RpcEndpoint, WasmExecutionMethod,
},
BasePath, ChainSpec as ChainSpecService, Configuration, Error as ServiceError,
PartialComponents, Role, RpcHandlers, TFullBackend, TFullClient, TaskManager,
Expand Down Expand Up @@ -194,15 +195,16 @@ pub fn new_partial(
enable_import_proof_record: bool,
) -> Result<Service, sc_service::Error> {
let heap_pages = config
.executor
.default_heap_pages
.map_or(DEFAULT_HEAP_ALLOC_STRATEGY, |h| HeapAllocStrategy::Static { extra_pages: h as _ });

let executor = WasmExecutor::builder()
.with_execution_method(config.wasm_method)
.with_execution_method(config.executor.wasm_method)
.with_onchain_heap_alloc_strategy(heap_pages)
.with_offchain_heap_alloc_strategy(heap_pages)
.with_max_runtime_instances(config.max_runtime_instances)
.with_runtime_cache_size(config.runtime_cache_size)
.with_max_runtime_instances(config.executor.max_runtime_instances)
.with_runtime_cache_size(config.executor.runtime_cache_size)
.build();

let (client, backend, keystore_container, task_manager) =
Expand Down Expand Up @@ -863,38 +865,41 @@ pub fn node_config(
state_pruning: Some(PruningMode::ArchiveAll),
blocks_pruning: BlocksPruning::KeepAll,
chain_spec: spec,
wasm_method: WasmExecutionMethod::Compiled {
instantiation_strategy: sc_executor_wasmtime::InstantiationStrategy::PoolingCopyOnWrite,
executor: ExecutorConfiguration {
wasm_method: WasmExecutionMethod::Compiled {
instantiation_strategy:
sc_executor_wasmtime::InstantiationStrategy::PoolingCopyOnWrite,
},
..ExecutorConfiguration::default()
},
rpc: RpcConfiguration {
addr: None,
max_connections: Default::default(),
cors: None,
methods: Default::default(),
max_request_size: Default::default(),
max_response_size: Default::default(),
id_provider: None,
max_subs_per_conn: Default::default(),
port: 9945,
message_buffer_capacity: Default::default(),
batch_config: RpcBatchRequestConfig::Unlimited,
rate_limit: None,
rate_limit_whitelisted_ips: Default::default(),
rate_limit_trust_proxy_headers: Default::default(),
},
rpc_addr: None,
rpc_max_connections: Default::default(),
rpc_cors: None,
rpc_methods: Default::default(),
rpc_max_request_size: Default::default(),
rpc_max_response_size: Default::default(),
rpc_id_provider: None,
rpc_max_subs_per_conn: Default::default(),
rpc_port: 9945,
rpc_message_buffer_capacity: Default::default(),
rpc_batch_config: RpcBatchRequestConfig::Unlimited,
rpc_rate_limit: None,
rpc_rate_limit_whitelisted_ips: Default::default(),
rpc_rate_limit_trust_proxy_headers: Default::default(),
prometheus_config: None,
telemetry_endpoints: None,
default_heap_pages: None,
offchain_worker: OffchainWorkerConfig { enabled: true, indexing_enabled: false },
force_authoring: false,
disable_grandpa: false,
dev_key_seed: Some(key_seed),
tracing_targets: None,
tracing_receiver: Default::default(),
max_runtime_instances: 8,
announce_block: true,
data_path: root,
base_path,
wasm_runtime_overrides: None,
runtime_cache_size: 2,
})
}

Expand Down Expand Up @@ -1006,19 +1011,19 @@ pub fn run_relay_chain_validator_node(
);

if let Some(port) = port {
config.rpc_addr = Some(vec![RpcEndpoint {
batch_config: config.rpc_batch_config,
cors: config.rpc_cors.clone(),
config.rpc.addr = Some(vec![RpcEndpoint {
batch_config: config.rpc.batch_config,
cors: config.rpc.cors.clone(),
listen_addr: SocketAddr::V4(SocketAddrV4::new(Ipv4Addr::LOCALHOST, port)),
max_connections: config.rpc_max_connections,
max_payload_in_mb: config.rpc_max_request_size,
max_payload_out_mb: config.rpc_max_response_size,
max_subscriptions_per_connection: config.rpc_max_subs_per_conn,
max_buffer_capacity_per_connection: config.rpc_message_buffer_capacity,
rpc_methods: config.rpc_methods,
rate_limit: config.rpc_rate_limit,
rate_limit_trust_proxy_headers: config.rpc_rate_limit_trust_proxy_headers,
rate_limit_whitelisted_ips: config.rpc_rate_limit_whitelisted_ips.clone(),
max_connections: config.rpc.max_connections,
max_payload_in_mb: config.rpc.max_request_size,
max_payload_out_mb: config.rpc.max_response_size,
max_subscriptions_per_connection: config.rpc.max_subs_per_conn,
max_buffer_capacity_per_connection: config.rpc.message_buffer_capacity,
rpc_methods: config.rpc.methods,
rate_limit: config.rpc.rate_limit,
rate_limit_trust_proxy_headers: config.rpc.rate_limit_trust_proxy_headers,
rate_limit_whitelisted_ips: config.rpc.rate_limit_whitelisted_ips.clone(),
retry_random_port: true,
is_optional: false,
}]);
Expand Down
1 change: 1 addition & 0 deletions polkadot/node/network/collator-protocol/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ bitvec = { features = ["alloc"], workspace = true }
futures = { workspace = true }
futures-timer = { workspace = true }
gum = { workspace = true, default-features = true }
schnellru.workspace = true

sp-core = { workspace = true, default-features = true }
sp-runtime = { workspace = true, default-features = true }
Expand Down
Loading
Loading