Skip to content

Commit 62aae5f

Browse files
authored
Merge pull request #6 from pacslab/pull_request
Pull request - Added initial doc files and async functionality for jobs
2 parents af64213 + 012f000 commit 62aae5f

File tree

21 files changed

+326
-27
lines changed

21 files changed

+326
-27
lines changed

BlockchainNetwork/setup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ sudo systemctl enable docker
2020

2121
# install docker compose
2222
echo "Installing docker compose"
23-
sudo curl -L "https://github.com/docker/compose/releases/download/1.25.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
23+
sudo curl -L "https://github.com/docker/compose/releases/download/1.26.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
2424
sudo chmod +x /usr/local/bin/docker-compose
2525

2626
echo "You need to log out and log back in after these installations. If you are running on a VM you may need to restart your VM"

ComputeProvider/HFRequests.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ def initialize_network():
206206
monitoringChaincode = 'monitoring'
207207
monitoringPath= "./artifacts/src/monitoring"
208208
chaincodeLang = "node"
209-
user_list = ['sghaemi', 'admin', 'controller', 'provider_test', 'provider_test2', 'provider_test3']
209+
user_list = ['sghaemi', 'admin', 'controller', 'cc_provider1', 'cc_provider2', 'cc_provider3', 'cc_provider4']
210210

211211
token1 = register_user('temp', 'Org1')
212212
token2 = register_user('temp', 'Org2')
@@ -223,7 +223,7 @@ def initialize_network():
223223
instantiate_chaincode(token2, 'org2', channelName, monitoringChaincode, chaincodeLang)
224224

225225
for user in user_list:
226-
invoke_balance_transfer_new_user(token1, channelName, monetaryChaincode, 'org1', user, "600")
226+
invoke_balance_transfer_new_user(token1, channelName, monetaryChaincode, 'org1', user, "700")
227227

228228
return token1, token2
229229

@@ -245,13 +245,13 @@ def initialize_network():
245245

246246

247247

248-
token_org1, token_org2 = initialize_network()
248+
# token_org1, token_org2 = initialize_network()
249249
if org == "Org1":
250250
token = token_org1
251251
elif org == "Org2":
252252
token = token_org2
253253

254-
# token = register_user(username, org)
254+
token = register_user(username, org)
255255
# print(get_logs(token))
256256
# invoke_balance_transfer_new_user(token, channelName, "monetary", 'org1', 'controller', "600")
257257
# create_channel(token, channelName)
@@ -267,11 +267,14 @@ def initialize_network():
267267
# query_job(token, channelName, chaincodeName, orgLower, "100")
268268
# invoke_balance_transfer_from_fabcar(token, channelName, chaincodeName, orgLower)
269269
# invoke_balance_transfer(token, channelName, chaincodeName, orgLower)
270-
# query_account(token, channelName, 'monetary', orgLower, 'controller')
271-
# query_account(token, channelName, "monetary", orgLower, 'admin')
270+
# query_account(token, channelName, 'monetary', orgLower, 'developer_test')
271+
# query_account(token, channelName, "monetary", orgLower, 'cc_provider1')
272+
# query_account(token, channelName, "monetary", orgLower, 'cc_provider2')
273+
# query_account(token, channelName, "monetary", orgLower, 'cc_provider3')
274+
# query_account(token, channelName, "monetary", orgLower, 'cc_provider4')
272275
# invoke_balance_transfer_new_user(token, channelName, "monetary", orgLower, "controller", "600")
273276
# invoke_balance_transfer_new_user(token, channelName, "monetary", orgLower, "admin", "600")
274-
# invoke_balance_transfer_new_user(token, channelName, "monetary", orgLower, "sghaemi", "600")
277+
# invoke_balance_transfer_new_user(token, channelName, "monetary", orgLower, "sara_test", "600")
275278

276279

277280
# get_installed_chaincodes(token, orgLower)

ComputeProvider/provider.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@
1313

1414
ready_response_text = 'Done!'
1515
controller = 'chainfaas.com'
16-
# controller = 'http://localhost'
16+
# controller = 'chainfaas.sara-dev.com'
17+
# controller_temp = 'chainfaas.sara-dev.com'
18+
# controller = 'localhost'
19+
# controller_temp = 'localhost:8080'
1720
# controller_short = '127.0.0.1'
1821

1922
username = sys.argv[1]

Docs/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Sphinx documentation
2+
_build/

