-
Notifications
You must be signed in to change notification settings - Fork 279
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
feat: Add --release
flag to wasm_builder
#5209
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Lohachov Mykhailo <lohachov@soramitsu.co.jp>
Signed-off-by: Lohachov Mykhailo <lohachov@soramitsu.co.jp>
--release
flag to wasm_builder--release
flag to wasm_builder
Signed-off-by: Lohachov Mykhailo <lohachov@soramitsu.co.jp>
Signed-off-by: Lohachov Mykhailo <lohachov@soramitsu.co.jp>
Signed-off-by: Lohachov Mykhailo <lohachov@soramitsu.co.jp>
*) | ||
echo "error: arg must be 'libs', 'samples', or empty to build both" | ||
exit 1 |
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.
Let's reject invalid args so that we don't type e.g. --releas
lib
and get unintended results
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.
Changed to --profile={deploy, profiling}
and --target={samples, libs}
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.
Regarding whether named or position-based, either is acceptable but I personally prefer the shorter one
"--release", | ||
if self.release { "--release" } else { "" }, |
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 think some CI workflows should keep --release
build, at least iroha2-release.yml
and maybe iroha2-custom-image.yml
@BAStos525 ?
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.
- it should definitely be
release
foriroha2-release.yml
- for the custom image it should use the
PROFILE
variable
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.
In iroha2-release.yml
we use the tag taken from github.ref_name
- it's the tag name. Should any changes be introduced?
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.
Only *.wasm
quality is discussed here, which would only affect e.g. this line
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.
CI will use release
due to the need for additional resources (memory, fuel) and adjusted timeouts. Nevertheless, the debug flag can be set when building WASM.
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.
CI will use
release
due to the need for additional resources (memory, fuel) and adjusted timeouts. Nevertheless, the debug flag can be set when building WASM.
I would like CI to use test
when testing things and release
(or deploy
) when deploying. Yes, this will require you to adjust timeouts and limits in the test_network
(don't modify parameters in genesis.json
)
Signed-off-by: Lohachov Mykhailo <lohachov@soramitsu.co.jp>
Signed-off-by: Lohachov Mykhailo <lohachov@soramitsu.co.jp>
Signed-off-by: Lohachov Mykhailo <lohachov@soramitsu.co.jp>
Signed-off-by: Lohachov Mykhailo <lohachov@soramitsu.co.jp>
@@ -51,7 +51,7 @@ jobs: | |||
with: | |||
ref: ${{ github.event.inputs.CHECKOUT_REF }} | |||
- name: Build wasm libs | |||
run: ./scripts/build_wasm.sh --profile=${{ env.IROHA2_PROFILE }} --target=libs | |||
run: ./scripts/build_wasm.sh --target=libs |
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.
this was good as it was, why change?
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.
likewise for other files in CI
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.
--target=libs
is easier to validate since only named arguments are used inbuild_wasm.sh
--profile=${{ env.IROHA2_PROFILE }}
works fordeploy
, but forPROFILE=profiling
, it will require changes in memory, fuel, and timeouts. I thinkdeploy
should be used everywhere by default.
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.
- ok, but how is someone to build a custom image with profile
profiling
now?
@@ -15,7 +16,7 @@ jobs: | |||
steps: | |||
- uses: actions/checkout@v4 | |||
- name: Build wasm libs | |||
run: ./scripts/build_wasm.sh libs | |||
run: ./scripts/build_wasm.sh --target=libs |
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.
why change to named argument instead of position based
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.
It was easier to validate when all arguments were named. I can revert if these must be position-based.
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.
revert
@@ -22,6 +22,7 @@ env: | |||
WASM_TARGET_DIR: wasm/target/prebuilt | |||
TEST_NETWORK_TMP_DIR: /tmp | |||
NEXTEST_PROFILE: ci | |||
PROFILE: profiling |
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.
why is this not dev
or test
?
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.
also, it seems unused. you should use it to install iroha
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.
Will remove.
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.
IMO you should use it for cargo install iroha
. And you should set it to PROFILE: test
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.
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.
you will discover then that you need to increase limits because tests will get flaky
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 have no strong opinions on this
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'm of the opinion that whenever we're running tests we should run the test
build
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.
but on the other hand tests will run slower. We should take that into consideration
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 don't have a very strong opinion on this too.
Speaking of the profile of irohad
used by iroha_test_network
, since the goal was to have a black-boxed environment close to what final users will have, it could be a point towards using release
profile.
Context
Resolves #5202
Problem
The current version of
iroha_wasm_builder
has a--release
flag set by default for its output.The input
--optimize
flag can be set that will apply-O -Os
.Still, it cannot produce a build in
debug
mode.Solution
Changes in
iroha_wasm_builder
This PR introduces a single flag
--release
that:--release -O -Os
to the build.Changes in
build_wasm.sh
Now,
build_wasm.sh
produces adebug
build by default. Flag--release
can be added to build in optimized mode.Checklist
CONTRIBUTING.md
.