Metadata-Version: 2.3
Name: openvisuspy
Version: 1.0.64
Summary: openvisuspy
Project-URL: Homepage, https://github.com/sci-visus/openvisuspy
Project-URL: Bug Tracker, https://github.com/sci-visus/openvisuspy
Author: OpenVisus developers
License-File: LICENSE
Requires-Python: >=3.9
Description-Content-Type: text/markdown

# Instructions

Important:

- use python `3.10` or `3.11`.  **DO NOT** use `python312` does not have a good match for `libzmq`
- use  JupyterLab v3 (**NOT v4**) because bokeh does not work (see https://github.com/bokeh/jupyter_bokeh/issues/197)

## Installation

In Windows:

```bash
set PATH=c:\Python310;%PATH%
where python

python.exe -m venv .venv
.venv\Scripts\activate

python.exe -m pip install --upgrade pip
python.exe -m pip install -r requirements.txt

# install the latest version of OpenVisus
python.exe -m pip install --upgrade OpenVisusNoGui openvisuspy
```

In MacOs/Linux:

```bash

python3 -m venv .venv
source .venv/Scripts/activate
python3 -m pip install --upgrade pip
python3 -m pip install -r requirements.txt

# install the latest version of OpenVisus
python3 -m pip install --upgrade OpenVisusNoGui openvisuspy
```

## Dashboards 

In Windows:

```bash
.venv\Scripts\activate
python.exe -m panel serve ./app --dev --args ./json/dashboards.json
```

In MacOs/Linux:

```bash
source .venv/bin/activate
python.exe -m panel serve ./app --dev --args ./json/dashboards.json
```

## Notebooks

In Windows:

```bash
.venv\Scripts\activate
jupyter lab ./notebooks
```

In MacOs/Linux:

```bash
source .venv/bin/activate
jupyter lab ./notebooks
```

Important: if Panel is not working you may have to do:

```bash
pskill python
jupyter nbconvert --clear-output --inplace notebooks/test-panel.ipynb  
jupyter trust notebooks/test-panel.ipynb  
```



## Docker Compose

Create an `.env` file with a token:

```bash
cat <<EOF > .env
NSDF_TOKEN=whatever-but-secure
EOF
```

```bash 
# sudo docker-compose up chess1_service
# sudo docker-compose up chess2_service
# sudo docker-compose up jupyterlab_service

sudo docker-compose up 
```

You can check if it's working going to any of the URL:

- http://localhost/chess1
- http://localhost/chess2
- http://localhost/lab



## Deploy using ansible


Create an ``./inventory.ini` file. For example

```ini
[all:vars]
ansible_ssh_connection=ssh 
ansible_ssh_user=root
ansible_ssh_private_key_file=~/.ssh/id_rsa

[my_vps]
127.0.0.1
```

Run the ansible playbooks:

```bash

# this is needed for WSL2
export ANSIBLE_CONFIG=${PWD}/ansible.cfg

# check connectivity
ansible all -m ping

# Run single command
ansible --become-user root --become all -m shell -a 'docker ps'

# Clean up notebooks
for it in $(find ./notebooks/*.ipynb) ; do
  jupyter nbconvert --clear-output --inplace ${it}
  jupyter trust ${it}
done

#   --tags "configuration,packages"
#   --limit=<hostname>
#   -l <group-name>
#   -vvv
ansible-playbook ./ansible/00-setup-node.yml 
ansible-playbook ./ansible/01-benchmark.yml --verbose
ansible-playbook ./ansible/02-remove-all-containers.yml 
ansible-playbook ./ansible/03-precache-data.yml -vvv --limit hetzner
ansible-playbook ./ansible/04-run.yml 
```

## Test Volume rendering

```bash
python test/test-pyvista.py
python test/test-vtkvolume.py 
```

## Debug openvisuspy

Debug mode in Windows

```bash
.venv\Scripts\activate

set PATH=c:\Python310;%PATH%

set BOKEH_ALLOW_WS_ORIGIN=*
set BOKEH_LOG_LEVEL=debug
set VISUS_CPP_VERBOSE=1
set VISUS_NETSERVICE_VERBOSE=1
set VISUS_VERBOSE_DISKACCESS=0
set VISUS_CACHE=c:/tmp/visus-cache

set PYTHONPATH=C:\projects\OpenVisus\build\RelWithDebInfo;.\src

# dashboards
python.exe -m panel serve ./app --dev --args ./json/dashboards.debug.json

# jupyter lab
python.exe -m jupyter lab notebooks/ov-dashboards.ipynb

python.exe -m panel serve ./app --dev --args "https://atlantis.sci.utah.edu/mod_visus?action=readdataset&dataset=chess-intro&cached=arco" --probe
```

Deploy binaries

```bash
./scripts/new_tag.sh
```



