Skip to content

Commit

Permalink
Add Voila app port to kernel env (#1176)
Browse files Browse the repository at this point in the history
* Adds app port to kernal env

* Update voila/handler.py

Co-authored-by: Duc Trung Le <[email protected]>

* Update test to set port with parameter so parent's port is prioritized in kernel manager

Co-authored-by: dcnadler <[email protected]>
Co-authored-by: Duc Trung Le <[email protected]>
  • Loading branch information
3 people authored Jul 28, 2022
1 parent ec2c75f commit 211ca29
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
7 changes: 3 additions & 4 deletions tests/app/preheat_with_query_string_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,12 @@ def using_server_url(request):


@pytest.fixture()
def voila_args_extra(using_server_url, using_base_url):
return using_server_url + using_base_url
def voila_args_extra(http_server_port, using_server_url, using_base_url):
return [f'--port={http_server_port[-1]}'] + using_server_url + using_base_url


@pytest.fixture
def preheat_mode(http_server_port):
os.environ['VOILA_APP_PORT'] = str(http_server_port[-1])
def preheat_mode():
return True


Expand Down
1 change: 1 addition & 0 deletions voila/voila_kernel_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ def fill_if_needed(
kernel_env[key] = kernel_env_variables[key]
kernel_env[ENV_VARIABLE.VOILA_BASE_URL] = self.parent.base_url
kernel_env[ENV_VARIABLE.VOILA_SERVER_URL] = self.parent.server_url
kernel_env[ENV_VARIABLE.VOILA_APP_PORT] = str(self.parent.port)
kernel_env[ENV_VARIABLE.VOILA_PREHEAT] = 'True'
kwargs['env'] = kernel_env

Expand Down

0 comments on commit 211ca29

Please sign in to comment.