-
Notifications
You must be signed in to change notification settings - Fork 7
/
Dockerfile-dev
184 lines (160 loc) · 8.45 KB
/
Dockerfile-dev
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
# copy to and run from ../ or C:\repos\Satori
# (updating process is the only thing that requires git)
# (vim for troubleshooting)
# python:slim will eventually fail, if we need to revert try this:
# FROM python:slim3.12.0b1-slim
FROM python:3.10-slim
## System dependencies
RUN apt-get update && \
apt-get install -y build-essential && \
apt-get install -y wget && \
apt-get install -y curl && \
apt-get install -y git && \
apt-get install -y vim && \
apt-get install -y cmake && \
apt-get clean
# TODO: need zip? I think it was just used for IPFS install
#apt-get install -y zip
# cmake = for making python-evrmorelib
# apt-get install -y dos2unix && \
## File system setup
ARG BRANCH_FLAG=dev
RUN mkdir -p /Satori && \
cd /Satori && git clone -b ${BRANCH_FLAG} https://github.com/SatoriNetwork/Synapse.git && \
cd /Satori && git clone -b ${BRANCH_FLAG} https://github.com/SatoriNetwork/Lib.git && \
cd /Satori && git clone -b ${BRANCH_FLAG} https://github.com/SatoriNetwork/Wallet.git && \
cd /Satori && git clone -b ${BRANCH_FLAG} https://github.com/SatoriNetwork/Engine.git && \
cd /Satori && git clone https://github.com/amazon-science/chronos-forecasting.git && \
cd /Satori && git clone https://github.com/ibm-granite/granite-tsfm.git
# NOTE: dos2unix line is used to convert line endings from Windows to Unix format
# TODO: test 777 permissions
#chmod -R 777 /Satori/Synapse && \
#chmod -R 777 /Satori/Lib && \
#chmod -R 777 /Satori/Wallet && \
#chmod -R 777 /Satori/Engine && \
#chmod -R 777 /Satori/Neuron && \
# cd /Satori && git clone -b ${BRANCH_FLAG} https://github.com/SatoriNetwork/Neuron.git && \
# mkdir -p /Satori/Neuron/models && \
# mkdir -p /Satori/Neuron/models/huggingface && \
# chmod +x /Satori/Neuron/satorineuron/web/start.sh && \
# chmod +x /Satori/Neuron/satorineuron/web/start_from_image.sh && \
# dos2unix /Satori/Neuron/satorineuron/web/start.sh && dos2unix /Satori/Neuron/satorineuron/web/start_from_image.sh
## Install everything
ARG GPU_FLAG=off
ENV GPU_FLAG=${GPU_FLAG}
ENV HF_HOME=/Satori/Neuron/models/huggingface
# for torch: cpu cu118 cu121 cu124 --index-url https://download.pytorch.org/whl/cpu
RUN pip install --upgrade pip && \
if [ "${GPU_FLAG}" = "on" ]; then \
pip install --no-cache-dir torch==2.4.1 --index-url https://download.pytorch.org/whl/cu124; \
else \
pip install --no-cache-dir torch==2.4.1 --index-url https://download.pytorch.org/whl/cpu; \
fi && \
pip install --no-cache-dir transformers==4.44.2 && \
pip install --no-cache-dir /Satori/granite-tsfm && \
pip install --no-cache-dir /Satori/chronos-forecasting && \
cd /Satori/Wallet && pip install --no-cache-dir -r requirements.txt && python setup.py develop && \
cd /Satori/Synapse && pip install --no-cache-dir -r requirements.txt && python setup.py develop && \
cd /Satori/Lib && pip install --no-cache-dir -r requirements.txt && python setup.py develop && \
cd /Satori/Engine && pip install --no-cache-dir -r requirements.txt && python setup.py develop
# cd /Satori/Neuron && pip install --no-cache-dir -r requirements.txt && python setup.py develop
# satori ui
EXPOSE 24601
# ipfs - unused
#RUN wget https://dist.ipfs.tech/kubo/v0.21.0/kubo_v0.21.0_linux-amd64.tar.gz
#RUN tar -xvzf kubo_v0.21.0_linux-amd64.tar.gz
#RUN cd kubo && bash install.sh
# has no effect, we put it in the run command
#RUN echo "IPFS_PATH=/Satori/Neuron/config/ipfs" >> /etc/environment
#RUN echo "source /etc/environment" >> ~/.bashrc
# echo $IPFS_PATH
# RUN ipfs init # do not init. it will be initialized by the node, so that each container has a unique ID.
# todo: maybe just move all this to the code part.
# RUN mkdir /Satori
# RUN mkdir /Satori/Synapse
# RUN mkdir /Satori/Lib
# RUN mkdir /Satori/Wallet
# RUN mkdir /Satori/Engine
# RUN mkdir /Satori/Neuron
# RUN mkdir /Satori/Neuron/data
# RUN mkdir /Satori/Neuron/models
# RUN mkdir /Satori/Neuron/wallet
# RUN mkdir /Satori/Neuron/config
# RUN mkdir /Satori/Neuron/uploaded
# RUN mkdir /Satori/Neuron/predictions
# COPY Synapse/satorisynapse /Satori/Synapse/satorisynapse
# COPY Synapse/setup.py /Satori/Synapse/setup.py
# COPY Synapse/requirements.txt /Satori/Synapse/requirements.txt
# COPY Lib/satorilib /Satori/Lib/satorilib
# COPY Lib/setup.py /Satori/Lib/setup.py
# COPY Lib/requirements.txt /Satori/Lib/requirements.txt
# COPY Wallet/satoriwallet /Satori/Wallet/satoriwallet
# COPY Wallet/reqs /Satori/Wallet/reqs
# COPY Wallet/setup.py /Satori/Wallet/setup.py
# COPY Wallet/requirements.txt /Satori/Wallet/requirements.txt
# COPY Engine/satoriengine /Satori/Engine/satoriengine
# COPY Engine/setup.py /Satori/Engine/setup.py
# COPY Engine/requirements.txt /Satori/Engine/requirements.txt
# COPY Neuron/satorineuron/ /Satori/Neuron/satorineuron/
# COPY Neuron/config/config.yaml /Satori/Neuron/config/config.yaml
# COPY Neuron/setup.py /Satori/Neuron/setup.py
# COPY Neuron/requirements.txt /Satori/Neuron/requirements.txt
# RUN chmod -R 777 /Satori/Synapse
# RUN chmod -R 777 /Satori/Lib
# RUN chmod -R 777 /Satori/Wallet
# RUN chmod -R 777 /Satori/Engine
# RUN chmod -R 777 /Satori/Neuron
# RUN cd /Satori && git clone -b dev https://github.com/SatoriNetwork/Synapse.git && \
# cd /Satori && git clone -b dev https://github.com/SatoriNetwork/Lib.git && \
# cd /Satori && git clone -b dev https://github.com/SatoriNetwork/Wallet.git && \
# cd /Satori && git clone -b dev https://github.com/SatoriNetwork/Engine.git && \
# # cd /Satori && git clone -b dev https://github.com/SatoriNetwork/Neuron.git && \
# cd /Satori && git clone https://github.com/amazon-science/chronos-forecasting.git && \
# cd /Satori && git clone https://github.com/ibm-granite/granite-tsfm.git
# ARG GPU_FLAG=off
# ENV GPU_FLAG=${GPU_FLAG}
# # for torch: cpu cu118 cu121 cu124 --index-url https://download.pytorch.org/whl/cpu
# RUN pip install --upgrade pip && \
# if [ "$GPU_FLAG" = "on" ]; then \
# pip install --no-cache-dir torch==2.4.1 --index-url https://download.pytorch.org/whl/cu124; \
# else \
# pip install --no-cache-dir torch==2.4.1 --index-url https://download.pytorch.org/whl/cpu; \
# fi && \
# pip install --no-cache-dir transformers==4.44.2 && \
# pip install --no-cache-dir /Satori/granite-tsfm && \
# pip install --no-cache-dir /Satori/chronos-forecasting && \
# cd /Satori/Synapse && pip install --no-cache-dir -r requirements.txt && python setup.py develop && \
# cd /Satori/Lib && pip install --no-cache-dir -r requirements.txt && python setup.py develop && \
# cd /Satori/Wallet && pip install --no-cache-dir -r requirements.txt && python setup.py develop && \
# cd /Satori/Engine && pip install --no-cache-dir -r requirements.txt && python setup.py develop
# # cd /Satori/Neuron && pip install --no-cache-dir -r requirements.txt && python setup.py develop
## no need for ollama at this time.
#RUN apt-get install -y curl
#RUN mkdir /Satori/Neuron/chat
#RUN cd /Satori/Neuron/chat && curl -fsSL https://ollama.com/install.sh | sh
#RUN ollama serve
#RUN ollama pull llama3
# # satori ui
# EXPOSE 24601
# ipfs web ui
#EXPOSE 5002
# ipfs
#EXPOSE 4001 5001 23384
#EXPOSE 3000
# WORKDIR /Satori/Neuron/satorineuron/web
#ENTRYPOINT [ "python" ]
#CMD ["python", "./app.py" ]
# CMD ["bash", "./start_from_image.sh"]
# BUILD PROCESS:
# copy to and run from ../ (cd ..)
# \Satori> docker build --no-cache -t satorinet/satorineuron:base .
# OR
# \Satori> docker buildx create --use
# \Satori> docker buildx build --platform linux/amd64,linux/arm64 -t satorinet/satorineuron:base --push .
# delete the base one after you push it, we just need it local
# RUN OPTIONS
# docker run --rm -it --name satorineuron -p 24601:24601 -v c:\repos\Satori\Neuron:/Satori/Neuron -v c:\repos\Satori\Synapse:/Satori/Synapse -v c:\repos\Satori\Lib:/Satori/Lib -v c:\repos\Satori\Wallet:/Satori/Wallet -v c:\repos\Satori\Engine:/Satori/Engine -e IPFS_PATH=/Satori/Neuron/config/ipfs --env ENV=local satorinet/satorineuron:base bash
# docker run --rm -it --name satorineuron -p 24601:24601 -v c:\repos\Satori\Neuron:/Satori/Neuron -v c:\repos\Satori\Synapse:/Satori/Synapse -v c:\repos\Satori\Lib:/Satori/Lib -v c:\repos\Satori\Wallet:/Satori/Wallet -v c:\repos\Satori\Engine:/Satori/Engine -e IPFS_PATH=/Satori/Neuron/config/ipfs --env ENV=prod satorinet/satorineuron:base ./start.sh
# docker run --rm -it --name satorineuron -p 24601:24601 -v c:\repos\Satori\Neuron:/Satori/Neuron -v c:\repos\Satori\Synapse:/Satori/Synapse -v c:\repos\Satori\Lib:/Satori/Lib -v c:\repos\Satori\Wallet:/Satori/Wallet -v c:\repos\Satori\Engine:/Satori/Engine satorinet/satorineuron:base bash
# docker run --rm -it --name satorineuron satorinet/satorineuron:base bash
# docker exec -it satorineuron bash