Skip to content

Commit

Permalink
Nethermind no longer uses dasel (#1448)
Browse files Browse the repository at this point in the history
  • Loading branch information
yorickdowne authored Jul 14, 2023
1 parent 26ca4db commit 9238102
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 38 deletions.
6 changes: 0 additions & 6 deletions nethermind/Dockerfile.binary
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
ARG DOCKER_TAG

FROM alpine:3 as dasel
RUN arch=$(arch | sed s/aarch64/arm64/ | sed s/x86_64/amd64/) && \
wget -q https://github.com/TomWright/dasel/releases/download/v2.2.0/dasel_linux_${arch} -O /usr/local/bin/dasel && \
chmod +x /usr/local/bin/dasel

FROM nethermind/nethermind:${DOCKER_TAG}

# Unused, this is here to avoid build time complaints
Expand Down Expand Up @@ -42,7 +37,6 @@ RUN chown -R ${USER}:${USER} /nethermind
RUN mkdir -p /var/lib/nethermind/ee-secret && chown -R ${USER}:${USER} /var/lib/nethermind && chmod -R 700 /var/lib/nethermind && chmod 777 /var/lib/nethermind/ee-secret

# Cannot assume buildkit, hence no chmod
COPY --from=dasel --chown=${USER}:${USER} /usr/local/bin/dasel /usr/local/bin/
COPY --chown=${USER}:${USER} ./docker-entrypoint.sh /usr/local/bin/
# Belt and suspenders
RUN chmod -R 755 /usr/local/bin/*
Expand Down
6 changes: 0 additions & 6 deletions nethermind/Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
ARG DOCKER_TAG

FROM alpine:3 as dasel
RUN arch=$(arch | sed s/aarch64/arm64/ | sed s/x86_64/amd64/) && \
wget -q https://github.com/TomWright/dasel/releases/download/v2.2.0/dasel_linux_${arch} -O /usr/local/bin/dasel && \
chmod +x /usr/local/bin/dasel

FROM nethermindeth/nethermind:${DOCKER_TAG}

# Unused, this is here to avoid build time complaints
Expand Down Expand Up @@ -42,7 +37,6 @@ RUN chown -R ${USER}:${USER} /nethermind
RUN mkdir -p /var/lib/nethermind/ee-secret && chown -R ${USER}:${USER} /var/lib/nethermind && chmod -R 700 /var/lib/nethermind && chmod 777 /var/lib/nethermind/ee-secret

# Cannot assume buildkit, hence no chmod
COPY --from=dasel --chown=${USER}:${USER} /usr/local/bin/dasel /usr/local/bin/
COPY --chown=${USER}:${USER} ./docker-entrypoint.sh /usr/local/bin/
# Belt and suspenders
RUN chmod -R 755 /usr/local/bin/*
Expand Down
6 changes: 0 additions & 6 deletions nethermind/Dockerfile.source
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@ RUN bash -c "\
git submodule update --init --recursive && \
dotnet publish src/Nethermind/Nethermind.Runner -c release -o out"

FROM alpine:3 as dasel
RUN arch=$(arch | sed s/aarch64/arm64/ | sed s/x86_64/amd64/) && \
wget -q https://github.com/TomWright/dasel/releases/download/v2.2.0/dasel_linux_${arch} -O /usr/local/bin/dasel && \
chmod +x /usr/local/bin/dasel

FROM mcr.microsoft.com/dotnet/aspnet:7.0

RUN apt-get update && DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get -y install libsnappy-dev libc6-dev libc6 ca-certificates gosu tzdata wget && rm -rf /var/lib/apt/lists/*
Expand Down Expand Up @@ -55,7 +50,6 @@ RUN chown -R ${USER}:${USER} /nethermind
RUN mkdir -p /var/lib/nethermind/ee-secret && chown -R ${USER}:${USER} /var/lib/nethermind && chmod -R 700 /var/lib/nethermind && chmod 777 /var/lib/nethermind/ee-secret

# Cannot assume buildkit, hence no chmod
COPY --from=dasel --chown=${USER}:${USER} /usr/local/bin/dasel /usr/local/bin/
COPY --chown=${USER}:${USER} ./docker-entrypoint.sh /usr/local/bin/
# Belt and suspenders
RUN chmod -R 755 /usr/local/bin/*
Expand Down
20 changes: 0 additions & 20 deletions nethermind/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,6 @@ if [ -d "/var/lib/nethermind/nethermind_db/xdai" ]; then
mv /var/lib/nethermind/nethermind_db/xdai /var/lib/nethermind/nethermind_db/gnosis
fi

# Create JSON RPC logging restrictions in the log config XML
# <logger name="JsonRpc.*" minlevel="Warn" writeTo="file-async" final="true"/>
# <logger name="JsonRpc.*" minlevel="Warn" writeTo="auto-colored-console-async" final="true"/>
# <logger name="JsonRpc.*" final="true"/>
# Set the JSON RPC logging level
#LOG_LINE=$(awk '/<logger name=\"\*\" minlevel=\"Off\" writeTo=\"seq\" \/>/{print NR}' /nethermind/NLog.config)
#sed -e "${LOG_LINE} i \ <logger name=\"JsonRpc\.\*\" final=\"true\"/>\\n" -i /nethermind/NLog.config
#sed -e "${LOG_LINE} i \ <logger name=\"JsonRpc\.\*\" minlevel=\"Warn\" writeTo=\"auto-colored-console-async\" final=\"true\"/>" -i /nethermind/NLog.config
#sed -e "${LOG_LINE} i \ <logger name=\"JsonRpc\.\*\" minlevel=\"Warn\" writeTo=\"file-async\" final=\"true\"\/>" -i /nethermind/NLog.config
# dasel 2.x syntax
dasel put -f /nethermind/NLog.config -r xml -w xml -t json 'nlog.rules.logger' -v '{"-name":"JsonWebAPI.Microsoft.Extensions.Diagnostics.HealthChecks.DefaultHealthCheckService","-maxlevel":"Error","-final":"true"}{"-name":"JsonWebAPI*","-minlevel":"Error","-writeTo":"file-async","-final":"true"}'
dasel put -f /nethermind/NLog.config -r xml -w xml -t json 'nlog.rules.logger.[]' -v '{"-name":"JsonWebAPI*","-minlevel":"Error","-writeTo":"auto-colored-console-async","-final":"true"}'
dasel put -f /nethermind/NLog.config -r xml -w xml -t json 'nlog.rules.logger.[]' -v '{"-name":"JsonWebAPI*","-final":"true"}'
dasel put -f /nethermind/NLog.config -r xml -w xml -t json 'nlog.rules.logger.[]' -v '{"-name":"JsonRpc.*","-minlevel":"Warn","-writeTo":"file-async","-final":"true"}'
dasel put -f /nethermind/NLog.config -r xml -w xml -t json 'nlog.rules.logger.[]' -v '{"-name":"JsonRpc.*","-minlevel":"Warn","-writeTo":"auto-colored-console-async","-final":"true"}'
dasel put -f /nethermind/NLog.config -r xml -w xml -t json 'nlog.rules.logger.[]' -v '{"-name":"JsonRpc.*","-final":"true"}'
dasel put -f /nethermind/NLog.config -r xml -w xml -t json 'nlog.rules.logger.[]' -v '{"-name":"*","-minlevel":"Off","-writeTo":"seq"}'
dasel put -f /nethermind/NLog.config -r xml -w xml -t json 'nlog.rules.logger.[]' -v '{"-name":"*","-minlevel":"Info","-writeTo":"file-async"}'
dasel put -f /nethermind/NLog.config -r xml -w xml -t json 'nlog.rules.logger.[]' -v '{"-name":"*","-minlevel":"Info","-writeTo":"auto-colored-console-async"}'

if [ -n "${JWT_SECRET}" ]; then
echo -n "${JWT_SECRET}" > /var/lib/nethermind/ee-secret/jwtsecret
echo "JWT secret was supplied in .env"
Expand Down

0 comments on commit 9238102

Please sign in to comment.