tebakaja commited on
Commit
45f7ad7
1 Parent(s): d7df8d0

update: add functional testing and repair pipeline

Browse files
.github/workflows/gru_pipeline.yaml CHANGED
@@ -3,7 +3,7 @@ name: GRU Pipeline
3
  on:
4
  push:
5
  branches:
6
- - production
7
  tags:
8
  - '*'
9
  schedule:
@@ -12,8 +12,9 @@ on:
12
 
13
  jobs:
14
  scraping_extracting:
15
- name: Scraping, and Extracting
16
  runs-on: ubuntu-latest
 
17
 
18
  steps:
19
  - name: Set global directory
@@ -66,6 +67,7 @@ jobs:
66
  overwrite: "true"
67
 
68
  - name: Upload Artifact (datasets)
 
69
  uses: actions/upload-artifact@v3
70
  with:
71
  name: datasets
@@ -79,9 +81,10 @@ jobs:
79
 
80
 
81
  preprocessing_training:
82
- name: Preprocessing, and Training
83
  runs-on: ubuntu-latest
84
  needs: scraping_extracting
 
85
 
86
  steps:
87
  - name: Set global directory
@@ -117,6 +120,7 @@ jobs:
117
  run: pip install -r requirements.txt
118
 
119
  - name: Download Artifact (datasets)
 
120
  uses: actions/download-artifact@v3
121
  with:
122
  name: datasets
@@ -201,14 +205,14 @@ jobs:
201
  uses: ad-m/github-push-action@master
202
  with:
203
  github_token: ${{ secrets.GH_TOKEN }}
204
- branch: production
205
 
206
 
207
  tebakaja_crypto_space-0:
208
  name: crypto-forecast-svc-0
209
  runs-on: ubuntu-latest
210
  needs: preprocessing_training
211
- environment: Production
212
 
213
  env:
214
  HF_TOKEN: ${{ secrets.HF_TOKEN }}
@@ -234,7 +238,7 @@ jobs:
234
 
235
  - name: Pull changes from remote
236
  run: |
237
- git pull https://$HF_USERNAME:[email protected]/spaces/$HF_USERNAME/$SPACE_NAME production || \
238
  (git merge --strategy-option theirs)
239
 
240
  - name: Add and commit changes
@@ -244,14 +248,14 @@ jobs:
244
 
245
  - name: Push to Hugging Face
246
  run: |
247
- git push https://$HF_USERNAME:[email protected]/spaces/$HF_USERNAME/$SPACE_NAME production --force
248
 
249
 
250
  tebakaja_crypto_space-1:
251
  name: crypto-forecast-svc-1
252
  runs-on: ubuntu-latest
253
  needs: preprocessing_training
254
- environment: Production
255
 
256
  env:
257
  HF_TOKEN: ${{ secrets.HF_TOKEN }}
@@ -277,7 +281,7 @@ jobs:
277
 
278
  - name: Pull changes from remote
279
  run: |
280
- git pull https://$HF_USERNAME:[email protected]/spaces/$HF_USERNAME/$SPACE_NAME production || \
281
  (git merge --strategy-option theirs)
282
 
283
  - name: Add and commit changes
@@ -287,14 +291,14 @@ jobs:
287
 
288
  - name: Push to Hugging Face
289
  run: |
290
- git push https://$HF_USERNAME:[email protected]/spaces/$HF_USERNAME/$SPACE_NAME production --force
291
 
292
 
293
  tebakaja_crypto_space-2:
294
  name: crypto-forecast-svc-2
295
  runs-on: ubuntu-latest
296
  needs: preprocessing_training
297
- environment: Production
298
 
299
  env:
300
  HF_TOKEN: ${{ secrets.HF_TOKEN }}
@@ -320,7 +324,7 @@ jobs:
320
 
321
  - name: Pull changes from remote
322
  run: |
323
- git pull https://$HF_USERNAME:[email protected]/spaces/$HF_USERNAME/$SPACE_NAME production || \
324
  (git merge --strategy-option theirs)
325
 
326
  - name: Add and commit changes
@@ -330,14 +334,14 @@ jobs:
330
 
331
  - name: Push to Hugging Face
332
  run: |
333
- git push https://$HF_USERNAME:[email protected]/spaces/$HF_USERNAME/$SPACE_NAME production --force
334
 
335
 
336
  tebakaja_crypto_space-3:
337
  name: crypto-forecast-svc-3
338
  runs-on: ubuntu-latest
339
  needs: preprocessing_training
340
- environment: Production
341
 
342
  env:
343
  HF_TOKEN: ${{ secrets.HF_TOKEN }}
@@ -363,7 +367,7 @@ jobs:
363
 
364
  - name: Pull changes from remote
365
  run: |
366
- git pull https://$HF_USERNAME:[email protected]/spaces/$HF_USERNAME/$SPACE_NAME production || \
367
  (git merge --strategy-option theirs)
368
 
369
  - name: Add and commit changes
@@ -373,14 +377,14 @@ jobs:
373
 
374
  - name: Push to Hugging Face
375
  run: |
376
- git push https://$HF_USERNAME:[email protected]/spaces/$HF_USERNAME/$SPACE_NAME production --force
377
 
378
 
379
  tebakaja_crypto_space-4:
380
  name: crypto-forecast-svc-4
381
  runs-on: ubuntu-latest
382
  needs: preprocessing_training
383
- environment: Production
384
 
385
  env:
386
  HF_TOKEN: ${{ secrets.HF_TOKEN }}
@@ -406,7 +410,7 @@ jobs:
406
 
407
  - name: Pull changes from remote
408
  run: |
409
- git pull https://$HF_USERNAME:[email protected]/spaces/$HF_USERNAME/$SPACE_NAME production || \
410
  (git merge --strategy-option theirs)
411
 
412
  - name: Add and commit changes
@@ -416,4 +420,31 @@ jobs:
416
 
417
  - name: Push to Hugging Face
418
  run: |
419
- git push https://$HF_USERNAME:[email protected]/spaces/$HF_USERNAME/$SPACE_NAME production --force
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  on:
4
  push:
5
  branches:
6
+ - main
7
  tags:
8
  - '*'
9
  schedule:
 
12
 
13
  jobs:
14
  scraping_extracting:
15
+ name: Scraping and Extracting
16
  runs-on: ubuntu-latest
17
+ environment: Scraping and Extraction
18
 
19
  steps:
20
  - name: Set global directory
 
67
  overwrite: "true"
68
 
69
  - name: Upload Artifact (datasets)
70
+ if: env.match != 'true'
71
  uses: actions/upload-artifact@v3
72
  with:
73
  name: datasets
 
81
 
82
 
83
  preprocessing_training:
84
+ name: Preprocessing and Training
85
  runs-on: ubuntu-latest
86
  needs: scraping_extracting
87
+ environment: Preprocessing and Training
88
 
89
  steps:
90
  - name: Set global directory
 
120
  run: pip install -r requirements.txt
121
 
122
  - name: Download Artifact (datasets)
123
+ if: env.match != 'true'
124
  uses: actions/download-artifact@v3
125
  with:
126
  name: datasets
 
205
  uses: ad-m/github-push-action@master
206
  with:
207
  github_token: ${{ secrets.GH_TOKEN }}