Docs/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?=
7+
SPHINXBUILD ?= sphinx-build
8+
SOURCEDIR = .
9+
BUILDDIR = _build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

Docs/conf.py

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# Configuration file for the Sphinx documentation builder.
2+
#
3+
# This file only contains a selection of the most common options. For a full
4+
# list see the documentation:
5+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
6+
7+
# -- Path setup --------------------------------------------------------------
8+
9+
# If extensions (or modules to document with autodoc) are in another directory,
10+
# add these directories to sys.path here. If the directory is relative to the
11+
# documentation root, use os.path.abspath to make it absolute, like shown here.
12+
#
13+
import os
14+
import sys
15+
sys.path.insert(0, os.path.abspath('.'))
16+
17+
# add markdown support
18+
import recommonmark
19+
from recommonmark.transform import AutoStructify
20+
21+
22+
# -- Project information -----------------------------------------------------
23+
24+
project = 'ChainFaaS: An Open Blockchain-based Serverless Platform'
25+
copyright = '2020, PACS Lab'
26+
author = 'Sara Ghaemi'
27+
28+
# The short X.Y version.
29+
version = "1.0"
30+
# The full version, including alpha/beta/rc tags
31+
release = "1.0.0-alpha"
32+
33+
github_doc_root = 'https://github.com/pacslab/ChainFaaS/tree/master/docs/'
34+
35+
36+
# -- General configuration ---------------------------------------------------
37+
38+
# Add any Sphinx extension module names here, as strings. They can be
39+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
40+
# ones.
41+
extensions = [
42+
'recommonmark',
43+
'sphinx_rtd_theme',
44+
]
45+
46+
# Add any paths that contain templates here, relative to this directory.
47+
templates_path = ['_templates']
48+
49+
# List of patterns, relative to source directory, that match files and
50+
# directories to ignore when looking for source files.
51+
# This pattern also affects html_static_path and html_extra_path.
52+
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
53+
54+
55+
# -- Options for HTML output -------------------------------------------------
56+
57+
# The theme to use for HTML and HTML Help pages. See the documentation for
58+
# a list of builtin themes.
59+
#
60+
# html_theme = 'alabaster'
61+
html_theme = 'sphinx_rtd_theme'
62+
63+
# Add any paths that contain custom static files (such as style sheets) here,
64+
# relative to this directory. They are copied after the builtin static files,
65+
# so a file named "default.css" will overwrite the builtin "default.css".
66+
html_static_path = ['_static']
67+
68+
69+
# app setup hook
70+
def setup(app):
71+
app.add_config_value('recommonmark_config', {
72+
#'url_resolver': lambda url: github_doc_root + url,
73+
'auto_toc_tree_section': 'Contents',
74+
'enable_math': False,
75+
'enable_inline_math': False,
76+
'enable_eval_rst': True,
77+
'enable_auto_doc_ref': True,
78+
}, True)
79+
app.add_transform(AutoStructify)

Docs/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Welcome to ChainFaaS Docs!

Docs/make.bat

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
@ECHO OFF
2+
3+
pushd %~dp0
4+
5+
REM Command file for Sphinx documentation
6+
7+
if "%SPHINXBUILD%" == "" (
8+
set SPHINXBUILD=sphinx-build
9+
)
10+
set SOURCEDIR=.
11+
set BUILDDIR=_build
12+
13+
if "%1" == "" goto help
14+
15+
%SPHINXBUILD% >NUL 2>NUL
16+
if errorlevel 9009 (
17+
echo.
18+
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
19+
echo.installed, then set the SPHINXBUILD environment variable to point
20+
echo.to the full path of the 'sphinx-build' executable. Alternatively you
21+
echo.may add the Sphinx directory to PATH.
22+
echo.
23+
echo.If you don't have Sphinx installed, grab it from
24+
echo.http://sphinx-doc.org/
25+
exit /b 1
26+
)
27+
28+
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
29+
goto end
30+
31+
:help
32+
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
33+
34+
:end
35+
popd

Docs/requirements.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
sphinx==3.1.1
3+
recommonmark==0.6.0
4+
sphinx-rtd-theme==0.5.0

ServerlessController/controller_app/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from MSc_Research_Django.settings import TIME_ZONE, USE_FABRIC
1212

1313

14-
def request_handler(request, service, start_time):
14+
def request_handler(request, service, start_time, run_async=False):
1515
"""
1616
Gets the request and the corresponding service and returns the response and the corresponding provider
1717
:param request:

0 commit comments

Comments
 (0)