Skip to content

Commit

Permalink
Merge pull request #727 from cybercongress/v3-docker-container
Browse files Browse the repository at this point in the history
Update dockerfile and cosmovisor
  • Loading branch information
cyborgshead authored Apr 3, 2024
2 parents 77d2bbe + b99a95d commit 11572d1
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 6 deletions.
17 changes: 12 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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
###########################################################################################
Expand All @@ -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
###########################################################################################
Expand All @@ -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 \
Expand All @@ -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
###############################################################################
Expand Down
2 changes: 2 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -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/
Expand Down
7 changes: 6 additions & 1 deletion start_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 11572d1

Please sign in to comment.