208
+ branch: main
209
 
210
 
211
  tebakaja_crypto_space-0:
212
  name: crypto-forecast-svc-0
213
  runs-on: ubuntu-latest
214
  needs: preprocessing_training
215
+ environment: Deployment
216
 
217
  env:
218
  HF_TOKEN: ${{ secrets.HF_TOKEN }}
 
238
 
239
  - name: Pull changes from remote
240
  run: |
241
+ git pull https://$HF_USERNAME:[email protected]/spaces/$HF_USERNAME/$SPACE_NAME main || \
242
  (git merge --strategy-option theirs)
243
 
244
  - name: Add and commit changes
 
248
 
249
  - name: Push to Hugging Face
250
  run: |
251
+ git push https://$HF_USERNAME:[email protected]/spaces/$HF_USERNAME/$SPACE_NAME main --force
252
 
253
 
254
  tebakaja_crypto_space-1:
255
  name: crypto-forecast-svc-1
256
  runs-on: ubuntu-latest
257
  needs: preprocessing_training
258
+ environment: Deployment
259
 
260
  env:
261
  HF_TOKEN: ${{ secrets.HF_TOKEN }}
 
281
 
282
  - name: Pull changes from remote
283
  run: |
284
+ git pull https://$HF_USERNAME:[email protected]/spaces/$HF_USERNAME/$SPACE_NAME main || \
285
  (git merge --strategy-option theirs)
286
 
287
  - name: Add and commit changes
 
291
 
292
  - name: Push to Hugging Face
293
  run: |
294
+ git push https://$HF_USERNAME:[email protected]/spaces/$HF_USERNAME/$SPACE_NAME main --force
295
 
296
 
297
  tebakaja_crypto_space-2:
298
  name: crypto-forecast-svc-2
299
  runs-on: ubuntu-latest
300
  needs: preprocessing_training
301
+ environment: Deployment
302
 
303
  env:
304
  HF_TOKEN: ${{ secrets.HF_TOKEN }}
 
324
 
325
  - name: Pull changes from remote
326
  run: |
327
+ git pull https://$HF_USERNAME:[email protected]/spaces/$HF_USERNAME/$SPACE_NAME main || \
328
  (git merge --strategy-option theirs)
329
 
330
  - name: Add and commit changes
 
334
 
335
  - name: Push to Hugging Face
336
  run: |
337
+ git push https://$HF_USERNAME:[email protected]/spaces/$HF_USERNAME/$SPACE_NAME main --force
338
 
339
 
340
  tebakaja_crypto_space-3:
341
  name: crypto-forecast-svc-3
342
  runs-on: ubuntu-latest
343
  needs: preprocessing_training
344
+ environment: Deployment
345
 
346
  env:
347
  HF_TOKEN: ${{ secrets.HF_TOKEN }}
 
367
 
368
  - name: Pull changes from remote
369
  run: |
370
+ git pull https://$HF_USERNAME:[email protected]/spaces/$HF_USERNAME/$SPACE_NAME main || \
371
  (git merge --strategy-option theirs)
372
 
373
  - name: Add and commit changes
 
377
 
378
  - name: Push to Hugging Face
379
  run: |
380
+ git push https://$HF_USERNAME:[email protected]/spaces/$HF_USERNAME/$SPACE_NAME main --force
381
 
382
 
383
  tebakaja_crypto_space-4:
384
  name: crypto-forecast-svc-4
385
  runs-on: ubuntu-latest
386
  needs: preprocessing_training
387
+ environment: Deployment
388
 
389
  env:
390
  HF_TOKEN: ${{ secrets.HF_TOKEN }}
 
410
 
411
  - name: Pull changes from remote
412
  run: |
413
+ git pull https://$HF_USERNAME:[email protected]/spaces/$HF_USERNAME/$SPACE_NAME main || \
414
  (git merge --strategy-option theirs)
415
 
416
  - name: Add and commit changes
 
420
 
421
  - name: Push to Hugging Face
422
  run: |
423
+ git push https://$HF_USERNAME:[email protected]/spaces/$HF_USERNAME/$SPACE_NAME main --force
424
+
425
+
426
+ functional_testing:
427
+ name: Functional Testing
428
+ runs-on: ubuntu-latest
429
+
430
+ needs:
431
+ - tebakaja_crypto_space-0
432
+ - tebakaja_crypto_space-1
433
+ - tebakaja_crypto_space-2
434
+ - tebakaja_crypto_space-3
435
+ - tebakaja_crypto_space-4
436
+
437
+ steps:
438
+ - name: Set global directory
439
+ run: git config --global --add safe.directory /github/workspace
440
+
441
+ - uses: actions/checkout@v3
442
+ with:
443
+ persist-credentials: false
444
+ fetch-depth: 1
445
+
446
+ - name: Testing Proxy Endpoints
447
+ run: |
448
+ sleep 60
449
+ chmod +x endpoints_test.sh && ./endpoints_test.sh
450
+
.github/workflows/lstm_gru_pipeline.yaml CHANGED
@@ -3,7 +3,7 @@ name: LSTM GRU Pipeline
3
  on:
4
  push:
5
  branches:
6
- - production
7
  tags:
8
  - '*'
9
  schedule:
@@ -12,8 +12,9 @@ on:
12
 
13
  jobs:
14
  scraping_extracting:
15
- name: Scraping, and Extracting
16
  runs-on: ubuntu-latest
 
17
 
18
  steps:
19
  - name: Set global directory
@@ -66,6 +67,7 @@ jobs:
66
  overwrite: "true"
67
 
68
  - name: Upload Artifact (datasets)
 
69
  uses: actions/upload-artifact@v3
70
  with:
71
  name: datasets
@@ -79,9 +81,10 @@ jobs:
79
 
80
 
81
  preprocessing_training:
82
- name: Preprocessing, and Training
83
  runs-on: ubuntu-latest
84
  needs: scraping_extracting
 
85
 
86
  steps:
87
  - name: Set global directory
@@ -117,6 +120,7 @@ jobs:
117
  run: pip install -r requirements.txt
118
 
119
  - name: Download Artifact (datasets)
 
120
  uses: actions/download-artifact@v3
121
  with:
122
  name: datasets
@@ -201,14 +205,14 @@ jobs:
201
  uses: ad-m/github-push-action@master
202
  with:
203
  github_token: ${{ secrets.GH_TOKEN }}
204
- branch: production
205
 
206
 
207
  tebakaja_crypto_space-0:
208
  name: crypto-forecast-svc-0
209
  runs-on: ubuntu-latest
210
  needs: preprocessing_training
211
- environment: Production
212
 
213
  env:
214
  HF_TOKEN: ${{ secrets.HF_TOKEN }}
@@ -234,7 +238,7 @@ jobs:
234
 
235
  - name: Pull changes from remote
236
  run: |
237
- git pull https://$HF_USERNAME:[email protected]/spaces/$HF_USERNAME/$SPACE_NAME production || \
238
  (git merge --strategy-option theirs)
239
 
240
  - name: Add and commit changes
@@ -244,14 +248,14 @@ jobs:
244
 
245
  - name: Push to Hugging Face
246
  run: |
247
- git push https://$HF_USERNAME:[email protected]/spaces/$HF_USERNAME/$SPACE_NAME production --force
248
 
