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

.docker: ajust Dockerfiles for ARM-based Mac architecture #163

Merged
merged 2 commits into from
May 2, 2024
Merged
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
12 changes: 6 additions & 6 deletions .docker/build/Dockerfile.sharp.sources.from_binaries
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ RUN set -x \
unzip \
wget

# Publish neo-cli from source as a self-contained deployment for linux-64 into /neo-cli folder (all dependant .dlls are included).
# Publish neo-cli from source as a self-contained deployment into /neo-cli folder (all dependant .dlls are included).
# See https://docs.microsoft.com/ru-ru/dotnet/core/deploying/#publish-self-contained for details.
ENV CLIBRANCH="v3.6.0"
RUN wget -O /tmp/neo-cli.zip https://github.com/neo-project/neo-node/archive/${CLIBRANCH}.zip && \
Expand All @@ -17,7 +17,7 @@ RUN wget -O /tmp/neo-cli.zip https://github.com/neo-project/neo-node/archive/${C
cp -r tmp/neo-node/*/Neo.ConsoleService /build && \
cp tmp/neo-node/*/NuGet.Config /build/neo-cli && \
dotnet restore /build/neo-cli && \
dotnet publish -c Release --framework net7.0 -r linux-x64 /build/neo-cli -o /neo-cli && \
dotnet publish -c Release --framework net7.0 /build/neo-cli -o /neo-cli && \
AnnaShaleva marked this conversation as resolved.
Show resolved Hide resolved
rm -rf /build /tmp/neo-cli.zip /tmp/neo-node

# Build neo-modules from source into /Plugins folder (only plugin .dll and plugin config are included, if you need other dependant .dlls, see the next step)
Expand All @@ -42,21 +42,21 @@ RUN dotnet publish -c Release --framework net7.0 /tmp/neo-modules/*/src/RpcServe
cp /tmp/neo-modules/*/src/RocksDBStore/bin/Release/net7.0/publish/RocksDbSharp.dll /Plugins/ && \
rm -rf /tmp/neo-modules.zip /tmp/neo-modules

# Publish neo-vm from source as a self-contained deployment for linux-64 into /neo-vm folder (although neo-vm does not have dependant .dlls)
# Publish neo-vm from source as a self-contained deployment into /neo-vm folder (although neo-vm does not have dependant .dlls)
ENV NEOVMBRANCH="v3.6.0"
RUN wget -O /tmp/neo-vm.zip https://github.com/neo-project/neo-vm/archive/${NEOVMBRANCH}.zip && \
unzip -q -d /tmp/neo-vm/ /tmp/neo-vm.zip && \
ls -l /tmp/* && \
dotnet restore /tmp/neo-vm/*/src/Neo.VM/ && \
dotnet publish -c Release --framework net7.0 -r linux-x64 /tmp/neo-vm/*/src/Neo.VM/ -o /neo-vm && \
dotnet publish -c Release --framework net7.0 /tmp/neo-vm/*/src/Neo.VM/ -o /neo-vm && \
rm -rf /tmp/neo-vm.zip tmp/neo-vm

