zjowowen commited on
Commit
c7c0dad
1 Parent(s): bb47da2

init space

Browse files
Files changed (7) hide show
  1. DI-engine +1 -0
  2. Dockerfile +79 -0
  3. LightZero +1 -0
  4. README.md +4 -3
  5. gomoku_server_ui +1 -0
  6. nginx.conf +31 -0
  7. run.sh +3 -0
DI-engine ADDED
@@ -0,0 +1 @@
 
 
1
+ Subproject commit a57bc3024b938c881aaf6511d1fb26296cd98601
Dockerfile ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM pytorch/pytorch:2.1.2-cuda12.1-cudnn8-runtime as base
2
+
3
+ ENV DEBIAN_FRONTEND=noninteractive
4
+ ENV LANG en_US.UTF-8
5
+ ENV LANGUAGE en_US:UTF-8
6
+ ENV LC_ALL en_US.UTF-8
7
+
8
+ RUN apt update -y \
9
+ && apt install libgl1-mesa-glx libglib2.0-0 libsm6 libxext6 libxrender-dev swig curl git vim gcc \g++ make wget locales dnsutils zip unzip cmake nginx -y \
10
+ && curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
11
+ && apt-get install -y nodejs \
12
+ && npm install -g npm@10.3.0 \
13
+ && npm install -g create-react-app \
14
+ && npm install typescript -g \
15
+ && npm install -g vite \
16
+ && apt clean \
17
+ && rm -rf /var/cache/apt/* \
18
+ && sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen \
19
+ && locale-gen
20
+
21
+ ADD nginx.conf /etc/nginx/nginx.conf
22
+
23
+ # Set up a new user named "user" with user ID 1000
24
+ RUN useradd -m -u 1000 user
25
+
26
+ RUN mkdir -p /var/cache/nginx \
27
+ /var/log/nginx \
28
+ /var/lib/nginx
29
+ RUN touch /var/run/nginx.pid
30
+ RUN touch /run/nginx.pid
31
+
32
+ RUN chown -R user:user /var/cache/nginx \
33
+ /var/log/nginx \
34
+ /var/lib/nginx \
35
+ /var/run/nginx.pid \
36
+ /run/nginx.pid
37
+
38
+ # Switch to the "user" user
39
+ USER user
40
+
41
+ # Set home to the user's home directory
42
+ ENV HOME=/home/user \
43
+ PATH=/home/user/.local/bin:$PATH
44
+
45
+ WORKDIR $HOME/workspace
46
+
47
+ ADD --chown=user gomoku gomoku
48
+ ADD --chown=user run.sh run.sh
49
+
50
+ RUN cd ./gomoku
51
+
52
+ RUN python3 -m pip install --upgrade pip
53
+
54
+ RUN cd ./DI-engine \
55
+ && python3 -m pip install --no-cache-dir -e . \
56
+ && cd ..
57
+
58
+ RUN cd ./LightZero \
59
+ && python3 -m pip install --no-cache-dir -e . \
60
+ && cd ..
61
+
62
+ RUN cd ./gomoku_server_ui \
63
+ && cd frontend \
64
+ && npm install \
65
+ && cd .. \
66
+ && cd backend \
67
+ && pip install -r requirement.txt \
68
+ && cd .. \
69
+ && cd ..
70
+
71
+
72
+ RUN cd $HOME/workspace \
73
+ && chmod 777 run.sh
74
+
75
+ EXPOSE 3000
76
+ EXPOSE 5001
77
+ EXPOSE 2333
78
+
79
+ CMD sh ./run.sh
LightZero ADDED
@@ -0,0 +1 @@
 
 
1
+ Subproject commit 3d338ae891b54c955f34b90be1de1a0a14f56477
README.md CHANGED
@@ -1,9 +1,10 @@
1
  ---
2
  title: Gomoku
3
- emoji: 📈
4
- colorFrom: indigo
5
- colorTo: blue
6
  sdk: docker
 
7
  pinned: false
8
  license: apache-2.0
9
  ---
 
1
  ---
2
  title: Gomoku
3
+ emoji: 𖣯
4
+ colorFrom: black
5
+ colorTo: white
6
  sdk: docker
7
+ app_port: 2333
8
  pinned: false
9
  license: apache-2.0
10
  ---
gomoku_server_ui ADDED
@@ -0,0 +1 @@
 
 
1
+ Subproject commit 0647f8a5cbe1d4ac6671e4eac0288681ddd76998
nginx.conf ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ events {}
2
+
3
+ http {
4
+ server {
5
+ listen 2333 default_server;
6
+ listen [::]:2333 default_server;
7
+
8
+ server_name _;
9
+
10
+ location /gomoku_server_ui {
11
+ proxy_pass http://localhost:5001/gomoku_server_ui;
12
+ proxy_http_version 1.1;
13
+ proxy_set_header Upgrade $http_upgrade;
14
+ proxy_set_header Connection 'upgrade';
15
+ proxy_set_header Host "http://localhost:5001";
16
+ proxy_pass_request_headers on;
17
+ }
18
+
19
+ location / {
20
+ proxy_pass http://localhost:3000/;
21
+ proxy_http_version 1.1;
22
+ proxy_set_header Upgrade $http_upgrade;
23
+ proxy_set_header Connection 'upgrade';
24
+ proxy_set_header Host $host;
25
+ proxy_cache_bypass $http_upgrade;
26
+ }
27
+
28
+ error_page 405 =200 $uri;
29
+
30
+ }
31
+ }
run.sh ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ service nginx start
2
+ cd ./gomoku/gomoku_service_ui/backend && FLASK_APP=app.py FLASK_ENV=development FLASK_DEBUG=1 flask run --port 5001
3
+ cd ./gomoku/gomoku_service_ui/frontend && npm run start