249
 
250
  tebakaja_crypto_space-1:
251
  name: crypto-forecast-svc-1
252
  runs-on: ubuntu-latest
253
  needs: preprocessing_training
254
- environment: Production
255
 
256
  env:
257
  HF_TOKEN: ${{ secrets.HF_TOKEN }}
@@ -277,7 +281,7 @@ jobs:
277
 
278
  - name: Pull changes from remote
279
  run: |
280
- git pull https://$HF_USERNAME:[email protected]/spaces/$HF_USERNAME/$SPACE_NAME production || \
281
  (git merge --strategy-option theirs)
282
 
283
  - name: Add and commit changes
@@ -287,14 +291,14 @@ jobs:
287
 
288
  - name: Push to Hugging Face
289
  run: |
290
- git push https://$HF_USERNAME:[email protected]/spaces/$HF_USERNAME/$SPACE_NAME production --force
291
 
292
 
293
  tebakaja_crypto_space-2:
294
  name: crypto-forecast-svc-2
295
  runs-on: ubuntu-latest
296
  needs: preprocessing_training
297
- environment: Production
298
 
299
  env:
300
  HF_TOKEN: ${{ secrets.HF_TOKEN }}
@@ -320,7 +324,7 @@ jobs:
320
 
321
  - name: Pull changes from remote
322
  run: |
323
- git pull https://$HF_USERNAME:[email protected]/spaces/$HF_USERNAME/$SPACE_NAME production || \
324
  (git merge --strategy-option theirs)
325
 
326
  - name: Add and commit changes
@@ -330,14 +334,14 @@ jobs:
330
 
331
  - name: Push to Hugging Face
332
  run: |
333
- git push https://$HF_USERNAME:[email protected]/spaces/$HF_USERNAME/$SPACE_NAME production --force
334
 
335
 
336
  tebakaja_crypto_space-3:
337
  name: crypto-forecast-svc-3
338
  runs-on: ubuntu-latest
339
  needs: preprocessing_training
340
- environment: Production
341
 
342
  env:
343
  HF_TOKEN: ${{ secrets.HF_TOKEN }}
@@ -363,7 +367,7 @@ jobs:
363
 
364
  - name: Pull changes from remote
365
  run: |
366
- git pull https://$HF_USERNAME:[email protected]/spaces/$HF_USERNAME/$SPACE_NAME production || \
367
  (git merge --strategy-option theirs)
368
 
369
  - name: Add and commit changes
@@ -373,14 +377,14 @@ jobs:
373
 
374
  - name: Push to Hugging Face
375
  run: |
376
- git push https://$HF_USERNAME:[email protected]/spaces/$HF_USERNAME/$SPACE_NAME production --force
377
 
378
 
379
  tebakaja_crypto_space-4:
380
  name: crypto-forecast-svc-4
381
  runs-on: ubuntu-latest
382
  needs: preprocessing_training
383
- environment: Production
384
 
385
  env:
386
  HF_TOKEN: ${{ secrets.HF_TOKEN }}
@@ -406,7 +410,7 @@ jobs:
406
 
407
  - name: Pull changes from remote
408
  run: |
409
- git pull https://$HF_USERNAME:[email protected]/spaces/$HF_USERNAME/$SPACE_NAME production || \
410
  (git merge --strategy-option theirs)
411
 
412
  - name: Add and commit changes
@@ -416,4 +420,31 @@ jobs:
416
 
417
  - name: Push to Hugging Face
418
  run: |
419
- git push https://$HF_USERNAME:[email protected]/spaces/$HF_USERNAME/$SPACE_NAME production --force
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  on:
4
  push:
5
  branches:
6
+ - main
7
  tags:
8
  - '*'
9
  schedule:
 
12
 
13
  jobs:
14
  scraping_extracting:
15
+ name: Scraping and Extracting
16
  runs-on: ubuntu-latest
17
+ environment: Scraping and Extraction
18
 
19
  steps:
20
  - name: Set global directory
 
67
  overwrite: "true"
68
 
69
  - name: Upload Artifact (datasets)
70
+ if: env.match != 'true'
71
  uses: actions/upload-artifact@v3
72
  with:
73
  name: datasets
 
81
 
82
 
83
  preprocessing_training:
84
+ name: Preprocessing and Training
85
  runs-on: ubuntu-latest
86
  needs: scraping_extracting
87
+ environment: Preprocessing and Training
88
 
89
  steps:
90
  - name: Set global directory
 
120
  run: pip install -r requirements.txt
121
 
122
  - name: Download Artifact (datasets)
123
+ if: env.match != 'true'
124
  uses: actions/download-artifact@v3
125
  with:
126
  name: datasets
 
205
  uses: ad-m/github-push-action@master
206
  with:
207
  github_token: ${{ secrets.GH_TOKEN }}
208
+ branch: main
209
 
210
 
211
  tebakaja_crypto_space-0:
212
  name: crypto-forecast-svc-0
213
  runs-on: ubuntu-latest
214
  needs: preprocessing_training
215
+ environment: Deployment
216
 
217
  env:
218
  HF_TOKEN: ${{ secrets.HF_TOKEN }}
 
238
 
239
  - name: Pull changes from remote
240
  run: |
241
+ git pull https://$HF_USERNAME:[email protected]/spaces/$HF_USERNAME/$SPACE_NAME main || \
242
  (git merge --strategy-option theirs)
243
 
244
  - name: Add and commit changes
 
248
 
249
  - name: Push to Hugging Face
250
  run: |
251
+ git push https://$HF_USERNAME:[email protected]/spaces/$HF_USERNAME/$SPACE_NAME main --force
252
 
253
 
254
  tebakaja_crypto_space-1:
255
  name: crypto-forecast-svc-1
256
  runs-on: ubuntu-latest
257
  needs: preprocessing_training
258
+ environment: Deployment
259
 
260
  env:
261
  HF_TOKEN: ${{ secrets.HF_TOKEN }}
 
281
 
282
  - name: Pull changes from remote
283
  run: |
284
+ git pull https://$HF_USERNAME:[email protected]/spaces/$HF_USERNAME/$SPACE_NAME main || \
285
  (git merge --strategy-option theirs)
286
 
287
  - name: Add and commit changes
 
291
 
292
  - name: Push to Hugging Face
293
  run: |
294
+ git push https://$HF_USERNAME:[email protected]/spaces/$HF_USERNAME/$SPACE_NAME main --force
295
 
296
 
297
  tebakaja_crypto_space-2:
298
  name: crypto-forecast-svc-2
299
  runs-on: ubuntu-latest
300
  needs: preprocessing_training
301
+ environment: Deployment
302
 
303
  env:
304
  HF_TOKEN: ${{ secrets.HF_TOKEN }}
 
324
 
325
  - name: Pull changes from remote
326
  run: |
327
+ git pull https://$HF_USERNAME:[email protected]/spaces/$HF_USERNAME/$SPACE_NAME main || \
328
  (git merge --strategy-option theirs)
329
 
330
  - name: Add and commit changes
 
334
 
335
  - name: Push to Hugging Face
336
  run: |
337
+ git push https://$HF_USERNAME:[email protected]/spaces/$HF_USERNAME/$SPACE_NAME main --force
338
 
339
 