# Publish neo from source as a self-contained deployment for linux-64 into /neo folder (all dependant .dlls are included)
# Publish neo from source as a self-contained deployment into /neo folder (all dependant .dlls are included)
ENV NEOBRANCH="v3.6.0"
RUN wget -O /tmp/neo.zip https://github.com/neo-project/neo/archive/${NEOBRANCH}.zip && \
unzip -q -d /tmp/neo/ /tmp/neo.zip && \
dotnet restore /tmp/neo/*/src/Neo/ && \
dotnet publish -c Release --framework net7.0 -r linux-x64 /tmp/neo/*/src/Neo/ -o /neo && \
dotnet publish -c Release --framework net7.0 /tmp/neo/*/src/Neo/ -o /neo && \
rm -rf /tmp/neo.zip tmp/neo

# All things are published, so build the final image by copying binaries from Build
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ RUN sed -i '/PackageReference Include="Neo" Version=/c \ <ProjectReference In
sed -i '/<PackageReference Include="Neo.VM" Version=/c \ <ProjectReference Include="..\\..\\..\\neo-vm\\src\\Neo.VM\\Neo.VM.csproj" \/>' /neo-project/neo/src/Neo/Neo.csproj && \
sed -i '/<PackageReference Include="Neo" Version=/c \ <ProjectReference Include="..\\..\\..\\neo\\src\\Neo\\Neo.csproj" \/>' /neo-project/neo-modules/src/Directory.Build.props

# Publish neo-cli from source as a self-contained deployment for linux-64 into /neo-cli folder (all dependant .dlls are included).
# Publish neo-cli from source as a self-contained deployment into /neo-cli folder (all dependant .dlls are included).
# See https://docs.microsoft.com/ru-ru/dotnet/core/deploying/#publish-self-contained for details.
RUN dotnet publish -c Release --framework net7.0 -r linux-x64 /neo-project/neo-node/neo-cli -o /neo-cli
RUN dotnet publish -c Release --framework net7.0 /neo-project/neo-node/neo-cli -o /neo-cli

# Build neo-modules from source into /Plugins folder (only plugin .dll and plugin config are included, if you need other dependant .dlls, see the next step)
RUN mkdir /Plugins && \
Expand Down
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,17 @@ The following default configurations are available:
## Runner usage (`./runner.sh`)

```
-v, --validators Consensus node count.
Possible values: 1, 4 (default), 7.
-n, --nodes Consensus node type.
Possible values: go (default), mixed, sharp.
-r, --rpc RPC node type. Default is the same as --nodes.
-h, --help Show usage message.
-b, --benchmark Benchmark type.
Possible values: NEO (default) or GAS
--from Number of tx senders (default: 1)
--to Number of fund receivers (default: 1)
--vote Whether or not candidates should be voted for before the bench.
-d Benchmark description.
-m Benchmark mode.
Example: -m wrk -m rate
Expand All @@ -282,6 +292,11 @@ The following default configurations are available:
-t Request timeout.
Used for RPC requests.
Example: -t 30s
-l, --log Container logging facility. Default value is none.
Example: -l journald -l syslog -l json-file
--tc Arguments to pass to 'tc qdisc netem' inside the container.
Example: 'delay 100ms'

```

## Build options
Expand Down Expand Up @@ -410,14 +425,16 @@ To add one more node configuration, provide all necessary information to the `no

Name|Description| Default |Example
---|---|---------|---
NEOBENCH_LOGGER|Container logging facility| `none` |`none`, `journald`, `syslog`
NEOBENCH_LOGGER|Container logging facility| `none` |`none`, `journald`, `syslog`,`json-file`
AnnaShaleva marked this conversation as resolved.
Show resolved Hide resolved
NEOBENCH_TC|Parameters passed to the `tc qdisc` (netem discipline) on container startup| |`delay 100ms`
NEOBENCH_TYPE|Type of the load| `NEO` |`NEO`, `GAS`
NEOBENCH_FROM_COUNT|Number of tx senders| `1` | `1`
NEOBENCH_TO_COUNT|Number of fund receivers| `1` | `1`
NEOBENCH_VALIDATOR_COUNT|Number of validators| `4` | `1`, `4`, `7`
NEOBENCH_VOTE|Vote for validators before the bench| empty |`1` or empty

For MacOS NEOBENCH_LOGGER should be set to `json-file` as `journald` and
`syslog` are not supported by this architecture.
## Benchmark results visualisation

There's a Python plotting script available for benchmark data visualisation.
Expand Down
20 changes: 18 additions & 2 deletions runner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ show_help() {
echo " -t Request timeout."
echo " Used for RPC requests."
echo " Example: -t 30s"
echo " -l, --log Enable logging on consensus nodes."
echo " -l, --log Container logging facility. Default value is none."
echo " Example: -l journald -l syslog -l json-file"
echo " --tc Arguments to pass to 'tc qdisc netem' inside the container."
echo " Example: 'delay 100ms'"
exit 0
Expand All @@ -68,7 +69,22 @@ while test $# -gt 0; do

case $_opt in
-h | --help) show_help ;;
-l | --log) export NEOBENCH_LOGGER=journald ;;
-l | --log)
AnnaShaleva marked this conversation as resolved.
Show resolved Hide resolved
if [[ $# -gt 0 && ${1:0:1} != "-" ]]; then
case "$1" in
"syslog" | "journald" | "json-file" | "none")
export NEOBENCH_LOGGER="$1"
shift
;;
*)
fatal "unknown logger specified: $1"
;;
esac
else
export NEOBENCH_LOGGER="none"
fi
;;

--vote) export NEOBENCH_VOTE=1 ;;

-v | --validators)
Expand Down
Loading