-
Notifications
You must be signed in to change notification settings - Fork 7
/
Dockerfile base
123 lines (105 loc) · 6.36 KB
/
Dockerfile base
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
# 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.9-slim AS builder
RUN apt-get update && \
apt-get install -y build-essential wget git vim cmake zip curl && \
mkdir /Satori && \
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 && \
mkdir /Satori/Neuron/models && \
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 && \
pip install --upgrade pip && \
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
# larger version: add later.
#cd /Satori && git clone https://github.com/amazon-science/chronos-forecasting.git && \
#cd /Satori && git clone https://github.com/ibm-granite/granite-tsfm.git && \
#pip install --no-cache-dir torch==2.3.1 && \
#pip install --no-cache-dir transformers==4.41.2 && \
#pip install --no-cache-dir /Satori/granite-tsfm && \
#pip install --no-cache-dir /Satori/chronos-forecasting && \
# python-evrmorelib needs cmake and zip
# 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 cd /Satori && git clone -b dev https://github.com/SatoriNetwork/Synapse.git
#RUN cd /Satori && git clone -b dev https://github.com/SatoriNetwork/Lib.git
#RUN cd /Satori && git clone -b dev https://github.com/SatoriNetwork/Wallet.git
#RUN cd /Satori && git clone -b dev https://github.com/SatoriNetwork/Engine.git
# ADVANCED ENGINE STUFF
# RUN cd /Satori && git clone https://github.com/amazon-science/chronos-forecasting.git
# RUN cd /Satori && git clone https://github.com/ibm-granite/granite-tsfm.git
# RUN pip install --upgrade pip
# RUN pip install --no-cache-dir /Satori/granite-tsfm
# RUN pip install --no-cache-dir /Satori/chronos-forecasting
# 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
## 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" ]
# BUILD PROCESS:
# \Satori> docker buildx build --no-cache -f "Neuron/Dockerfile" --platform linux/amd64,linux/arm64 -t satorinet/satorineuron:latest .
# \Satori> docker buildx build -f "Neuron/Dockerfile acode" --platform linux/amd64 -t satorinet/satorineuron:latest --load .
# \Satori> docker buildx build -f "Neuron/Dockerfile acode" --platform linux/arm64 -t satorinet/satorineuron:latest --load .
# \Satori> docker push satorinet/satorineuron:latest
# BUILD-PUSH PROCESS:
# copy to and run from ../ (cd ..)
# \Satori> docker build --no-cache -f "Neuron/Dockerfile base" -t satorinet/satorineuron:base .
# OR
# \Satori> docker buildx create --use
# \Satori> docker buildx build -f "Neuron/Dockerfile base" --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