Skip to content

Commit

Permalink
fix container import issue
Browse files Browse the repository at this point in the history
  • Loading branch information
liqul committed Oct 10, 2024
1 parent fdb254a commit 6d3b658
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.sh text eol=lf
2 changes: 1 addition & 1 deletion docker/ces_container/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ COPY taskweaver/__init__.py /app/taskweaver/__init__.py
COPY docker/ces_container/entrypoint.sh /app/entrypoint.sh
RUN chmod +x /app/entrypoint.sh

ENV PYTHONPATH "${PYTHONPATH}:/app"
ENV PYTHONPATH="/app"

ENTRYPOINT ["/app/entrypoint.sh"]

Expand Down
2 changes: 1 addition & 1 deletion scripts/build_executor.ps1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
$scriptDirectory = $PSScriptRoot
Write-Host "The script directory is: $scriptDirectory"

$version = "0.2"
$version = "0.3"
$imageName = "taskweavercontainers/taskweaver-executor"
$imageFullName = "${imageName}:${version}"

Expand Down
8 changes: 7 additions & 1 deletion taskweaver/ces/kernel/launcher.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import os
import sys

from taskweaver.ces.kernel.ext import TaskWeaverZMQShellDisplayHook
from taskweaver.ces.kernel.kernel_logging import logger

kernel_mode = os.getenv("TASKWEAVER_KERNEL_MODE", "local")
Expand Down Expand Up @@ -56,6 +55,8 @@ def start_app():
from ipykernel.kernelapp import IPKernelApp
from ipykernel.zmqshell import ZMQInteractiveShell

from taskweaver.ces.kernel.ext import TaskWeaverZMQShellDisplayHook

# override displayhook_class for skipping output suppress token issue
ZMQInteractiveShell.displayhook_class = TaskWeaverZMQShellDisplayHook

Expand All @@ -82,6 +83,11 @@ def start_app():
if __name__ == "__main__":
if sys.path[0] == "":
del sys.path[0]
import site

user_site_packages = site.getusersitepackages()
if user_site_packages not in sys.path:
sys.path.append(site.getusersitepackages())
logger.info("Starting process...")
logger.info("sys.path: %s", sys.path)
logger.info("os.getcwd(): %s", os.getcwd())
Expand Down

0 comments on commit 6d3b658

Please sign in to comment.