340
  tebakaja_crypto_space-3:
341
  name: crypto-forecast-svc-3
342
  runs-on: ubuntu-latest
343
  needs: preprocessing_training
344
+ environment: Deployment
345
 
346
  env:
347
  HF_TOKEN: ${{ secrets.HF_TOKEN }}
 
367
 
368
  - name: Pull changes from remote
369
  run: |
370
+ git pull https://$HF_USERNAME:[email protected]/spaces/$HF_USERNAME/$SPACE_NAME main || \
371
  (git merge --strategy-option theirs)
372
 
373
  - name: Add and commit changes
 
377
 
378
  - name: Push to Hugging Face
379
  run: |
380
+ git push https://$HF_USERNAME:[email protected]/spaces/$HF_USERNAME/$SPACE_NAME main --force
381
 
382
 
383
  tebakaja_crypto_space-4:
384
  name: crypto-forecast-svc-4
385
  runs-on: ubuntu-latest
386
  needs: preprocessing_training
387
+ environment: Deployment
388
 
389
  env:
390
  HF_TOKEN: ${{ secrets.HF_TOKEN }}
 
410
 
411
  - name: Pull changes from remote
412
  run: |
413
+ git pull https://$HF_USERNAME:[email protected]/spaces/$HF_USERNAME/$SPACE_NAME main || \
414
  (git merge --strategy-option theirs)
415
 
416
  - name: Add and commit changes
 
420
 
421
  - name: Push to Hugging Face
422
  run: |
423
+ git push https://$HF_USERNAME:[email protected]/spaces/$HF_USERNAME/$SPACE_NAME main --force
424
+
425
+
426
+ functional_testing:
427
+ name: Functional Testing
428
+ runs-on: ubuntu-latest
429
+
430
+ needs:
431
+ - tebakaja_crypto_space-0
432
+ - tebakaja_crypto_space-1
433
+ - tebakaja_crypto_space-2
434
+ - tebakaja_crypto_space-3
435
+ - tebakaja_crypto_space-4
436
+
437
+ steps:
438
+ - name: Set global directory
439
+ run: git config --global --add safe.directory /github/workspace
440
+
441
+ - uses: actions/checkout@v3
442
+ with:
443
+ persist-credentials: false
444
+ fetch-depth: 1
445
+
446
+ - name: Testing Proxy Endpoints
447
+ run: |
448
+ sleep 60
449
+ chmod +x endpoints_test.sh && ./endpoints_test.sh
450
+
.github/workflows/lstm_pipeline.yaml CHANGED
@@ -3,7 +3,7 @@ name: LSTM Pipeline
3
  on:
4
  push:
5
  branches:
6
- - production
7
  tags:
8
  - '*'
9
  schedule:
@@ -12,8 +12,9 @@ on:
12
 
13
  jobs:
14
  scraping_extracting:
15
- name: Scraping, and Extracting
16
  runs-on: ubuntu-latest
 
17
 
18
  steps:
19
  - name: Set global directory
@@ -66,6 +67,7 @@ jobs:
66
  overwrite: "true"
67
 
68
  - name: Upload Artifact (datasets)
 
69
  uses: actions/upload-artifact@v3
70
  with:
71
  name: datasets
@@ -79,9 +81,10 @@ jobs:
79
 
80
 
81
  preprocessing_training:
82
- name: Preprocessing, and Training
83
  runs-on: ubuntu-latest
84
  needs: scraping_extracting
 
85
 
86
  steps:
87
  - name: Set global directory
@@ -117,6 +120,7 @@ jobs:
117
  run: pip install -r requirements.txt
118
 
119
  - name: Download Artifact (datasets)
 
120
  uses: actions/download-artifact@v3
121
  with:
122
  name: datasets
@@ -201,14 +205,14 @@ jobs:
201
  uses: ad-m/github-push-action@master
202
  with:
203
  github_token: ${{ secrets.GH_TOKEN }}
204
- branch: production
205
 
206
 
207
  tebakaja_crypto_space-0:
208
  name: crypto-forecast-svc-0
209
  runs-on: ubuntu-latest
210
  needs: preprocessing_training
211
- environment: Production
212
 
213
  env:
214
  HF_TOKEN: ${{ secrets.HF_TOKEN }}
@@ -234,7 +238,7 @@ jobs:
234
 
235
  - name: Pull changes from remote
236
  run: |
237
- git pull https://$HF_USERNAME:[email protected]/spaces/$HF_USERNAME/$SPACE_NAME production || \
238
  (git merge --strategy-option theirs)
239
 
240
  - name: Add and commit changes
@@ -244,14 +248,14 @@ jobs:
244
 
245
  - name: Push to Hugging Face
246
  run: |
247
- git push https://$HF_USERNAME:[email protected]/spaces/$HF_USERNAME/$SPACE_NAME production --force
248
 
249
 
250
  tebakaja_crypto_space-1:
251
  name: crypto-forecast-svc-1
252
  runs-on: ubuntu-latest
253
  needs: preprocessing_training
254
- environment: Production
255
 
256
  env:
257
  HF_TOKEN: ${{ secrets.HF_TOKEN }}
@@ -277,7 +281,7 @@ jobs:
277
 
278
  - name: Pull changes from remote
279
  run: |
280
- git pull https://$HF_USERNAME:[email protected]/spaces/$HF_USERNAME/$SPACE_NAME production || \
281
  (git merge --strategy-option theirs)
282
 
283
  - name: Add and commit changes
@@ -287,14 +291,14 @@ jobs:
287
 
288
  - name: Push to Hugging Face
289
  run: |
290
- git push https://$HF_USERNAME:[email protected]/spaces/$HF_USERNAME/$SPACE_NAME production --force
291
 
292
 
293
  tebakaja_crypto_space-2:
294
  name: crypto-forecast-svc-2
295
  runs-on: ubuntu-latest
296
  needs: preprocessing_training
297
- environment: Production
298
 
299
  env:
300
  HF_TOKEN: ${{ secrets.HF_TOKEN }}
@@ -320,7 +324,7 @@ jobs:
320
 
321
  - name: Pull changes from remote
322
  run: |
323
- git pull https://$HF_USERNAME:[email protected]/spaces/$HF_USERNAME/$SPACE_NAME production || \
324
  (git merge --strategy-option theirs)
325
 
326
  - name: Add and commit changes
@@ -330,14 +334,14 @@ jobs:
330
 
331
  - name: Push to Hugging Face
332
  run: |
333
- git push https://$HF_USERNAME:[email protected]/spaces/$HF_USERNAME/$SPACE_NAME production --force
334
 
335
 
336
  tebakaja_crypto_space-3:
337
  name: crypto-forecast-svc-3
338
  runs-on: ubuntu-latest
339
  needs: preprocessing_training
340
- environment: Production
341
 
342
  env:
343
  HF_TOKEN: ${{ secrets.HF_TOKEN }}
@@ -363,7 +367,7 @@ jobs:
363
 
364
  - name: Pull changes from remote
365
  run: |
366
- git pull https://$HF_USERNAME:[email protected]/spaces/$HF_USERNAME/$SPACE_NAME production || \
367
  (git merge --strategy-option theirs)
368
 
369
  - name: Add and commit changes
@@ -373,14 +377,14 @@ jobs:
373
 
