Skip to content

Commit 0b33fa4

Browse files
committed
Added support for running simultaneous independent microservices.
This involved: - configurable socket names (via launch, webserver, and host) - unique logs - unique killme scripts - independent out and live directories
1 parent 49403ca commit 0b33fa4

File tree

9 files changed

+127
-60
lines changed

9 files changed

+127
-60
lines changed

Diff for: .gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
**/webserver/*.pyc
33
**/webserver/ec2_time_bombs/
44
**/apps/*/live/
5-
**/apps/*/build/webserver.log
5+
**/apps/*/build/log/
66
apps/mandelbrot/build/video
77
apps/mandelbrot/build/cast
88
**.tfstate

Diff for: doc/GettingStarted.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ make copy_app APP_NAME=toy
9292

9393
### Web Client Application
9494

95-
The web client is defined by the HTML, CSS, and JS content in `<repo>/apps/toy/client/`. In this case `<repo>/apps/toy/client/html/index.html` simply links to `<repo>/framework/client/html/testbench.html` to utilize the default test bench provided by the framework that you accessed for `vadd`. If you would like to modify the web client code, you can copy `<repo>/framework/client/*/testbench.*` into `<repo>/apps/toy/client` as a simple starting point. To develop a real application, you may have your own thoughts about the framework you would like to use. You can use what you like. Develop in a separate repo, or keep it in the same repo so it is consistently version controlled. If you would like `make launch` to start your web serer, provide `LAUNCH_W=<cmd>` in the application `Makefile`.
95+
The web client is defined by the HTML, CSS, and JS content in `<repo>/apps/toy/client/`. In this case `<repo>/apps/toy/client/html/index.html` simply links to `<repo>/framework/client/html/testbench.html` to utilize the default test bench provided by the framework that you accessed for `vadd`. If you would like to modify the web client code, you can copy `<repo>/framework/client/*/testbench.*` into `<repo>/apps/toy/client` as a simple starting point. To develop a real application, you may have your own thoughts about the framework you would like to use. You can use what you like. Develop in a separate repo, or keep it in the same repo so it is consistently version controlled.
9696

9797

9898
### Custom Kernel

Diff for: framework/build/Makefile

+82-39
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@
105105
# WAVES=[true] or default to false behavior. True to generate waveforms. (xocc )
106106
# VALGRIND=[true] or default to false behavior. True to use Valgrind to identify memory leaks in the host application.
107107
# NOHUP=true: Can be used with 'launch' target to launch in background and stay running after the shell exits. (This is implied by 'make live').
108+
# LAUNCH_ID: Used by launch, live, and dead targets. If unassigned, these targets assume a single running microservice.
109+
# A unique identifier can be provided in this variable for these targets to enable unique instances.
108110
# Eg:
109111
# make host TARGET=hw_emu
110112
#
@@ -348,7 +350,7 @@ endif
348350
endif
349351

350352
WEBSERVER_PY ?= $(shell if [[ -e "../webserver/$(KERNEL_NAME)_server.py" ]]; then echo "../webserver/$(KERNEL_NAME)_server.py"; else echo "$(FRAMEWORK_DIR)/webserver/default_server.py"; fi)
351-
LAUNCH_W ?=python3 $(WEBSERVER_PY) --port=<<PORT>> $(WEBSERVER_ARGS)
353+
LAUNCH_W ?=python3 $(WEBSERVER_PY) --port=<<PORT>> --socket=<<SOCKET>> $(WEBSERVER_ARGS)
352354

353355

354356

@@ -439,15 +441,6 @@ BUILD_DIR_NAME = prebuilt
439441
OUT_DIR_NAME = prebuilt_out
440442
endif
441443

442-
# 'live' target.
443-
ifeq ($(MAKECMDGOALS),live)
444-
NOHUP=true
445-
PORT=80
446-
HOST_EXE_PATH=../live/$(BUILD_TARGET)/$(HOST_EXE)
447-
else
448-
HOST_EXE_PATH=$(BUILD_DIR)/$(HOST_EXE)
449-
endif
450-
451444
#Assign DEST_DIR as <BUILD_TARGET>/<TARGET_DEVICE>, or just <BUILD_TARGET> for sw build (w/ no target device).
452445
ifneq ($(USE_XILINX),true)
453446
DEST_DIR=../$(OUT_DIR_NAME)/$(BUILD_TARGET)
@@ -471,16 +464,61 @@ $(error XILINX_XRT is not set. Please source the SDx settings64.{csh,sh} first)
471464
endif
472465
endif
473466

474-
# If project has a launch command, use it, otherwise, use launch from framework.
475-
LAUNCH_CMD_PARTIAL :=$(shell if [[ -e ./launch ]]; then echo ./launch; else echo $(FRAMEWORK_DIR)/build/launch; fi)
476-
ifdef LAUNCH_W
477-
LAUNCH_CMD_PARTIAL :=$(LAUNCH_CMD_PARTIAL) -w '$(LAUNCH_W)'
467+
468+
# For instance-specific targets (launch/live/dead)
469+
470+
# Prevent conflicts between launch and live targets.
471+
ifeq ($(MAKECMDGOALS), launch)
472+
DEFAULT_SOCKET=SOCKET
473+
DEFAULT_KILLME=./kill_launch
474+
else
475+
DEFAULT_SOCKET=LIVE_SOCKET
476+
DEFAULT_KILLME=./killme
477+
endif
478+
479+
# Interpret the LAUNCH_ID
480+
# KILLME: The name of the killme file for this microservice.
481+
# WEBSERVER_LOG: The path to the log file for this microservice (./log/*).
482+
# LAUNCH_DIR: directory from which microservice is launched and where is creates files.
483+
ifdef LAUNCH_ID
484+
LAUNCH_LOCAL_DIR=id-$(LAUNCH_ID)/
485+
LAUNCH_DIR=../live/$(BUILD_TARGET)/id-$(LAUNCH_ID)
486+
KILLME=./killme-$(LAUNCH_ID)
487+
WEBSERVER_LOG=log/id-$(LAUNCH_ID).log
488+
LAUNCH_ID_ARG_STR=$(SPACE)LAUNCH_ID=$(LAUNCH_ID)
489+
SOCKET=SOCKET-$(LAUNCH_ID)
490+
else
491+
LAUNCH_ID=.
492+
LAUNCH_LOCAL_DIR=
493+
LAUNCH_DIR=../live/$(BUILD_TARGET)
494+
KILLME=$(DEFAULT_KILLME)
495+
WEBSERVER_LOG=log/webserver.log
496+
LAUNCH_ID_ARG_STR=LAUNCH_ID=
497+
SOCKET=$(DEFAULT_SOCKET)
498+
endif
499+
500+
# 'live' target.
501+
ifeq ($(MAKECMDGOALS),live)
502+
NOHUP=true
503+
PORT=80
504+
HOST_EXE_PATH=$(LAUNCH_DIR)/$(HOST_EXE)
505+
else
506+
HOST_EXE_PATH=$(BUILD_DIR)/$(HOST_EXE)
507+
endif
508+
509+
ifeq ($(MAKECMDGOALS),dead)
510+
ALREADY_DEAD=else echo "There doesn't appear to be anything to kill.";
478511
endif
512+
513+
514+
# If project has a launch command, use it, otherwise, use launch from framework.
515+
LAUNCH_CMD_PARTIAL :=$(shell if [[ -e ./launch ]]; then echo ./launch; else echo $(FRAMEWORK_DIR)/build/launch; fi) -w '$(LAUNCH_W)'
516+
LAUNCH_ARGS=-p $(PORT) -s $(SOCKET) -k '$(KILLME)' $(BUILD_TARGET) '$(HOST_CMD)'
479517
ifdef NOHUP
480-
# Run in background to continue if the shell exits; log to webserver.log and cut off stdin to detach from the launching process's stdin (so ssh/etc can exit).
481-
LAUNCH_CMD=nohup $(LAUNCH_CMD_PARTIAL) -p $(PORT) $(BUILD_TARGET) '$(HOST_CMD)' &> webserver.log < /dev/null &
518+
# Run in background to continue if the shell exits; log output and cut off stdin to detach from the launching process's stdin (so ssh/etc can exit).
519+
LAUNCH_CMD=nohup $(LAUNCH_CMD_PARTIAL) $(LAUNCH_ARGS) &> $(WEBSERVER_LOG) < /dev/null &
482520
else
483-
LAUNCH_CMD=$(LAUNCH_CMD_PARTIAL) -p $(PORT) $(BUILD_TARGET) '$(HOST_CMD)'
521+
LAUNCH_CMD=$(LAUNCH_CMD_PARTIAL) $(LAUNCH_ARGS)
484522
endif
485523

486524

@@ -503,17 +541,18 @@ else
503541
VALGRIND_PREFIX=
504542
endif
505543

544+
HOST_ARGS=-s $(SOCKET)
506545
ifneq ($(USE_XILINX),true)
507546
BUILD_TARGETS=$(BUILD_DIR)/$(HOST_EXE)
508-
HOST_CMD=$(VALGRIND_PREFIX) $(HOST_EXE_PATH)
547+
HOST_CMD=$(VALGRIND_PREFIX) $(HOST_EXE_PATH) $(HOST_ARGS)
509548
endif
510549
ifeq ($(BUILD_TARGET),hw_emu)
511550
BUILD_TARGETS=$(BUILD_DIR)/$(HOST_EXE) $(HOST_XCLBIN)
512-
HOST_CMD=export XCL_EMULATION_MODE=$(BUILD_TARGET) && $(XILINX_SDX)/bin/emconfigutil --od $(DEST_DIR) --nd 1 --platform $(AWS_PLATFORM) && $(VALGRIND_PREFIX) $(HOST_EXE_PATH) $(HOST_XCLBIN)
551+
HOST_CMD=export XCL_EMULATION_MODE=$(BUILD_TARGET) && $(XILINX_SDX)/bin/emconfigutil --od $(DEST_DIR) --nd 1 --platform $(AWS_PLATFORM) && $(VALGRIND_PREFIX) $(HOST_EXE_PATH) $(HOST_ARGS) $(HOST_XCLBIN)
513552
endif
514553
ifeq ($(BUILD_TARGET),hw)
515554
BUILD_TARGETS=$(BUILD_DIR)/$(HOST_EXE) $(HOST_XCLBIN)
516-
HOST_CMD=$(VALGRIND_PREFIX) $(HOST_EXE_PATH) $(HOST_XCLBIN)
555+
HOST_CMD=$(VALGRIND_PREFIX) $(HOST_EXE_PATH) $(HOST_ARGS) $(HOST_XCLBIN)
517556
endif
518557

519558

@@ -648,7 +687,7 @@ endif
648687
mv ../out/sv/$*/out/*.sv ../out/sv
649688
# Vivado requires includes to be of .vh files, so change file name.
650689
mv ../out/sv/$*_gen.sv ../out/sv/$*_gen.vh
651-
cd ../out/sv && sed -i s/$*_gen\\.sv/$*_gen\\.vh/ $*.sv
690+
cd ../out/sv && sed -i -e s/$*_gen\\.sv/$*_gen\\.vh/ $*.sv
652691

653692

654693

@@ -812,40 +851,44 @@ endif
812851

813852
# For production use of port 80.
814853
# Run is done in its own directory to avoid socket collision with development.
815-
# ../live/$(BUILD_TARGET)/live indicates that the server is live.
816-
# ../live/$(BUILD_TARGET)/dead indicates that the server is dead.
854+
# $(LAUNCH_DIR)/live indicates that the server is live.
855+
# $(LAUNCH_DIR)/dead indicates that the server is dead.
817856

818857
.PHONY: live dead
819858

820-
live: ../live/$(BUILD_TARGET)/live
821-
../live/$(BUILD_TARGET)/live: ../live/$(BUILD_TARGET)/dead $(BUILD_TARGETS)
822-
cp $(BUILD_DIR)/$(HOST_EXE) ../live/$(BUILD_TARGET)
859+
# TODO: "live" target runs in its own directory. We've since added support for LAUNCH_ID, which provides a generic separation
860+
# of microservices. This could be used instead.
861+
live: $(LAUNCH_DIR)/live
862+
$(LAUNCH_DIR)/live: $(LAUNCH_DIR)/dead $(BUILD_TARGETS)
863+
@# Copy executables to launch dir to avoid impact from active development. Not sure how necessary this is.
864+
@cp $(BUILD_DIR)/$(HOST_EXE) $(LAUNCH_DIR)
823865
ifeq ($(USE_XILINX),true)
824-
cp $(HOST_XCLBIN) ../live/$(BUILD_TARGET)
866+
@cp $(HOST_XCLBIN) $(LAUNCH_DIR)
825867
endif
826-
# TODO: What about copying the launch script? It this is changed, will that affect the running server?
827-
# TODO: Not sure it's necessary to set make vars. These might pass through as environment vars.
868+
@# TODO: What about copying the launch script? If this is changed, will that affect the running server?
869+
@# TODO: Not sure it's necessary to set make vars. These might pass through as environment vars.
828870
@echo "Launching production server in the background"
829871
$(call with_secret,$(LAUNCH_PASSWORD) $(LAUNCH_CMD))
830-
-rm ../live/$(BUILD_TARGET)/dead
831-
touch ../live/$(BUILD_TARGET)/live
832-
@echo "Went live!!! (Stop with 'make dead' or restart with 'make live' again.)"
872+
-rm $(LAUNCH_DIR)/dead
873+
touch $(LAUNCH_DIR)/live
874+
@echo "Went live!!! (Stop with 'make$(LAUNCH_ID_ARG_STR) dead' or restart by reexecuting this command.)"
833875

834-
dead: ../live/$(BUILD_TARGET)/dead
835-
../live/$(BUILD_TARGET)/dead:
836-
if [[ -e killme ]]; then source killme > /dev/null 2>&1 && echo "Giving web server time to exit gracefully." && sleep 7; fi
837-
@mkdir -p ../live/$(BUILD_TARGET)
838-
rm -rf ../live/$(BUILD_TARGET)/*
839-
@touch ../live/$(BUILD_TARGET)/dead
876+
dead: $(LAUNCH_DIR)/dead
877+
$(LAUNCH_DIR)/dead:
878+
if [[ -e $(KILLME) ]]; then source $(KILLME) > /dev/null 2>&1 && echo "Giving web server time to exit gracefully." && sleep 7; $(ALREADY_DEAD) fi
879+
@mkdir -p $(LAUNCH_DIR) log
880+
rm -rf $(LAUNCH_DIR)/*
881+
@touch $(LAUNCH_DIR)/dead
840882

841883

842884

843885
PHONY: build launch
844886
build: $(BUILD_TARGETS)
845887

846-
LAUNCH_CHECK=@if [ -e killme ]; then echo "Error: There appears to already be an application running. Kill it with <Ctrl-C> or 'source killme', or, if not running, 'rm killme', and try again." && false; fi
888+
LAUNCH_CHECK=@if [ -e $(KILLME) ]; then echo "Error: There appears to already be an application running. Kill it with <Ctrl-C> or 'source $(KILLME)', or, if not running, 'rm $(KILLME)', and try again." && false; fi
847889
launch: $(BUILD_TARGETS)
848890
$(LAUNCH_CHECK)
891+
@mkdir -p $(LAUNCH_DIR)
849892
$(call with_secret,$(LAUNCH_PASSWORD) $(LAUNCH_CMD))
850893

851894
# An un-documented target to launch the web server and open Chrome to test it.

Diff for: framework/build/launch

+13-5
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,10 @@
5656
# -c <compile-command>: The compile command used to rebuilt when upgraded.
5757
# -w <web-server-command>: The command to launch the web server.
5858
# '<<PORT>>' will be substituted with the port number;
59+
# '<<SOCKET>>' will be substituted with the socket number;
5960
# '<<PASSWORD>>' will be substituted with $LAUNCH_PASSWORD;
61+
# -k <killme-file>: The "killme" file to create (which, when source'd will kill the microservice).
62+
# -s <socket-file>: The file to use for the socket.
6063
# -o: Launch webserver in one-shot mode, where it will kill the launch process when the websocket is closed (browser tab is closed).
6164

6265
# Must be launched from the projects 'build' directory because:
@@ -77,18 +80,22 @@ SCRIPT_CMD="launch $*"
7780
PORT="8888"
7881
HOST_PID=""
7982
COMPILE_CMD=""
80-
LAUNCH_WEBSERVER_CMD='python3 ../../../framework/webserver/default_server.py --port=<<PORT>>'
83+
LAUNCH_WEBSERVER_CMD='python3 ../../../framework/webserver/default_server.py --port=<<PORT>> --socket=<<SOCKET>>'
84+
KILLME="killme"
85+
SOCKET="SOCKET"
8186
ONESHOT_ARG=' '
8287

8388
# Read command line options
8489

85-
while getopts "p:h:c:w:o" opt
90+
while getopts "p:h:c:w:k:s:o" opt
8691
do
8792
case "${opt}" in
8893
p) PORT=${OPTARG};;
8994
h) HOST_PID=${OPTARG};;
9095
c) COMPILE_CMD="${OPTARG}";;
9196
w) LAUNCH_WEBSERVER_CMD="${OPTARG}";;
97+
k) KILLME="${OPTARG}";;
98+
s) SOCKET="${OPTARG}";;
9299
o) ONESHOT_ARG=" --oneshot=$$"
93100
esac
94101
done
@@ -163,6 +170,7 @@ launch () {
163170

164171
# Substitute <<PORT>>.
165172
CMD=${LAUNCH_WEBSERVER_CMD/<<PORT>>/$PORT}
173+
CMD=${CMD/<<SOCKET>>/$SOCKET}
166174
# Launch.
167175
echo "Launching web server as: $CMD"
168176
# Substitute <<PASSWORD>>.
@@ -176,7 +184,7 @@ launch () {
176184
export SERVER_PID=$!
177185

178186
# Create a script to teardown the application by sending SIGINT to this process.
179-
echo "kill $$ || echo 'Webserver process $$ no longer running.'" > killme # TODO: Would be good to confirm that this is the right process.
187+
echo "kill $$ || echo 'Webserver process $$ no longer running.'" > "$KILLME" # TODO: Would be good to confirm that this is the right process.
180188
}
181189

182190
# Tear down.
@@ -190,7 +198,7 @@ teardown () {
190198
kill $HOST_PID
191199
fi
192200
kill $SERVER_PID
193-
rm SOCKET # Needed? Doesn't even work.
201+
rm "$SOCKET" # Needed? Doesn't even work.
194202
else
195203
# Processes are invoked through sudo and bash and don't seem to be killed with their parent.
196204
HOST_PID2=`ps --ppid $HOST_PID -o pid=`
@@ -205,7 +213,7 @@ teardown () {
205213

206214
# Done with "killme" script, created by this script.
207215
# This script might currently be in use, but it seems to be okay to delete it?
208-
rm killme
216+
rm "$KILLME"
209217

210218
# Wait for child processes to finish first (to avoid output after exit)
211219
wait $HOST_PID >& /dev/null

Diff for: framework/host/server_main.c

+18-5
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,26 @@ int HostApp::server_main(int argc, char const *argv[], const char *kernel_name)
5959
{
6060
//TODO else ifndef OPENCL
6161
#ifdef OPENCL
62-
if (argc != 2) {
63-
printf("Usage: %s xclbin\n", argv[0]);
62+
string opencl_arg_str = " xclbin";
63+
int opencl_arg_cnt = 1;
64+
#else
65+
string opencl_arg_str = "";
66+
int opencl_arg_cnt = 0;
67+
#endif
68+
// Poor-mans arg parsing.
69+
int argn = 1;
70+
if (strcmp(argv[1], "-s") == 0) {
71+
socket_filename = argv[2];
72+
argn += 2;
73+
}
74+
if (argc != argn + opencl_arg_cnt) {
75+
printf("Usage: %s [-s socket] %s\n", argv[0], opencl_arg_str.c_str());
6476
return EXIT_FAILURE;
6577
}
6678

79+
#ifdef OPENCL
6780
// Name of the .xclbin binary file and the name of the Kernel passed as arguments
68-
const char *xclbin = argv[1];
81+
const char *xclbin = argv[argn + opencl_arg_cnt - 1];
6982
#endif
7083

7184
// Socket-related variables
@@ -95,8 +108,8 @@ int HostApp::server_main(int argc, char const *argv[], const char *kernel_name)
95108
}
96109

97110
address.sun_family = AF_UNIX;
98-
unlink(SOCKET);
99-
strncpy(address.sun_path, SOCKET, sizeof(address.sun_path)-1);
111+
unlink(socket_filename.c_str());
112+
strncpy(address.sun_path, socket_filename.c_str(), sizeof(address.sun_path)-1);
100113

101114
// Binding to the UNIX SOCKET
102115
if (bind(server_fd, (struct sockaddr *)&address,

Diff for: framework/host/server_main.h

+4
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,9 @@ class HostApp {
103103
ostream & cout_line() {return(cout << "C++: ");}
104104
ostream & cerr_line() {return(cerr << "C++ Error: ");}
105105

106+
// The default body of the main function for the server.
107+
// argv if OPENCL:
108+
// [-s socket-name] [xclbin-name-if-OPENCL]
106109
int server_main(int argc, char const *argv[], const char *kernel_name);
107110

108111
// Main method for processing traffic from/to the client.
@@ -131,6 +134,7 @@ class HostApp {
131134
static const int verbosity = 0; // 0: no debug messages; 10: all debug messages.
132135

133136
protected:
137+
string socket_filename = "SOCKET"; // The name of the socket file.
134138
int socket; // The ID of the socket connected to the web server.
135139

136140
/*

Diff for: framework/terraform/static_f1_reboot.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# Running via ssh establishes the proper environment.
77
# TODO: Look into EC2 user_data or cloud-init to replace this mechanism.
88
source /home/centos/server_config.sh
9-
WEBSERVER_LOG="/home/centos/src/project_data/repo/apps/$KERNEL_NAME/build/webserver.log"
9+
WEBSERVER_LOG="/home/centos/src/project_data/repo/apps/$KERNEL_NAME/build/log/webserver.log"
1010
PASSWORD_ARG=$(if [[ -n "$ADMIN_PWD" ]]; then echo PASSWORD=$ADMIN_PWD; fi)
1111
PREBUILT_ARG=$(if [[ -n "$USE_PREBUILT_AFI" ]]; then echo PREBUILT=$USE_PREBUILT_AFI; fi)
1212

Diff for: framework/webserver/server.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -510,11 +510,12 @@ def EC2Args():
510510
# by passing flags=None and params=<value of args after command-line processing>.
511511
# Implicit params are:
512512
# "port" (8888): Socket on which web server will listen.
513+
# "socket" ("SOCKET"): Socket file name.
513514
# Return: {dict} The parameters/arguments. When a command-line arg is not given, it will have default value. A flag will not exist if not given, or have "" value if given.
514515
@staticmethod
515516
def commandLineArgs(flags=[], params={}):
516517
# Apply implicit args. ("password" is from EC2Args(), but the Makefile will provide it from configuration parameters, whether used or not.)
517-
ret = {"port": 8888, "password": None, "oneshot": None, "ssl_crt_file": None, "ssl_key_file": None}
518+
ret = {"port": 8888, "socket": "SOCKET", "password": None, "oneshot": None, "ssl_crt_file": None, "ssl_key_file": None}
518519
ret.update(params)
519520
arg_list = flags
520521
# Apply implicit flags (currently none).
@@ -524,7 +525,7 @@ def commandLineArgs(flags=[], params={}):
524525
try:
525526
opts, remaining = getopt.getopt(sys.argv[1:], "", arg_list)
526527
except getopt.GetoptError:
527-
print('Usage: %s [--port #] [--instance i-#] [--ec2_time_bomb_timeout <sec>] [--password <password>] [--profile <aws-profile>] [--ssl_crt_file <ssl-crt-file> --ssl_key_file <ssl-key_file>]' % (sys.argv[0]))
528+
print('Usage: %s [--port #] [--socket socket-file] [--instance i-#] [--ec2_time_bomb_timeout <sec>] [--password <password>] [--profile <aws-profile>] [--ssl_crt_file <ssl-crt-file> --ssl_key_file <ssl-key_file>]' % (sys.argv[0]))
528529
sys.exit(2)
529530
# Strip leading dashes.
530531
for opt, arg in opts:
@@ -539,12 +540,13 @@ def __init__(self, routes, args):
539540
self.args = args
540541

541542
self.port = int(self.args['port'])
543+
self.socket_filename = self.args['socket']
542544

543545
FPGAServerApplication.application = self
544546

545547
super(FPGAServerApplication, self).__init__(routes)
546548

547-
self.socket = Socket()
549+
self.socket = Socket(self.socket_filename)
548550

549551
# Launch server (with SSL or not)
550552
self.use_ssl = self.args['ssl_key_file'] != None and self.args['ssl_crt_file'] != None

0 commit comments

Comments
 (0)