-
Notifications
You must be signed in to change notification settings - Fork 659
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
estimator: switch to Haswell-v4 architecture & podman work (#10645)
The previous CPU of choice does not support AVX, so the estimation does not complete with that CPU of choice. However QEMU did not support these instructions in its TCG in versions used before. I had to grab a more recent version of it and build it in our reproducible environment. Now I don't appreciate docker needing a root service so I rewrote some of the text around the setup to use podman user-space container runtime instead. Now the scripts run without any notable permission or service requiremenets (besides the requirement to have podman tool available instead of docker.) References to docker still remain here and there – I will resolve them once I'm done with the primary task at hand. The estimations are not quite what they seem to have been recorded last time continuous estimation ran successfully (protocol version was 50!?) but this difference appears to be reasonably reproducible between the two CPU choices (which makes sense -- we're counting instructions executed) for what test cases work with the previous option. Unfortunately it is difficult for me to provide specific numbers as the full estimator run takes some 12 hours-or-so to run under qemu…
- Loading branch information
Showing
15 changed files
with
144 additions
and
101 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
# our local base image | ||
FROM rust:1.76.0 | ||
FROM docker.io/rust:1.76.0 | ||
|
||
LABEL description="Container for builds" | ||
|
||
RUN rustup target add wasm32-unknown-unknown | ||
RUN rustup target add wasm32-unknown-unknown x86_64-unknown-linux-gnu && rustup component add rustfmt clippy | ||
|
||
# install build dependencies for QEMU | ||
RUN apt-get update && apt-get install -y g++ rsync zip openssh-server \ | ||
make apt-utils git sudo pkg-config libglib2.0-dev curl clang gdb llvm-dev cmake | ||
RUN apt-get update && apt-get install -y g++ rsync zip openssh-server make apt-utils git sudo \ | ||
pkg-config libglib2.0-dev curl clang gdb llvm-dev cmake python3-venv ninja-build |
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 |
---|---|---|
@@ -1,2 +1,9 @@ | ||
#!/bin/sh | ||
docker build -t rust-emu . | ||
#!/usr/bin/env bash | ||
cd "${0%/*}" | ||
# FIXME: does this need to use XDG? Well, whoever sets it to non-default value is on the hook for | ||
# making it work. | ||
if [[ ! -f "$HOME/.config/containers/policy.json" ]]; then | ||
mkdir -p "$HOME/.config/containers" | ||
cp policy.json "$HOME/.config/containers" | ||
fi | ||
exec podman --runtime=crun build -t rust-emu . |
Binary file modified
BIN
+192 Bytes
(100%)
runtime/runtime-params-estimator/emu-cost/counter_plugin/libcounter.so
Binary file not shown.
Binary file modified
BIN
+8.28 MB
(280%)
runtime/runtime-params-estimator/emu-cost/counter_plugin/qemu-x86_64
Binary file not shown.
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,7 @@ | ||
{ | ||
"default": [ | ||
{ | ||
"type": "insecureAcceptAnything" | ||
} | ||
] | ||
} |
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 |
---|---|---|
@@ -1,6 +1,12 @@ | ||
#!/bin/sh | ||
docker run \ | ||
--rm --mount type=bind,source=$HOST_DIR,target=/host \ | ||
#!/usr/bin/env bash | ||
cd "${0%/*}" | ||
|
||
NEARCORE=$PWD/../../../ | ||
|
||
exec podman --runtime=crun run --rm \ | ||
--mount type=bind,source=$HOST_DIR,target=/host \ | ||
--mount type=bind,source=$NEARCORE,target=/host/nearcore \ | ||
--cap-add=SYS_PTRACE --security-opt seccomp=unconfined \ | ||
--network host \ | ||
-i -t rust-emu \ | ||
/usr/bin/env bash |
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.