374
  - name: Push to Hugging Face
375
  run: |
376
- git push https://$HF_USERNAME:[email protected]/spaces/$HF_USERNAME/$SPACE_NAME production --force
377
 
378
 
379
  tebakaja_crypto_space-4:
380
  name: crypto-forecast-svc-4
381
  runs-on: ubuntu-latest
382
  needs: preprocessing_training
383
- environment: Production
384
 
385
  env:
386
  HF_TOKEN: ${{ secrets.HF_TOKEN }}
@@ -406,7 +410,7 @@ jobs:
406
 
407
  - name: Pull changes from remote
408
  run: |
409
- git pull https://$HF_USERNAME:[email protected]/spaces/$HF_USERNAME/$SPACE_NAME production || \
410
  (git merge --strategy-option theirs)
411
 
412
  - name: Add and commit changes
@@ -416,4 +420,31 @@ jobs:
416
 
417
  - name: Push to Hugging Face
418
  run: |
419
- git push https://$HF_USERNAME:[email protected]/spaces/$HF_USERNAME/$SPACE_NAME production --force
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  on:
4
  push:
5
  branches:
6
+ - main
7
  tags:
8
  - '*'
9
  schedule:
 
12
 
13
  jobs:
14
  scraping_extracting:
15
+ name: Scraping and Extracting
16
  runs-on: ubuntu-latest
17
+ environment: Scraping and Extraction
18
 
19
  steps:
20
  - name: Set global directory
 
67
  overwrite: "true"
68
 
69
  - name: Upload Artifact (datasets)
70
+ if: env.match != 'true'
71
  uses: actions/upload-artifact@v3
72
  with:
73
  name: datasets
 
81
 
82
 
83
  preprocessing_training:
84
+ name: Preprocessing and Training
85
  runs-on: ubuntu-latest
86
  needs: scraping_extracting
87
+ environment: Preprocessing and Training
88
 
89
  steps:
90
  - name: Set global directory
 
120
  run: pip install -r requirements.txt
121
 
122
  - name: Download Artifact (datasets)
123
+ if: env.match != 'true'
124
  uses: actions/download-artifact@v3
125
  with:
126
  name: datasets
 
205
  uses: ad-m/github-push-action@master
206
  with:
207
  github_token: ${{ secrets.GH_TOKEN }}
208
+ branch: main
209
 
210
 
211
  tebakaja_crypto_space-0:
212
  name: crypto-forecast-svc-0
213
  runs-on: ubuntu-latest
214
  needs: preprocessing_training
215
+ environment: Deployment
216
 
217
  env:
218
  HF_TOKEN: ${{ secrets.HF_TOKEN }}
 
238
 
239
  - name: Pull changes from remote
240
  run: |
241
+ git pull https://$HF_USERNAME:[email protected]/spaces/$HF_USERNAME/$SPACE_NAME main || \
242
  (git merge --strategy-option theirs)
243
 
244
  - name: Add and commit changes
 
248
 
249
  - name: Push to Hugging Face
250
  run: |
251
+ git push https://$HF_USERNAME:[email protected]/spaces/$HF_USERNAME/$SPACE_NAME main --force
252
 
253
 
254
  tebakaja_crypto_space-1:
255
  name: crypto-forecast-svc-1
256
  runs-on: ubuntu-latest
257
  needs: preprocessing_training
258
+ environment: Deployment
259
 
260
  env:
261
  HF_TOKEN: ${{ secrets.HF_TOKEN }}
 
281
 
282
  - name: Pull changes from remote
283
  run: |
284
+ git pull https://$HF_USERNAME:[email protected]/spaces/$HF_USERNAME/$SPACE_NAME main || \
285
  (git merge --strategy-option theirs)
286
 
287
  - name: Add and commit changes
 
291
 
292
  - name: Push to Hugging Face
293
  run: |
294
+ git push https://$HF_USERNAME:[email protected]/spaces/$HF_USERNAME/$SPACE_NAME main --force
295
 
296
 
297
  tebakaja_crypto_space-2:
298
  name: crypto-forecast-svc-2
299
  runs-on: ubuntu-latest
300
  needs: preprocessing_training
301
+ environment: Deployment
302
 
303
  env:
304
  HF_TOKEN: ${{ secrets.HF_TOKEN }}
 
324
 
325
  - name: Pull changes from remote
326
  run: |
327
+ git pull https://$HF_USERNAME:[email protected]/spaces/$HF_USERNAME/$SPACE_NAME main || \
328
  (git merge --strategy-option theirs)
329
 
330
  - name: Add and commit changes
 
334
 
335
  - name: Push to Hugging Face
336
  run: |
337
+ git push https://$HF_USERNAME:[email protected]/spaces/$HF_USERNAME/$SPACE_NAME main --force
338
 
339
 
340
  tebakaja_crypto_space-3:
341
  name: crypto-forecast-svc-3
342
  runs-on: ubuntu-latest
343
  needs: preprocessing_training
344
+ environment: Deployment
345
 
346
  env:
347
  HF_TOKEN: ${{ secrets.HF_TOKEN }}
 
367
 
368
  - name: Pull changes from remote
369
  run: |
370
+ git pull https://$HF_USERNAME:[email protected]/spaces/$HF_USERNAME/$SPACE_NAME main || \
371
  (git merge --strategy-option theirs)
372
 
373
  - name: Add and commit changes
 
377
 
378
  - name: Push to Hugging Face
379
  run: |
380
+ git push https://$HF_USERNAME:[email protected]/spaces/$HF_USERNAME/$SPACE_NAME main --force
381
 
382
 
383
  tebakaja_crypto_space-4:
384
  name: crypto-forecast-svc-4
385
  runs-on: ubuntu-latest
386
  needs: preprocessing_training
387
+ environment: Deployment
388
 
389
  env:
390
  HF_TOKEN: ${{ secrets.HF_TOKEN }}
 
410
 
411
  - name: Pull changes from remote
412
  run: |
413
+ git pull https://$HF_USERNAME:[email protected]/spaces/$HF_USERNAME/$SPACE_NAME main || \
414
  (git merge --strategy-option theirs)
415
 
416
  - name: Add and commit changes
 
420
 
421
  - name: Push to Hugging Face
422
  run: |
423
+ git push https://$HF_USERNAME:[email protected]/spaces/$HF_USERNAME/$SPACE_NAME main --force
424
+
425
+
426
+ functional_testing:
427
+ name: Functional Testing
428
+ runs-on: ubuntu-latest
429
+
430
+ needs:
431
+ - tebakaja_crypto_space-0
432
+ - tebakaja_crypto_space-1
433
+ - tebakaja_crypto_space-2
434
+ - tebakaja_crypto_space-3
435
+ - tebakaja_crypto_space-4
436
+
437
+ steps:
438
+ - name: Set global directory
439
+ run: git config --global --add safe.directory /github/workspace
440
+
441
+ - uses: actions/checkout@v3
442
+ with:
443
+ persist-credentials: false
444
+ fetch-depth: 1
445
+
446
+ - name: Testing Proxy Endpoints
447
+ run: |
448
+ sleep 60
449
+ chmod +x endpoints_test.sh && ./endpoints_test.sh
450
+
Dockerfile CHANGED
@@ -12,7 +12,7 @@ WORKDIR /app
12
 
