diff --git a/Dockerfile b/Dockerfile index 6fd7fedd..c245ddbd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -50,6 +50,7 @@ RUN apt-get update && apt-get -y install --no-install-recommends \ && apt-get install cuda=${CUDA_VER} -y --no-install-recommends \ && mkdir -p /cyber/cosmovisor/genesis/bin \ && mkdir -p /cyber/cosmovisor/upgrades/cyberfrey/bin \ +&& mkdir -p /cyber/cosmovisor/upgrades/v3/bin \ # Compile cyber for genesis version ########################################################################################### && git checkout v0.2.0 \ @@ -58,7 +59,6 @@ RUN apt-get update && apt-get -y install --no-install-recommends \ && cd /sources \ && make build CUDA_ENABLED=true \ && cp ./build/cyber /cyber/cosmovisor/genesis/bin/ \ -&& cp ./build/cyber /usr/local/bin \ && rm -rf ./build \ # Compile cyber for cyberfrey version ########################################################################################### @@ -68,6 +68,15 @@ RUN apt-get update && apt-get -y install --no-install-recommends \ && cd /sources \ && make build CUDA_ENABLED=true \ && cp ./build/cyber /cyber/cosmovisor/upgrades/cyberfrey/bin/ \ +&& rm -rf ./build \ + # Compile cyber for v3 version +########################################################################################### +&& git checkout v3.0.0 \ +&& cd /sources/x/rank/cuda \ +&& make build \ +&& cd /sources \ +&& make build CUDA_ENABLED=true \ +&& cp ./build/cyber /cyber/cosmovisor/upgrades/v3/bin/ \ && rm -rf ./build \ # Cleanup ########################################################################################### @@ -85,7 +94,7 @@ RUN apt-get update && apt-get -y install --no-install-recommends \ # Install cosmovisor ########################################################################################### - RUN wget -O cosmovisor.tgz https://github.com/cosmos/cosmos-sdk/releases/download/cosmovisor%2Fv1.1.0/cosmovisor-v1.1.0-linux-amd64.tar.gz \ + RUN wget -O cosmovisor.tgz https://github.com/cosmos/cosmos-sdk/releases/download/cosmovisor%2Fv1.5.0/cosmovisor-v1.5.0-linux-amd64.tar.gz \ && tar -xzf cosmovisor.tgz \ && cp cosmovisor /usr/bin/cosmovisor \ && chmod +x /usr/bin/cosmovisor \ @@ -98,9 +107,7 @@ COPY start_script.sh start_script.sh COPY entrypoint.sh /entrypoint.sh RUN wget -O /genesis.json https://gateway.ipfs.cybernode.ai/ipfs/QmYubyVNfghD4xCrTFj26zBwrF9s5GJhi1TmxvrwmJCipr \ && chmod +x start_script.sh \ -&& chmod +x /entrypoint.sh \ -&& cyber version - +&& chmod +x /entrypoint.sh # Start ############################################################################### diff --git a/entrypoint.sh b/entrypoint.sh index e00a7e31..f99cf58c 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,5 +1,7 @@ #!/bin/sh +ln -s /root/.cyber/cosmovisor/current/bin/cyber /usr/bin/cyber + if [ ! -d "/root/.cyber/" ] then mkdir /root/.cyber/ diff --git a/start_script.sh b/start_script.sh index c840b19f..ea5c82a9 100644 --- a/start_script.sh +++ b/start_script.sh @@ -3,7 +3,12 @@ ulimit -n 4096 & export DAEMON_LOG_BUFFER_SIZE=700 +export DAEMON_HOME=/root/.cyber +export DAEMON_NAME=cyber +export DAEMON_ALLOW_DOWNLOAD_BINARIES=false +export DAEMON_RESTART_AFTER_UPGRADE=true +export UNSAFE_SKIP_BACKUP=true # Start cyber process -#// TODO with Cosmovisor v1.x add run command (cosmovisor run) + /usr/bin/cosmovisor run start --compute-gpu true --search-api $ALLOW_SEARCH --home /root/.cyber \ No newline at end of file