First step towards auto-extracting client
client.py will pull from github, as requested by the server client.py will extract and put all files locally ( except replacing itself ? ) Moved cutechess directly into the Client folder to it gets pulled. May need to chmod +x the cutechess-ob for Linux on demand. In the future, the cleanup script will delete everythinge except: client.py, and any credentials.* files. Such that one can run an openbench client in any directory, from a single file.
This commit is contained in:
1 parent
91ea350f1d
commit
4ec9d5b529
8 files changed
+1482
-1401
No files matched your search
+5
-1
@@ -10,4 +10,8 @@ Scripts/Binaries/*
|
||||
Scripts/Networks/*
|
||||
Scripts/Repositories/*
|
||||
|
||||
Media/*
|
||||
Media/*
|
||||
|
||||
!Client/*.py
|
||||
!Client/cutechess-ob
|
||||
!Client/cutechess-ob.exe
|
||||
+60
-1390
File diff suppressed because it is too large.
Load diff
File renamed without changes.
File renamed without changes.
+1404
File diff suppressed because it is too large.
Load diff
+1
-1
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"client_version" : 18,
|
||||
"client_repo_url" : "https://github.com/AndyGrant/OpenBench",
|
||||
"client_repo_ref" : "master",
|
||||
"client_repo_ref" : "config",
|
||||
|
||||
"use_cross_approval" : false,
|
||||
"require_login_to_view" : true,
|
||||
|
||||
+1
-1
@@ -69,7 +69,7 @@ urlpatterns = [
|
||||
django.urls.path(r'scripts/', OpenBench.views.scripts),
|
||||
|
||||
# Links for the Client to work with the Server
|
||||
django.urls.path(r'clientGetFiles/', OpenBench.views.client_get_files),
|
||||
django.urls.path(r'clientVersionRef/', OpenBench.views.client_version_ref),
|
||||
django.urls.path(r'clientGetBuildInfo/', OpenBench.views.client_get_build_info),
|
||||
django.urls.path(r'clientWorkerInfo/', OpenBench.views.client_worker_info),
|
||||
django.urls.path(r'clientGetWorkload/', OpenBench.views.client_get_workload),
|
||||
|
||||
+11
-8
@@ -589,16 +589,19 @@ def verify_worker(function):
|
||||
return wrapped_verify_worker
|
||||
|
||||
@csrf_exempt
|
||||
def client_get_files(request):
|
||||
def client_version_ref(request):
|
||||
|
||||
## Location of static compile of Cutechess for Windows and Linux.
|
||||
## OpenBench does not serve these files, but points to a repo ideally.
|
||||
# Verify the User's credentials
|
||||
try: user = authenticate(request, True)
|
||||
except UnableToAuthenticate:
|
||||
return JsonResponse({ 'error' : 'Bad Credentials' })
|
||||
|
||||
repo = '%s/%s' % (OPENBENCH_CONFIG['client_repo_url'], OPENBENCH_CONFIG['client_repo_ref'])
|
||||
repo = repo.replace('/github.com/', '/raw.githubusercontent.com/')
|
||||
repo = OpenBench.utils.path_join(repo, 'CoreFiles')
|
||||
|
||||
return JsonResponse({ 'location' : repo })
|
||||
# Enough information to download the right Client
|
||||
return JsonResponse({
|
||||
'client_version' : OPENBENCH_CONFIG['client_version' ],
|
||||
'client_repo_url' : OPENBENCH_CONFIG['client_repo_url'],
|
||||
'client_repo_ref' : OPENBENCH_CONFIG['client_repo_ref'],
|
||||
})
|
||||
|
||||
@csrf_exempt
|
||||
def client_get_build_info(request):
|
||||
|
||||
Reference in new issue
Block a user