13
  # Install Requirements
14
  RUN apt-get update && \
15
- apt-get install -y gcc python3-dev gnupg curl
16
 
17
  COPY --chown=user ./requirements.txt requirements.txt
18
 
@@ -30,91 +30,116 @@ RUN cd /app/restful/cutils && \
30
 
31
 
32
  # Initialization Resources
33
- RUN mkdir /app/resources && \
34
- chmod 444 /app/resources
35
-
36
- RUN pip install gdown
37
 
38
 
39
  # Datasets Resources
 
 
 
40
  RUN --mount=type=secret,id=DATASETS_ID,mode=0444,required=true \
41
- gdown https://drive.google.com/uc?id=$(cat /run/secrets/DATASETS_ID) && \
42
- mv datasets.zip /app/resources/datasets.zip && unzip /app/resources/datasets.zip && \
 
 
43
  rm /app/resources/datasets.zip
44
 
 
 
45
 
46
  # Algorithms Resources
47
- RUN mkdir /app/resources/algorithms && \
48
- chmod 444 /app/resources/algorithms
49
 
50
 
51
  # GRU Algorithm Resources
52
- RUN mkdir /app/resources/algorithms/GRU && \
53
- chmod 444 /app/resources/algorithms/GRU
54
 
55
  RUN --mount=type=secret,id=GRU_MODELS_ID,mode=0444,required=true \
56
- gdown https://drive.google.com/uc?id=$(cat /run/secrets/GRU_MODELS_ID) && \
57
- mv models.zip /app/resources/algorithms/GRU/models.zip && \
58
- unzip /app/resources/algorithms/GRU/models.zip && \
 
 
59
  rm /app/resources/algorithms/GRU/models.zip
60
 
61
  RUN --mount=type=secret,id=GRU_PICKLES_ID,mode=0444,required=true \
62
- gdown https://drive.google.com/uc?id=$(cat /run/secrets/GRU_PICKLES_ID) && \
63
- mv pickles.zip /app/resources/algorithms/GRU/pickles.zip && \
64
- unzip /app/resources/algorithms/GRU/pickles.zip && \
 
 
65
  rm /app/resources/algorithms/GRU/pickles.zip
66
 
67
  RUN --mount=type=secret,id=GRU_POSTTRAINED_ID,mode=0444,required=true \
68
- gdown https://drive.google.com/uc?id=$(cat /run/secrets/GRU_POSTTRAINED_ID) && \
69
- mv posttrained.zip /app/resources/algorithms/GRU/posttrained.zip && \
70
- unzip /app/resources/algorithms/GRU/posttrained.zip && \
 
 
71
  rm /app/resources/algorithms/GRU/posttrained.zip
72
 
73
 
74
  # LSTM Algorithm Resources
75
- RUN mkdir /app/resources/algorithms/LSTM && \
76
- chmod 444 /app/resources/algorithms/LSTM
77
 
78
  RUN --mount=type=secret,id=LSTM_MODELS_ID,mode=0444,required=true \
79
- gdown https://drive.google.com/uc?id=$(cat /run/secrets/LSTM_MODELS_ID) && \
80
- mv models.zip /app/resources/algorithms/LSTM/models.zip && \
81
- unzip /app/resources/algorithms/LSTM/models.zip && \
 
 
82
  rm /app/resources/algorithms/LSTM/models.zip
83
 
84
  RUN --mount=type=secret,id=LSTM_PICKLES_ID,mode=0444,required=true \
85
- gdown https://drive.google.com/uc?id=$(cat /run/secrets/LSTM_PICKLES_ID) && \
86
- mv pickles.zip /app/resources/algorithms/LSTM/pickles.zip && \
87
- unzip /app/resources/algorithms/LSTM/pickles.zip && \
 
 
88
  rm /app/resources/algorithms/LSTM/pickles.zip
89
 
90
  RUN --mount=type=secret,id=LSTM_POSTTRAINED_ID,mode=0444,required=true \
91
- gdown https://drive.google.com/uc?id=$(cat /run/secrets/LSTM_POSTTRAINED_ID) && \
92
- mv posttrained.zip /app/resources/algorithms/LSTM/posttrained.zip && \
93
- unzip /app/resources/algorithms/LSTM/posttrained.zip && \
 
 
94
  rm /app/resources/algorithms/LSTM/posttrained.zip
95
 
96
 
97
  # LSTM_GRU Algorithm Resources
98
- RUN mkdir /app/resources/algorithms/LSTM_GRU && \
99
- chmod 444 /app/resources/algorithms/LSTM_GRU
100
 
101
  RUN --mount=type=secret,id=LSTM_GRU_MODELS_ID,mode=0444,required=true \
102
- gdown https://drive.google.com/uc?id=$(cat /run/secrets/LSTM_GRU_MODELS_ID) && \
103
- mv models.zip /app/resources/algorithms/LSTM_GRU/models.zip && \
104
- unzip /app/resources/algorithms/LSTM_GRU/models.zip && \
 
 
105
  rm /app/resources/algorithms/LSTM_GRU/models.zip
106
 
107
  RUN --mount=type=secret,id=LSTM_GRU_PICKLES_ID,mode=0444,required=true \
108
- gdown https://drive.google.com/uc?id=$(cat /run/secrets/LSTM_GRU_PICKLES_ID) && \
109
- mv pickles.zip /app/resources/algorithms/LSTM_GRU/pickles.zip && \
110
- unzip /app/resources/algorithms/LSTM_GRU/pickles.zip && \
 
 
111
  rm /app/resources/algorithms/LSTM_GRU/pickles.zip
112
 
113
  RUN --mount=type=secret,id=LSTM_GRU_POSTTRAINED_ID,mode=0444,required=true \
114
- gdown https://drive.google.com/uc?id=$(cat /run/secrets/LSTM_GRU_POSTTRAINED_ID) && \
115
- mv posttrained.zip /app/resources/algorithms/LSTM_GRU/posttrained.zip && \
116
- unzip /app/resources/algorithms/LSTM_GRU/posttrained.zip && \
 
 
117
  rm /app/resources/algorithms/LSTM_GRU/posttrained.zip
118
 
119
 
120
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--workers", "50", "--port", "7860"]
 
 
 
12
 
13
  # Install Requirements
14
  RUN apt-get update && \
15
+ apt-get install -y gcc python3-dev gnupg curl wget
16
 
17
  COPY --chown=user ./requirements.txt requirements.txt
18
 
 
30
 
31
 
32
  # Initialization Resources
33
+ RUN mkdir -p /app/resources && \
34
+ chmod 755 /app/resources
 
 
35
 
36
 
37
  # Datasets Resources
38
+ RUN mkdir -p /app/resources/ && \
39
+ chmod 755 /app/resources/
40
+
41
  RUN --mount=type=secret,id=DATASETS_ID,mode=0444,required=true \
42
+ wget -q --show-progress --progress=bar:force \
43
+ https://drive.google.com/uc?id=$(cat /run/secrets/DATASETS_ID) \
44
+ -O /app/resources/datasets.zip && \
45
+ unzip -o /app/resources/datasets.zip -d /app/resources/ && \
46
  rm /app/resources/datasets.zip
47
 
48
+ RUN ls /app/resources/datasets
49
+
50
 
