This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
☭ Liberate workers! ☭ #7570
Open
s0me0ne-unkn0wn
wants to merge
15
commits into
master
Choose a base branch
from
s0me0ne/liberate-workers
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
☭ Liberate workers! ☭ #7570
Changes from 4 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
cc8e1fd
Move PVF worker CLI binaries to separate packages
s0me0ne-unkn0wn 3c43f00
Move worker CLIs closer to the root package
s0me0ne-unkn0wn 25f950c
Rename crates
s0me0ne-unkn0wn 53d035d
Fix malus
s0me0ne-unkn0wn 5ae83f3
Fix tests
s0me0ne-unkn0wn c9329ca
`Cargo.lock` & `cargo fmt`
s0me0ne-unkn0wn dcbd057
Merge remote-tracking branch 'origin/master' into s0me0ne/liberate-wo…
s0me0ne-unkn0wn 8d50a4c
Try to fix `cargo run` not building worker binaries
mrcnski 3ab5657
Resolve some TODOs, make output nicer
mrcnski 96d2a90
Fix filename typo
s0me0ne-unkn0wn 63ee515
Remove duplicated constants
s0me0ne-unkn0wn c172aab
`cargo fmt`
s0me0ne-unkn0wn 85f0a50
Fix build script
mrcnski c4d8844
Update build script
mrcnski a8c98c1
Update comment
mrcnski File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
[package] | ||
name = "polkadot-execute-worker" | ||
version.workspace = true | ||
authors.workspace = true | ||
edition.workspace = true | ||
|
||
[[bin]] | ||
name = "polkadot-execute-worker" | ||
path = "src/main.rs" | ||
|
||
[dependencies] | ||
polkadot-node-core-pvf-common = { path = "../../node/core/pvf/common" } | ||
polkadot-node-core-pvf-execute-worker = { path = "../../node/core/pvf/execute-worker" } | ||
|
||
[build-dependencies] | ||
substrate-build-script-utils = { git = "https://github.com/paritytech/substrate", branch = "master" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// Copyright (C) Parity Technologies (UK) Ltd. | ||
// This file is part of Polkadot. | ||
|
||
// Polkadot is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
|
||
// Polkadot is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
|
||
// You should have received a copy of the GNU General Public License | ||
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
fn main() { | ||
substrate_build_script_utils::generate_cargo_keys(); | ||
// For the node/worker version check, make sure we always rebuild the node and binary workers | ||
// when the version changes. | ||
substrate_build_script_utils::rerun_if_git_head_changed(); | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
[package] | ||
name = "polkadot-prepare-worker" | ||
version.workspace = true | ||
authors.workspace = true | ||
edition.workspace = true | ||
|
||
[[bin]] | ||
name = "polkadot-prepare-worker" | ||
path = "src/main.rs" | ||
|
||
[dependencies] | ||
polkadot-node-core-pvf-common = { path = "../../node/core/pvf/common" } | ||
polkadot-node-core-pvf-prepare-worker = { path = "../../node/core/pvf/prepare-worker" } | ||
|
||
[build-dependencies] | ||
substrate-build-script-utils = { git = "https://github.com/paritytech/substrate", branch = "master" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// Copyright (C) Parity Technologies (UK) Ltd. | ||
// This file is part of Polkadot. | ||
|
||
// Polkadot is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
|
||
// Polkadot is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
|
||
// You should have received a copy of the GNU General Public License | ||
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
fn main() { | ||
substrate_build_script_utils::generate_cargo_keys(); | ||
// For the node/worker version check, make sure we always rebuild the node and binary workers | ||
// when the version changes. | ||
substrate_build_script_utils::rerun_if_git_head_changed(); | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried different approaches and ended up explicitly building workers for
malus
.This one even works but has some flaws and looks too hacky to end up in the production code.
Any better ideas are appreciated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to have a separate workspace for
malus
, then build it the exact same way we do polkadot? i.e. if we list the workers as default-members, we don't have to specify them with-p
for each build command.I think this would work if the
polkadot
workspace didn't listmalus
, and themalus
Cargo.toml depended on polkadot and listed the workers as workspace members and default-members. Worth a try at least.Yeah that looks too hacky to me, but
-p ..
is fine if nothing else works.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, no, nested workspaces are proposed but not supported yet. I went through a lot of interesting proposals while I was researching possible solutions, like intersecting workspaces and binary dependencies, but neither of them is implemented now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I know the feeling. I think
-p ..
is fine, maybe just update the readme with build instructions like we did for node metrics.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've found out that
cargo test --workspace --profile testnet
triggers building some auxiliary binaries likeadder-collator
andundying
, which are required for tests residing intests/
. But I still need to understand what mechanism triggers those builds. Probably it can be used formalus
as well.