Skip to content

Commit

Permalink
Unify Nethermind executable name (#5908)
Browse files Browse the repository at this point in the history
  • Loading branch information
rubo authored Jul 23, 2023
1 parent 57e6c6b commit 19b7eb4
Show file tree
Hide file tree
Showing 15 changed files with 30 additions and 24 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build-nethermind-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ jobs:
scripts/deployment/build-runner.sh $GITHUB_SHA $build_timestamp
- name: Build Nethermind.Cli
run: nethermind/scripts/deployment/build-cli.sh $GITHUB_SHA ${{ steps.build-runner.outputs.build-timestamp }}
- name: Build Nethermind.Launcher
- name: Build Nethermind launcher
run: nethermind/scripts/deployment/build-launcher.sh
- name: Build Nethermind.Launcher for Linux arm64
- name: Build Nethermind launcher for Linux arm64
run: |
cd nethermind
docker buildx build --platform=linux/arm64 -t tmp-launcher -f Dockerfile.launcher . --load
docker run --platform=linux/arm64 -v $PWD:/opt/mount --rm tmp-launcher bash -c "cp /nethermind/Nethermind.Launcher /opt/mount/"
mv Nethermind.Launcher $GITHUB_WORKSPACE/$PUB_DIR/linux-arm64/Nethermind.Launcher
docker run --platform=linux/arm64 -v $PWD:/opt/mount --rm tmp-launcher bash -c "cp /nethermind/nethermind-launcher /opt/mount/"
mv nethermind-launcher $GITHUB_WORKSPACE/$PUB_DIR/linux-arm64/nethermind-launcher
- name: Archive packages
env:
PACKAGE_PREFIX: nethermind-preview-${{ steps.build-runner.outputs.commit-hash }}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,14 @@ jobs:
$SCRIPTS_PATH/build-runner.sh $GITHUB_SHA $build_timestamp
- name: Build Nethermind.Cli
run: $SCRIPTS_PATH/build-cli.sh $GITHUB_SHA ${{ steps.build-runner.outputs.build-timestamp }}
- name: Build Nethermind.Launcher
- name: Build Nethermind launcher
run: $SCRIPTS_PATH/build-launcher.sh
- name: Build Nethermind.Launcher for Linux arm64
- name: Build Nethermind launcher for Linux arm64
working-directory: nethermind
run: |
docker buildx build --platform=linux/arm64 -t tmp-launcher -f Dockerfile.launcher . --load
docker run --platform=linux/arm64 -v $PWD:/opt/mount --rm tmp-launcher bash -c "cp /nethermind/Nethermind.Launcher /opt/mount/"
mv Nethermind.Launcher $GITHUB_WORKSPACE/$PUB_DIR/linux-arm64/Nethermind.Launcher
docker run --platform=linux/arm64 -v $PWD:/opt/mount --rm tmp-launcher bash -c "cp /nethermind/nethermind-launcher /opt/mount/"
mv nethermind-launcher $GITHUB_WORKSPACE/$PUB_DIR/linux-arm64/nethermind-launcher
- name: Archive packages
id: archive
env:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ VOLUME /nethermind/nethermind_db
VOLUME /nethermind/logs
VOLUME /nethermind/keystore

ENTRYPOINT ["./Nethermind.Runner"]
ENTRYPOINT ["./nethermind"]
2 changes: 1 addition & 1 deletion Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@ VOLUME /nethermind/nethermind_db
VOLUME /nethermind/logs
VOLUME /nethermind/keystore

ENTRYPOINT ["./Nethermind.Runner"]
ENTRYPOINT ["./nethermind"]
4 changes: 2 additions & 2 deletions Dockerfile.launcher
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ RUN npm i pkg @vercel/ncc -g && \
git clone https://github.com/NethermindEth/nethermind.launcher.git && \
cd nethermind.launcher && \
npm install && \
pkg index.js -t latest-linux-arm64 -o Nethermind.Launcher
pkg index.js -t latest-linux-arm64 -o nethermind-launcher


FROM arm64v8/node AS launcher
WORKDIR /nethermind
COPY --from=build /source/nethermind.launcher/Nethermind.Launcher .
COPY --from=build /source/nethermind.launcher/nethermind-launcher .
4 changes: 2 additions & 2 deletions scripts/deployment/archive-packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ cd $GITHUB_WORKSPACE
mkdir $PACKAGE_DIR
cd $PUB_DIR

cd linux-x64 && zip -r $GITHUB_WORKSPACE/$PACKAGE_DIR/$PACKAGE_PREFIX-linux-x64.zip . && cd ..
cd linux-arm64 && zip -r $GITHUB_WORKSPACE/$PACKAGE_DIR/$PACKAGE_PREFIX-linux-arm64.zip . && cd ..
cd linux-x64 && zip -r -y $GITHUB_WORKSPACE/$PACKAGE_DIR/$PACKAGE_PREFIX-linux-x64.zip . && cd ..
cd linux-arm64 && zip -r -y $GITHUB_WORKSPACE/$PACKAGE_DIR/$PACKAGE_PREFIX-linux-arm64.zip . && cd ..
cd win-x64 && zip -r $GITHUB_WORKSPACE/$PACKAGE_DIR/$PACKAGE_PREFIX-windows-x64.zip . && cd ..
cd osx-x64 && zip -r $GITHUB_WORKSPACE/$PACKAGE_DIR/$PACKAGE_PREFIX-macos-x64.zip . && cd ..
cd osx-arm64 && zip -r $GITHUB_WORKSPACE/$PACKAGE_DIR/$PACKAGE_PREFIX-macos-arm64.zip . && cd ..
Expand Down
2 changes: 1 addition & 1 deletion scripts/deployment/build-launcher.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

set -e

app_name=Nethermind.Launcher
app_name=nethermind-launcher
output_path=$GITHUB_WORKSPACE/$PUB_DIR

echo "Building Nethermind Launcher"
Expand Down
4 changes: 4 additions & 0 deletions scripts/deployment/build-runner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ do

cp -r configs $output_path/$rid
mkdir $output_path/$rid/keystore

# A temporary symlink for Linux to support existing scripts if any
# To be removed after a few months
[[ $rid == linux* ]] && ln -s -r $output_path/$rid/nethermind $output_path/$rid/Nethermind.Runner
done

cd ..
Expand Down
6 changes: 3 additions & 3 deletions scripts/execution.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ sudo chown -R $(whoami) /usr/share/nethermind
opts=$@
if [ ${#opts} -gt 0 ]
then
echo 'Executing Nethermind Runner'
sudo /usr/share/nethermind/Nethermind.Runner $@
echo 'Executing Nethermind'
sudo /usr/share/nethermind/nethermind $@
else
echo 'Executing Nethermind Launcher'
cd /usr/share/nethermind
sudo /usr/share/nethermind/Nethermind.Launcher
sudo /usr/share/nethermind/nethermind-launcher
fi
2 changes: 1 addition & 1 deletion scripts/infra.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ cp ~/$CONFIG.key ~/nethermind_$CONFIG/keystore/node.key.plain
DB_PATH="/root/db/$CONFIG"
echo "DB PATH: " $DB_PATH
cat ~/$CONFIG.cfg | jq '.Init.BaseDbPath = "'$DB_PATH'"' | sponge ~/$CONFIG.cfg
dotnet Nethermind.Runner.dll --config ../$CONFIG.cfg
dotnet nethermind.dll -c ../$CONFIG.cfg
2 changes: 1 addition & 1 deletion scripts/nethermind.service
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ User=nethermind
Group=nethermind
EnvironmentFile=/home/nethermind/.env
WorkingDirectory=/home/nethermind
ExecStart=/home/nethermind/build/Nethermind.Runner --datadir /home/nethermind/data
ExecStart=/home/nethermind/build/nethermind -dd /home/nethermind/data
Restart=on-failure
LimitNOFILE=1000000

Expand Down
3 changes: 2 additions & 1 deletion src/Nethermind/Nethermind.Cli/Nethermind.Cli.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<TargetFramework>net7.0</TargetFramework>
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
<OutputType>Exe</OutputType>
<AssemblyName>nethermind-cli</AssemblyName>
<PackageId>Nethermind CLI</PackageId>
<Authors>Nethermind</Authors>
<PackageVersion>1.0.0</PackageVersion>
Expand All @@ -14,7 +15,7 @@

<ItemGroup>
<PackageReference Include="Colorful.Console" />
<PackageReference Include="Jint"/>
<PackageReference Include="Jint" />
<PackageReference Include="Microsoft.Extensions.CommandLineUtils" />
<PackageReference Include="ReadLine" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ public NethermindProcessWrapper Create(string name, string workingDirectory, str
process.Exited += ProcessOnExited;
process.StartInfo.WorkingDirectory = workingDirectory;
process.StartInfo.FileName = "dotnet";
var arguments = $"Nethermind.Runner.dll --config {config} --JsonRpc.Port {httpPort} --Network.P2PPort {p2pPort} --Network.DiscoveryPort {p2pPort} --KeyStore.TestNodeKey {nodeKey}";
var arguments = $"nethermind.dll -c {config} --JsonRpc.Port {httpPort} --Network.P2PPort {p2pPort} --Network.DiscoveryPort {p2pPort} --KeyStore.TestNodeKey {nodeKey}";
if (!string.IsNullOrEmpty(dbPath))
{
arguments = $"{arguments} --baseDbPath {dbPath}";
arguments = $"{arguments} -d {dbPath}";
}

if (!string.IsNullOrEmpty(bootnode))
Expand Down
2 changes: 1 addition & 1 deletion src/Nethermind/Nethermind.Runner/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@ RUN dotnet publish Nethermind.Runner.csproj -c release -o /app/publish -p:UseApp
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "Nethermind.Runner.dll"]
ENTRYPOINT ["dotnet", "nethermind.dll"]
1 change: 1 addition & 0 deletions src/Nethermind/Nethermind.Runner/Nethermind.Runner.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<TargetFramework>net7.0</TargetFramework>
<LangVersion>latest</LangVersion>
<Nullable>annotations</Nullable>
<AssemblyName>nethermind</AssemblyName>
<ConcurrentGarbageCollection>true</ConcurrentGarbageCollection>
<EnableUnsafeBinaryFormatterSerialization>false</EnableUnsafeBinaryFormatterSerialization>
<EnableUnsafeUTF7Encoding>false</EnableUnsafeUTF7Encoding>
Expand Down

0 comments on commit 19b7eb4

Please sign in to comment.