This is an automated email from the ASF dual-hosted git repository.

dimuthuupe pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airavata.git


The following commit(s) were added to refs/heads/master by this push:
     new cb44d8f75d Adding container configurations to jupyter and airavata 
agent
cb44d8f75d is described below

commit cb44d8f75d87ebf8fcbcf75f2b6a17ba7ab49bbc
Author: Dimuthu Wannipurage <[email protected]>
AuthorDate: Fri Jul 19 15:14:32 2024 -0400

    Adding container configurations to jupyter and airavata agent
---
 .gitignore                                                |  2 ++
 modules/agent-framework/airavata-agent/.gitignore         |  6 +++++-
 modules/agent-framework/airavata-agent/Dockerfile         |  8 ++++++++
 modules/agent-framework/airavata-agent/agent.go           |  2 +-
 modules/agent-framework/airavata-agent/jupyter/Dockerfile | 13 +++++++++++++
 .../jupyter/labconfig/jupyter_lab_config.py               | 15 +++++++++++++++
 .../connection-service/src/main/resources/application.yml |  1 +
 7 files changed, 45 insertions(+), 2 deletions(-)

diff --git a/.gitignore b/.gitignore
index 459c9a31fd..204bdd035e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -40,3 +40,5 @@ venv
 airavata_custos.egg-info
 *.pyc
 .tox
+
+logs
\ No newline at end of file
diff --git a/modules/agent-framework/airavata-agent/.gitignore 
b/modules/agent-framework/airavata-agent/.gitignore
index ea32156bf5..3569009354 100644
--- a/modules/agent-framework/airavata-agent/.gitignore
+++ b/modules/agent-framework/airavata-agent/.gitignore
@@ -1,2 +1,6 @@
 airavata-agent
-go.sum
\ No newline at end of file
+go.sum
+jupyter/extension/airavata_jupyter_magic/dist
+jupyter/extension/airavata_jupyter_magic/lib
+*.egg-info
+*.ipynb_checkpoints
diff --git a/modules/agent-framework/airavata-agent/Dockerfile 
b/modules/agent-framework/airavata-agent/Dockerfile
new file mode 100644
index 0000000000..f90643cbc7
--- /dev/null
+++ b/modules/agent-framework/airavata-agent/Dockerfile
@@ -0,0 +1,8 @@
+FROM python:slim
+
+RUN pip install flask jupyter jupyter-client
+RUN mkdir -p /opt/jupyter
+RUN python -m venv /opt/jupyter/venv
+ADD airavata-agent-linux /opt/airavata-agent
+ADD jupyter/kernel.py /opt/jupyter/kernel.py
+
diff --git a/modules/agent-framework/airavata-agent/agent.go 
b/modules/agent-framework/airavata-agent/agent.go
index b2e7a2a80c..86696adb28 100644
--- a/modules/agent-framework/airavata-agent/agent.go
+++ b/modules/agent-framework/airavata-agent/agent.go
@@ -50,7 +50,7 @@ func main() {
 
        go func() {
                log.Printf("Starting jupyter kernel")
-               cmd := exec.Command("./jupyter/venv/bin/python", 
"jupyter/kernel.py")
+               cmd := exec.Command("python", "/opt/jupyter/kernel.py")
                _, err := cmd.Output()
                if err != nil {
                        log.Printf(err.Error())
diff --git a/modules/agent-framework/airavata-agent/jupyter/Dockerfile 
b/modules/agent-framework/airavata-agent/jupyter/Dockerfile
new file mode 100644
index 0000000000..af6904add9
--- /dev/null
+++ b/modules/agent-framework/airavata-agent/jupyter/Dockerfile
@@ -0,0 +1,13 @@
+FROM python:slim
+
+RUN apt update
+RUN apt install fuse -y
+RUN pip install notebook
+RUN apt install kmod -y
+
+COPY labconfig/jupyter_lab_config.py /jupyter_lab_config.py
+COPY fuse/client /client
+EXPOSE 8888
+WORKDIR /home
+
+ENTRYPOINT ["jupyter", "lab", "--config=/jupyter_lab_config.py", 
"--ip=0.0.0.0", "--port=8888", "--no-browser", "--allow-root", 
"--NotebookApp.token=''"]
diff --git 
a/modules/agent-framework/airavata-agent/jupyter/labconfig/jupyter_lab_config.py
 
b/modules/agent-framework/airavata-agent/jupyter/labconfig/jupyter_lab_config.py
new file mode 100644
index 0000000000..d6d733ce58
--- /dev/null
+++ 
b/modules/agent-framework/airavata-agent/jupyter/labconfig/jupyter_lab_config.py
@@ -0,0 +1,15 @@
+c = get_config()
+
+# Set the IP address Jupyter Lab will listen on
+c.ServerApp.ip = '0.0.0.0'
+
+# Set the port Jupyter Lab will listen on
+c.ServerApp.port = 8888
+
+# Don't open the browser by default
+c.ServerApp.open_browser = False
+
+c.FileContentsManager.use_atomic_writing = False
+
+# Allow root access
+c.ServerApp.allow_root = True
\ No newline at end of file
diff --git 
a/modules/agent-framework/connection-service/src/main/resources/application.yml 
b/modules/agent-framework/connection-service/src/main/resources/application.yml
index d5aa0bfede..52bdcbeea3 100644
--- 
a/modules/agent-framework/connection-service/src/main/resources/application.yml
+++ 
b/modules/agent-framework/connection-service/src/main/resources/application.yml
@@ -4,6 +4,7 @@ grpc:
 
 server:
   port: 18880
+  address: 0.0.0.0
 
 airavata:
   server:

Reply via email to