51
  # Algorithms Resources
52
+ RUN mkdir -p /app/resources/algorithms && \
53
+ chmod 755 /app/resources/algorithms
54
 
55
 
56
  # GRU Algorithm Resources
57
+ RUN mkdir -p /app/resources/algorithms/GRU && \
58
+ chmod 755 /app/resources/algorithms/GRU
59
 
60
  RUN --mount=type=secret,id=GRU_MODELS_ID,mode=0444,required=true \
61
+ wget -q --show-progress --progress=bar:force \
62
+ https://drive.google.com/uc?id=$(cat /run/secrets/GRU_MODELS_ID) \
63
+ -O /app/resources/algorithms/GRU/models.zip && \
64
+ unzip -o /app/resources/algorithms/GRU/models.zip \
65
+ -d /app/resources/algorithms/GRU && \
66
  rm /app/resources/algorithms/GRU/models.zip
67
 
68
  RUN --mount=type=secret,id=GRU_PICKLES_ID,mode=0444,required=true \
69
+ wget -q --show-progress --progress=bar:force \
70
+ https://drive.google.com/uc?id=$(cat /run/secrets/GRU_PICKLES_ID) \
71
+ -O /app/resources/algorithms/GRU/pickles.zip && \
72
+ unzip -o /app/resources/algorithms/GRU/pickles.zip \
73
+ -d /app/resources/algorithms/GRU && \
74
  rm /app/resources/algorithms/GRU/pickles.zip
75
 
76
  RUN --mount=type=secret,id=GRU_POSTTRAINED_ID,mode=0444,required=true \
77
+ wget -q --show-progress --progress=bar:force \
78
+ https://drive.google.com/uc?id=$(cat /run/secrets/GRU_POSTTRAINED_ID) \
79
+ -O /app/resources/algorithms/GRU/posttrained.zip && \
80
+ unzip -o /app/resources/algorithms/GRU/posttrained.zip \
81
+ -d /app/resources/algorithms/GRU && \
82
  rm /app/resources/algorithms/GRU/posttrained.zip
83
 
84
 
85
  # LSTM Algorithm Resources
86
+ RUN mkdir -p /app/resources/algorithms/LSTM && \
87
+ chmod 755 /app/resources/algorithms/LSTM
88
 
89
  RUN --mount=type=secret,id=LSTM_MODELS_ID,mode=0444,required=true \
90
+ wget -q --show-progress --progress=bar:force \
91
+ https://drive.google.com/uc?id=$(cat /run/secrets/LSTM_MODELS_ID) \
92
+ -O /app/resources/algorithms/LSTM/models.zip && \
93
+ unzip -o /app/resources/algorithms/LSTM/models.zip \
94
+ -d /app/resources/algorithms/LSTM && \
95
  rm /app/resources/algorithms/LSTM/models.zip
96
 
97
  RUN --mount=type=secret,id=LSTM_PICKLES_ID,mode=0444,required=true \
98
+ wget -q --show-progress --progress=bar:force \
99
+ https://drive.google.com/uc?id=$(cat /run/secrets/LSTM_PICKLES_ID) \
100
+ -O /app/resources/algorithms/LSTM/pickles.zip && \
101
+ unzip -o /app/resources/algorithms/LSTM/pickles.zip \
102
+ -d /app/resources/algorithms/LSTM && \
103
  rm /app/resources/algorithms/LSTM/pickles.zip
104
 
105
  RUN --mount=type=secret,id=LSTM_POSTTRAINED_ID,mode=0444,required=true \
106
+ wget -q --show-progress --progress=bar:force \
107
+ https://drive.google.com/uc?id=$(cat /run/secrets/LSTM_POSTTRAINED_ID) \
108
+ -O /app/resources/algorithms/LSTM/posttrained.zip && \
109
+ unzip -o /app/resources/algorithms/LSTM/posttrained.zip \
110
+ -d /app/resources/algorithms/LSTM && \
111
  rm /app/resources/algorithms/LSTM/posttrained.zip
112
 
113
 
114
  # LSTM_GRU Algorithm Resources
115
+ RUN mkdir -p /app/resources/algorithms/LSTM_GRU && \
116
+ chmod 755 /app/resources/algorithms/LSTM_GRU
117
 
118
  RUN --mount=type=secret,id=LSTM_GRU_MODELS_ID,mode=0444,required=true \
119
+ wget -q --show-progress --progress=bar:force \
120
+ https://drive.google.com/uc?id=$(cat /run/secrets/LSTM_GRU_MODELS_ID) \
121
+ -O /app/resources/algorithms/LSTM_GRU/models.zip && \
122
+ unzip -o /app/resources/algorithms/LSTM_GRU/models.zip \
123
+ -d /app/resources/algorithms/LSTM_GRU && \
124
  rm /app/resources/algorithms/LSTM_GRU/models.zip
125
 
126
  RUN --mount=type=secret,id=LSTM_GRU_PICKLES_ID,mode=0444,required=true \
127
+ wget -q --show-progress --progress=bar:force \
128
+ https://drive.google.com/uc?id=$(cat /run/secrets/LSTM_GRU_PICKLES_ID) \
129
+ -O /app/resources/algorithms/LSTM_GRU/pickles.zip && \
130
+ unzip -o /app/resources/algorithms/LSTM_GRU/pickles.zip \
131
+ -d /app/resources/algorithms/LSTM_GRU && \
132
  rm /app/resources/algorithms/LSTM_GRU/pickles.zip
133
 
134
  RUN --mount=type=secret,id=LSTM_GRU_POSTTRAINED_ID,mode=0444,required=true \
135
+ wget -q --show-progress --progress=bar:force \
136
+ https://drive.google.com/uc?id=$(cat /run/secrets/LSTM_GRU_POSTTRAINED_ID) \
137
+ -O /app/resources/algorithms/LSTM_GRU/posttrained.zip && \
138
+ unzip -o /app/resources/algorithms/LSTM_GRU/posttrained.zip \
139
+ -d /app/resources/algorithms/LSTM_GRU && \
140
  rm /app/resources/algorithms/LSTM_GRU/posttrained.zip
141
 
142
 
