Spaces:
Sleeping
Sleeping
⚙ update: Add Proxy 1 and 2 (HuggingFace)
Browse files- .github/workflows/{proxy_deploy.yaml → proxy_deployments.yaml} +86 -3
- Makefile +82 -14
- README.md +1 -1
.github/workflows/{proxy_deploy.yaml → proxy_deployments.yaml}
RENAMED
@@ -1,4 +1,4 @@
|
|
1 |
-
name:
|
2 |
|
3 |
on:
|
4 |
push:
|
@@ -9,7 +9,7 @@ on:
|
|
9 |
|
10 |
jobs:
|
11 |
tebakaja_proxy_space-0:
|
12 |
-
name: Proxy Deployment
|
13 |
runs-on: ubuntu-latest
|
14 |
environment: Production
|
15 |
|
@@ -47,4 +47,87 @@ jobs:
|
|
47 |
|
48 |
- name: Push to Hugging Face
|
49 |
run: |
|
50 |
-
git push https://$HF_USERNAME:$HF_TOKEN@huggingface.co/spaces/$HF_USERNAME/$SPACE_NAME main --force
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
name: Proxy Deployment
|
2 |
|
3 |
on:
|
4 |
push:
|
|
|
9 |
|
10 |
jobs:
|
11 |
tebakaja_proxy_space-0:
|
12 |
+
name: Proxy-0 Deployment
|
13 |
runs-on: ubuntu-latest
|
14 |
environment: Production
|
15 |
|
|
|
47 |
|
48 |
- name: Push to Hugging Face
|
49 |
run: |
|
50 |
+
git push https://$HF_USERNAME:$HF_TOKEN@huggingface.co/spaces/$HF_USERNAME/$SPACE_NAME main --force
|
51 |
+
|
52 |
+
tebakaja_proxy_space-1:
|
53 |
+
name: Proxy-1 Deployment
|
54 |
+
runs-on: ubuntu-latest
|
55 |
+
environment: Production
|
56 |
+
|
57 |
+
env:
|
58 |
+
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
59 |
+
SPACE_NAME: tebakaja_proxy_space-1
|
60 |
+
HF_USERNAME: qywok
|
61 |
+
|
62 |
+
steps:
|
63 |
+
- name: Set global directory
|
64 |
+
run: git config --global --add safe.directory /github/workspace
|
65 |
+
|
66 |
+
- uses: actions/checkout@v3
|
67 |
+
with:
|
68 |
+
persist-credentials: false
|
69 |
+
fetch-depth: 1000
|
70 |
+
|
71 |
+
- name: Check git status
|
72 |
+
run: git status
|
73 |
+
|
74 |
+
- name: Configure git
|
75 |
+
run: |
|
76 |
+
git config --local user.email "alfariqyraihan@gmail.com"
|
77 |
+
git config --local user.name "qywok"
|
78 |
+
|
79 |
+
- name: Pull changes from remote
|
80 |
+
run: |
|
81 |
+
git pull https://$HF_USERNAME:$HF_TOKEN@huggingface.co/spaces/$HF_USERNAME/$SPACE_NAME main || \
|
82 |
+
(git merge --strategy-option theirs)
|
83 |
+
|
84 |
+
- name: Add and commit changes
|
85 |
+
run: |
|
86 |
+
git add -A
|
87 |
+
git diff-index --quiet HEAD || git commit -m "tebakaja_proxy_space-1"
|
88 |
+
|
89 |
+
- name: Push to Hugging Face
|
90 |
+
run: |
|
91 |
+
git push https://$HF_USERNAME:$HF_TOKEN@huggingface.co/spaces/$HF_USERNAME/$SPACE_NAME main --force
|
92 |
+
|
93 |
+
|
94 |
+
tebakaja_proxy_space-2:
|
95 |
+
name: Proxy-2 Deployment
|
96 |
+
runs-on: ubuntu-latest
|
97 |
+
environment: Production
|
98 |
+
|
99 |
+
env:
|
100 |
+
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
101 |
+
SPACE_NAME: tebakaja_proxy_space-2
|
102 |
+
HF_USERNAME: qywok
|
103 |
+
|
104 |
+
steps:
|
105 |
+
- name: Set global directory
|
106 |
+
run: git config --global --add safe.directory /github/workspace
|
107 |
+
|
108 |
+
- uses: actions/checkout@v3
|
109 |
+
with:
|
110 |
+
persist-credentials: false
|
111 |
+
fetch-depth: 1000
|
112 |
+
|
113 |
+
- name: Check git status
|
114 |
+
run: git status
|
115 |
+
|
116 |
+
- name: Configure git
|
117 |
+
run: |
|
118 |
+
git config --local user.email "alfariqyraihan@gmail.com"
|
119 |
+
git config --local user.name "qywok"
|
120 |
+
|
121 |
+
- name: Pull changes from remote
|
122 |
+
run: |
|
123 |
+
git pull https://$HF_USERNAME:$HF_TOKEN@huggingface.co/spaces/$HF_USERNAME/$SPACE_NAME main || \
|
124 |
+
(git merge --strategy-option theirs)
|
125 |
+
|
126 |
+
- name: Add and commit changes
|
127 |
+
run: |
|
128 |
+
git add -A
|
129 |
+
git diff-index --quiet HEAD || git commit -m "tebakaja_proxy_space-2"
|
130 |
+
|
131 |
+
- name: Push to Hugging Face
|
132 |
+
run: |
|
133 |
+
git push https://$HF_USERNAME:$HF_TOKEN@huggingface.co/spaces/$HF_USERNAME/$SPACE_NAME main --force
|
Makefile
CHANGED
@@ -1,5 +1,8 @@
|
|
1 |
DEV_ENDPOINT=http://192.168.137.1:7860
|
2 |
-
|
|
|
|
|
|
|
3 |
|
4 |
start:
|
5 |
go run main.go
|
@@ -20,6 +23,10 @@ traefik-test:
|
|
20 |
--api.dashboard=true \
|
21 |
--api.insecure=false
|
22 |
|
|
|
|
|
|
|
|
|
23 |
stock-list-test:
|
24 |
curl -X GET $(DEV_ENDPOINT)/stock/lists
|
25 |
|
@@ -45,26 +52,87 @@ natcurr-prediction-test:
|
|
45 |
-d "{\"days\": 2, \"currency\": \"BTC-USD\"}"
|
46 |
|
47 |
|
48 |
-
|
49 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
|
51 |
-
|
52 |
-
curl -X POST $(
|
53 |
-H "Content-Type: application/json" \
|
54 |
-d "{\"days\": 7, \"currency\": \"BTC-USD\"}"
|
55 |
|
56 |
-
|
57 |
-
curl -X GET $(
|
58 |
|
59 |
-
|
60 |
-
curl -X POST $(
|
61 |
-H "Content-Type: application/json" \
|
62 |
-d "{\"days\": 7, \"currency\": \"BTC-USD\"}"
|
63 |
|
64 |
-
|
65 |
-
|
|
|
|
|
|
|
|
|
66 |
|
67 |
-
|
68 |
-
curl -X POST $(
|
69 |
-H "Content-Type: application/json" \
|
70 |
-
-d "{\"days\": 7, \"currency\": \"BTC-USD\"}"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
DEV_ENDPOINT=http://192.168.137.1:7860
|
2 |
+
|
3 |
+
PROD_ENDPOINT_0=https://qywok-tebakaja-proxy-space-0.hf.space
|
4 |
+
PROD_ENDPOINT_1=https://qywok-tebakaja-proxy-space-1.hf.space
|
5 |
+
PROD_ENDPOINT_2=https://qywok-tebakaja-proxy-space-2.hf.space
|
6 |
|
7 |
start:
|
8 |
go run main.go
|
|
|
23 |
--api.dashboard=true \
|
24 |
--api.insecure=false
|
25 |
|
26 |
+
#
|
27 |
+
# --- Development Testing ---
|
28 |
+
#
|
29 |
+
|
30 |
stock-list-test:
|
31 |
curl -X GET $(DEV_ENDPOINT)/stock/lists
|
32 |
|
|
|
52 |
-d "{\"days\": 2, \"currency\": \"BTC-USD\"}"
|
53 |
|
54 |
|
55 |
+
#
|
56 |
+
# --- Production Testing (Proxy 0) ---
|
57 |
+
#
|
58 |
+
|
59 |
+
stock-list-prod-0:
|
60 |
+
curl -X GET $(PROD_ENDPOINT_0)/stock/lists
|
61 |
+
|
62 |
+
stock-prediction-prod-0:
|
63 |
+
curl -X POST $(PROD_ENDPOINT_0)/stock/prediction \
|
64 |
+
-H "Content-Type: application/json" \
|
65 |
+
-d "{\"days\": 7, \"currency\": \"BTC-USD\"}"
|
66 |
+
|
67 |
+
crypto-list-prod-0:
|
68 |
+
curl -X GET $(PROD_ENDPOINT_0)/crypto/lists
|
69 |
+
|
70 |
+
crypto-prediction-prod-0:
|
71 |
+
curl -X POST $(PROD_ENDPOINT_0)/crypto/prediction \
|
72 |
+
-H "Content-Type: application/json" \
|
73 |
+
-d "{\"days\": 7, \"currency\": \"BTC-USD\"}"
|
74 |
+
|
75 |
+
natcurr-list-prod-0:
|
76 |
+
curl -X GET $(PROD_ENDPOINT_0)/national-currency/lists
|
77 |
+
|
78 |
+
natcurr-prediction-prod-0:
|
79 |
+
curl -X POST $(PROD_ENDPOINT_0)/national-currency/prediction \
|
80 |
+
-H "Content-Type: application/json" \
|
81 |
+
-d "{\"days\": 7, \"currency\": \"BTC-USD\"}"
|
82 |
+
|
83 |
+
#
|
84 |
+
# --- Production Testing (Proxy 1) ---
|
85 |
+
#
|
86 |
+
|
87 |
+
stock-list-prod-1:
|
88 |
+
curl -X GET $(PROD_ENDPOINT_1)/stock/lists
|
89 |
+
|
90 |
+
stock-prediction-prod-1:
|
91 |
+
curl -X POST $(PROD_ENDPOINT_1)/stock/prediction \
|
92 |
+
-H "Content-Type: application/json" \
|
93 |
+
-d "{\"days\": 7, \"currency\": \"BTC-USD\"}"
|
94 |
+
|
95 |
+
crypto-list-prod-1:
|
96 |
+
curl -X GET $(PROD_ENDPOINT_1)/crypto/lists
|
97 |
|
98 |
+
crypto-prediction-prod-1:
|
99 |
+
curl -X POST $(PROD_ENDPOINT_1)/crypto/prediction \
|
100 |
-H "Content-Type: application/json" \
|
101 |
-d "{\"days\": 7, \"currency\": \"BTC-USD\"}"
|
102 |
|
103 |
+
natcurr-list-prod-1:
|
104 |
+
curl -X GET $(PROD_ENDPOINT_1)/national-currency/lists
|
105 |
|
106 |
+
natcurr-prediction-prod-1:
|
107 |
+
curl -X POST $(PROD_ENDPOINT_1)/national-currency/prediction \
|
108 |
-H "Content-Type: application/json" \
|
109 |
-d "{\"days\": 7, \"currency\": \"BTC-USD\"}"
|
110 |
|
111 |
+
#
|
112 |
+
# --- Production Testing (Proxy 2) ---
|
113 |
+
#
|
114 |
+
|
115 |
+
stock-list-prod-2:
|
116 |
+
curl -X GET $(PROD_ENDPOINT_2)/stock/lists
|
117 |
|
118 |
+
stock-prediction-prod-2:
|
119 |
+
curl -X POST $(PROD_ENDPOINT_2)/stock/prediction \
|
120 |
-H "Content-Type: application/json" \
|
121 |
+
-d "{\"days\": 7, \"currency\": \"BTC-USD\"}"
|
122 |
+
|
123 |
+
crypto-list-prod-2:
|
124 |
+
curl -X GET $(PROD_ENDPOINT_2)/crypto/lists
|
125 |
+
|
126 |
+
crypto-prediction-prod-2:
|
127 |
+
curl -X POST $(PROD_ENDPOINT_2)/crypto/prediction \
|
128 |
+
-H "Content-Type: application/json" \
|
129 |
+
-d "{\"days\": 7, \"currency\": \"BTC-USD\"}"
|
130 |
+
|
131 |
+
natcurr-list-prod-2:
|
132 |
+
curl -X GET $(PROD_ENDPOINT_2)/national-currency/lists
|
133 |
+
|
134 |
+
natcurr-prediction-prod-2:
|
135 |
+
curl -X POST $(PROD_ENDPOINT_2)/national-currency/prediction \
|
136 |
+
-H "Content-Type: application/json" \
|
137 |
+
-d "{\"days\": 7, \"currency\": \"BTC-USD\"}"
|
138 |
+
|
README.md
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
---
|
2 |
-
title: TebakAja Proxy Space
|
3 |
emoji: ⚙
|
4 |
colorFrom: purple
|
5 |
colorTo: pink
|
|
|
1 |
---
|
2 |
+
title: TebakAja Proxy Space
|
3 |
emoji: ⚙
|
4 |
colorFrom: purple
|
5 |
colorTo: pink
|