143
+
144
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--workers", "30", "--port", "7860"]
145
+
endpoints_test.sh ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+ PROD_ENDPOINT_0="https://qywok-tebakaja-proxy-space-0.hf.space"
3
+ PROD_ENDPOINT_1="https://qywok-tebakaja-proxy-space-1.hf.space"
4
+ PROD_ENDPOINT_2="https://qywok-tebakaja-proxy-space-2.hf.space"
5
+ PROD_ENDPOINT_3="https://qywok-tebakaja-proxy-space-3.hf.space"
6
+ PROD_ENDPOINT_4="https://qywok-tebakaja-proxy-space-4.hf.space"
7
+
8
+
9
+ check_status() {
10
+ if [ $1 -eq 200 ]; then
11
+ echo "[ Success ] $2 (latency: $3 ms)"
12
+ else
13
+ echo "[ Failed ] $2 (HTTP status: $1)"
14
+ fi
15
+ }
16
+
17
+
18
+ make_get_request() {
19
+ START_TIME=$(date +%s%3N)
20
+ RESPONSE=$(curl -s -o /dev/null -w "%{http_code}" -X GET $1)
21
+ END_TIME=$(date +%s%3N)
22
+ DURATION=$((END_TIME - START_TIME))
23
+ check_status $RESPONSE $2 $DURATION
24
+ }
25
+
26
+
27
+ make_post_request() {
28
+ START_TIME=$(date +%s%3N)
29
+ RESPONSE=$(curl -s -o /dev/null -w "%{http_code}" -X POST $1 \
30
+ -H "Content-Type: application/json" \
31
+ -d "$2")
32
+ END_TIME=$(date +%s%3N)
33
+ DURATION=$((END_TIME - START_TIME))
34
+ check_status $RESPONSE $3 $DURATION
35
+ }
36
+
37
+
38
+ echo "-------- [ Proxy 0 ] --------"
39
+ make_get_request "$PROD_ENDPOINT_0/stock/lists" "stock-list-prod-0"
40
+ make_post_request "$PROD_ENDPOINT_0/stock/prediction" "{\"days\": 7, \"currency\": \"BTC-USD\"}" "stock-prediction-prod-0"
41
+ make_get_request "$PROD_ENDPOINT_0/crypto/lists" "crypto-list-prod-0"
42
+ make_post_request "$PROD_ENDPOINT_0/crypto/prediction" "{\"days\": 7, \"currency\": \"BTC-USD\"}" "crypto-prediction-prod-0"
43
+ make_get_request "$PROD_ENDPOINT_0/national-currency/lists" "natcurr-list-prod-0"
44
+ make_post_request "$PROD_ENDPOINT_0/national-currency/prediction" "{\"days\": 7, \"currency\": \"BTC-USD\"}" "natcurr-prediction-prod-0"
45
+ echo " "
46
+
47
+
48
+ echo "-------- [ Proxy 1 ] --------"
49
+ make_get_request "$PROD_ENDPOINT_1/stock/lists" "stock-list-prod-1"
50
+ make_post_request "$PROD_ENDPOINT_1/stock/prediction" "{\"days\": 7, \"currency\": \"BTC-USD\"}" "stock-prediction-prod-1"
51
+ make_get_request "$PROD_ENDPOINT_1/crypto/lists" "crypto-list-prod-1"
52
+ make_post_request "$PROD_ENDPOINT_1/crypto/prediction" "{\"days\": 7, \"currency\": \"BTC-USD\"}" "crypto-prediction-prod-1"
53
+ make_get_request "$PROD_ENDPOINT_1/national-currency/lists" "natcurr-list-prod-1"
54
+ make_post_request "$PROD_ENDPOINT_1/national-currency/prediction" "{\"days\": 7, \"currency\": \"BTC-USD\"}" "natcurr-prediction-prod-1"
55
+ echo " "
56
+
57
+
58
+ echo "-------- [ Proxy 2 ] --------"
59
+ make_get_request "$PROD_ENDPOINT_2/stock/lists" "stock-list-prod-2"
60
+ make_post_request "$PROD_ENDPOINT_2/stock/prediction" "{\"days\": 7, \"currency\": \"BTC-USD\"}" "stock-prediction-prod-2"
61
+ make_get_request "$PROD_ENDPOINT_2/crypto/lists" "crypto-list-prod-2"
62
+ make_post_request "$PROD_ENDPOINT_2/crypto/prediction" "{\"days\": 7, \"currency\": \"BTC-USD\"}" "crypto-prediction-prod-2"
63
+ make_get_request "$PROD_ENDPOINT_2/national-currency/lists" "natcurr-list-prod-2"
64
+ make_post_request "$PROD_ENDPOINT_2/national-currency/prediction" "{\"days\": 7, \"currency\": \"BTC-USD\"}" "natcurr-prediction-prod-2"
65
+ echo " "
66
+
67
+
68
+ echo "-------- [ Proxy 3 ] --------"
69
+ make_get_request "$PROD_ENDPOINT_3/stock/lists" "stock-list-prod-3"
70
+ make_post_request "$PROD_ENDPOINT_3/stock/prediction" "{\"days\": 7, \"currency\": \"BTC-USD\"}" "stock-prediction-prod-3"
71
+ make_get_request "$PROD_ENDPOINT_3/crypto/lists" "crypto-list-prod-3"
72
+ make_post_request "$PROD_ENDPOINT_3/crypto/prediction" "{\"days\": 7, \"currency\": \"BTC-USD\"}" "crypto-prediction-prod-3"
73
+ make_get_request "$PROD_ENDPOINT_3/national-currency/lists" "natcurr-list-prod-3"
74
+ make_post_request "$PROD_ENDPOINT_3/national-currency/prediction" "{\"days\": 7, \"currency\": \"BTC-USD\"}" "natcurr-prediction-prod-3"
75
+ echo " "
76
+
77
+
78
+ echo "-------- [ Proxy 4 ] --------"
79
+ make_get_request "$PROD_ENDPOINT_4/stock/lists" "stock-list-prod-4"
80
+ make_post_request "$PROD_ENDPOINT_4/stock/prediction" "{\"days\": 7, \"currency\": \"BTC-USD\"}" "stock-prediction-prod-4"
81
+ make_get_request "$PROD_ENDPOINT_4/crypto/lists" "crypto-list-prod-4"
82
+ make_post_request "$PROD_ENDPOINT_4/crypto/prediction" "{\"days\": 7, \"currency\": \"BTC-USD\"}" "crypto-prediction-prod-4"
83
+ make_get_request "$PROD_ENDPOINT_4/national-currency/lists" "natcurr-list-prod-4"
84
+ make_post_request "$PROD_ENDPOINT_4/national-currency/prediction" "{\"days\": 7, \"currency\": \"BTC-USD\"}" "natcurr-prediction-prod-4"
85
+ echo " "
restful/controllers.py CHANGED
@@ -44,7 +44,7 @@ class ForecastingControllers:
44
  """
45
  async def currencies_controller(self) -> JSONResponse:
46
  try:
47
- path: str = './resources/datasets'
48
  datasets: list = sorted(
49
  [
50
  item.replace(".csv", "") for item in os.listdir(path)
@@ -79,7 +79,7 @@ class ForecastingControllers:
79
  """
80
  async def forecasting_controller(self, payload: ForecastingServiceSchema) -> JSONResponse:
81
  try:
82
- path: str = './resources/datasets'
83
  datasets: list = sorted(
84
  [
85
  item.replace(".csv", "") for item in os.listdir(path)
 
44
  """
45
  async def currencies_controller(self) -> JSONResponse:
46
  try:
47
+ path: str = 'resources/datasets'
48
  datasets: list = sorted(
49
  [
50
  item.replace(".csv", "") for item in os.listdir(path)
 
79
  """
80
  async def forecasting_controller(self, payload: ForecastingServiceSchema) -> JSONResponse:
81
  try:
82
+ path: str = 'resources/datasets'
83
  datasets: list = sorted(
84
  [
85
  item.replace(".csv", "") for item in os.listdir(path)
schedulers/lstm_gru_schedule.ctl CHANGED
@@ -1 +1 @@
1
- 2024-07-28
 
1
+ 2024-08-04
schedulers/lstm_schedule.ctl CHANGED
@@ -1 +1 @@
1
- 2024-07-28
 
1
+ 2024-08-04