diff --git a/conf.py b/conf.py index de7fa3744..510ca1b29 100644 --- a/conf.py +++ b/conf.py @@ -136,7 +136,7 @@ def readtips (d): if not safemkdir(dbase): sys.exit(1) # check existence of base hnn output dir else: if d['homeout']: # user home directory for output - dbase = os.path.join(os.path.expanduser('~'),'hnn_output') # user home directory + dbase = os.path.join(os.path.expanduser('~'),'hnn_out') # user home directory if not safemkdir(dbase): sys.exit(1) # check existence of base hnn output dir else: # cwd for output dbase = os.getcwd() # use os.getcwd instead for better compatability with NSG diff --git a/installer/brown_ccv/vnc-client.md b/installer/brown_ccv/vnc-client.md index 308eff056..f559c64a1 100644 --- a/installer/brown_ccv/vnc-client.md +++ b/installer/brown_ccv/vnc-client.md @@ -1,6 +1,6 @@ # Running HNN with the VNC client on Oscar -1. Download the CCV VNC Client (see [VNC Client](https://web1.ccv.brown.edu/technologies/vnc)) +1. Download the CCV VNC Client (see [Oscar VNC Documentation](https://docs.ccv.brown.edu/oscar/connecting-to-oscar/vnc)) 2. Move the file CCV_VNC_2.0.3.jar to somewhere where you can access later and double click on it. * On Mac systems: @@ -19,12 +19,9 @@ singularity run hnn.simg ``` -6. When the HNN GUI starts up, make sure to change limit the number of cores the amount when requesting the VNC session (e.g. 4 cores) - * Click 'Set Parameters' -> 'Run' and change 'NumCores' -7. You can now proceed to the tutorials at https://hnn.brown.edu/index.php/tutorials/ . Some things to note: +6. You can now proceed to the tutorials at https://hnn.brown.edu/index.php/tutorials/ . Some things to note: - * The files within the container are visible at `/`. This allows you to access both the container filesystem and Oscar's filesystem seamlessly. If you are loading sample files for the tutorials, look in `/home/hnn_user/hnn_source_code` - * The "Model Visualization" feature will not work and you will receive an error in the terminal window: `ImportError: libreadline.so.6: cannot open shared object file: No such file or directory`. + * The files within the container are visible are integrated within Oscar's view of your director. For example, your user directory might be `/users/myuser` and the hnn_user within the container has a user directory `/home/hnn_user`. If you are loading sample files for the tutorials, look in `/home/hnn_user/hnn_source_code`. Your output from simulations will be stored in `/users/myuser/hnn_out` ## Running HNN a second time diff --git a/installer/brown_ccv/x11-forwarding.md b/installer/brown_ccv/x11-forwarding.md index be0253cac..31820c998 100644 --- a/installer/brown_ccv/x11-forwarding.md +++ b/installer/brown_ccv/x11-forwarding.md @@ -39,7 +39,7 @@ 3. Log in using your CCV account password -4. Start an interactive job with the `interact` command. Choose the number of cores for your allocations. If you have an exploratory account, you are limited to 16 cores. Anything larger will remain in the queue forever. +4. Start an interactive job with the `interact` command. Choose the number of cores for your allocations. If you have an exploratory account, you are limited to 16 cores. You can also use a condo account to use larger allocations. ```bash interact -n 16 @@ -54,12 +54,9 @@ singularity run hnn.simg ``` -6. When the HNN GUI starts up, make sure to change limit the number of cores the amount when requesting the interactive session (e.g. 16 cores) - * Click 'Set Parameters' -> 'Run' and change 'NumCores' -7. You can now proceed to the tutorials at https://hnn.brown.edu/index.php/tutorials/ . Some things to note: +6. You can now proceed to the tutorials at https://hnn.brown.edu/index.php/tutorials/ . Some things to note: - * The files within the container are visible at `/`. This allows you to access both the container filesystem and Oscar's filesystem seamlessly. If you are loading sample files for the tutorials, look in `/home/hnn_user/hnn_source_code` - * The "Model Visualization" feature will not work and you will receive an error in the terminal window: `ImportError: libreadline.so.6: cannot open shared object file: No such file or directory`. + * The files within the container are visible are integrated within Oscar's view of your director. For example, your user directory might be `/users/myuser` and the hnn_user within the container has a user directory `/home/hnn_user`. If you are loading sample files for the tutorials, look in `/home/hnn_user/hnn_source_code`. Your output from simulations will be stored in `/users/myuser/hnn_out` ## Running HNN a second time diff --git a/installer/centos/README.md b/installer/centos/README.md index b183220c5..f37b4e19f 100644 --- a/installer/centos/README.md +++ b/installer/centos/README.md @@ -1,16 +1,20 @@ # Installing HNN on CentOS (Docker install) This guide describes installing HNN on CentOS using Docker. This method will automatically download the HNN Docker container image when HNN is started for the first time. If you would prefer to install HNN without Docker, please see the instructions below. - - Alternative: [Native install instructions (advanced users)](native_install.md) -**Note: please verify that your OS supports Docker CE** - - CentOS 7 and later versions are supported - - See [OS requirements](https://docs.docker.com/install/linux/docker-ce/centos/#os-requirements) - - It may be possible to install older versions of docker meant for earlier CentOS versions. We recommend following the currently supported procedure from Docker, but you may find a version of Docker in the [EPEL repositories](https://fedoraproject.org/wiki/EPEL) for CentOS 6, which would would work for your OS. +- Alternative: [Native install instructions (advanced users)](native_install.md) + +## Verify that your OS supports Docker CE + + - CentOS 7 and later versions are supported + - See [OS requirements](https://docs.docker.com/install/linux/docker-ce/centos/#os-requirements) + - It may be possible to install older versions of docker meant for earlier CentOS versions. We recommend following the currently supported procedure from Docker, but you may find a version of Docker in the [EPEL repositories](https://fedoraproject.org/wiki/EPEL) for CentOS 6, which would would work for your OS. ## Prerequisite: install Docker + 1. To install docker, type the following commands in a terminal (x86_64 only). They are from [Docker's CentOS install instructions](https://docs.docker.com/install/linux/docker-ce/centos/) for installing docker-ce from Docker's official repository. - ``` + + ```bash # get prerequisites for docker sudo yum install -y yum-utils device-mapper-persistent-data lvm2 # add the repository @@ -23,15 +27,20 @@ This guide describes installing HNN on CentOS using Docker. This method will aut # verify that docker runs sudo docker run hello-world ``` + 2. Add your user to the docker group to avoid having to run docker commands with "sudo" - ``` + + ```bash $ sudo usermod -a -G docker [username] ``` + 3. Log out and back in (may need to reboot) for the group change to take effect ## Prerequisite: install Docker Compose + Open a bash terminal and run these commands (from [Docker Compose installation](https://docs.docker.com/compose/install/)): - ``` + + ```bash $ bash -c 'sudo curl -L "https://github.com/docker/compose/releases/download/1.23.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose' $ sudo chmod +x /usr/local/bin/docker-compose $ docker-compose --version @@ -40,28 +49,67 @@ Open a bash terminal and run these commands (from [Docker Compose installation]( ## Start HNN 1. Check that Docker is running properly by typing the following in a new terminal window. - ``` + ```bash $ docker info ``` + 2. Clone or download the [HNN repo](https://github.com/jonescompneurolab/hnn). If you already have a previous version of the repository, bring it up to date with the command `git pull origin master` instead of the `git clone` command below. - ``` + + ```bash $ git clone https://github.com/jonescompneurolab/hnn.git $ cd hnn/installer/docker ``` -3. Start the Docker container. Note: the jonescompneurolab/hnn Docker image will be downloaded from Docker Hub (about 1.5 GB). The docker-compose command can be used to manage Docker containers described in the specification file docker-compose.yml. The parameter "up" starts the containers (just one in our case) in that file and "-d" starts the docker container in the background. + +3. Start the Docker container. Note: the jonescompneurolab/hnn Docker image will be downloaded from Docker Hub (about 2 GB). The docker-compose command can be used to manage Docker containers described in the specification file docker-compose.yml. + + ```bash + $ docker-compose run hnn + Pulling hnn (jonescompneurolab/hnn:)... + latest: Pulling from jonescompneurolab/hnn + 34dce65423d3: Already exists + 796769e96d24: Already exists + 2a0eada9611d: Already exists + d6830a7cd972: Already exists + ddf2bf28e180: Already exists + 77bf1279b29f: Pull complete + 6c8ddf82616f: Pull complete + a991616934ba: Pull complete + 2cece6240c19: Pull complete + df826e7d26b9: Pull complete + 824d51cbc89d: Pull complete + 0d16f27c744b: Pull complete + Digest: sha256:0c27e2027828d2510a8867773562bbc966c509f45c9921cc2d1973c575d327b3 + Status: Downloaded newer image for jonescompneurolab/hnn:latest ``` - $ docker-compose up -d - ``` + 4. The HNN GUI should show up. Make sure that you can run simulations by clicking the 'Run Simulation' button. This will run a simulation with the default configuration. After it completes, graphs should be displayed in the main window. 5. You can now proceed to running the tutorials at https://hnn.brown.edu/index.php/tutorials/ . Some things to note: - * A directory called "hnn" exists both inside the container (at /home/hnn_user/hnn) and outside (in the directory set by step 2) that can be used to share files between the container and your host OS. - * If you run into problems starting the Docker container or the GUI is not displaying, please see the [Docker troubleshooting section](../docker/README.md#Troubleshooting) - * If you closed the HNN GUI or it is no longer running, and you would like to restart it, run the following command from the same directory set in step 2: - ``` - $ docker-compose restart - ``` -6. **NOTE:** You may want run commands or edit files within the container. To access a command prompt in the container, use [`docker exec`](https://docs.docker.com/engine/reference/commandline/exec/) as shown below: + - A directory called "hnn_out" exists both inside the container (at /home/hnn_user/hnn_out) and outside (in the directory set by step 2) that can be used to share files between the container and your host OS. + - The HNN repository with sample data and parameter files exists at /home/hnn_user/hnn_source_code. + - If you run into problems starting the Docker container or the GUI is not displaying, please see the [Docker troubleshooting section](../docker/README.md#Troubleshooting) + +## Updgrading to a new version of HNN + +1. Verify Docker is still running. To confirm that Docker is running properly, typing `docker info` should return a bunch of output, but no errors. + + ```bash + $ docker info + ``` + +2. Open a terminal window + + ```bash + $ cd hnn/installer/docker + $ docker-compose up --no-start + Recreating docker_hnn_1 ... done + $ docker-compose run hnn ``` + +## Editing files within HNN container + +You may want run commands or edit files within the container. To access a command shell in the container, start the container using `docker-compose run hnn` in one terminal window and open another terminal to use [`docker exec`](https://docs.docker.com/engine/reference/commandline/exec/) as shown below: + + ```bash $ docker exec -ti docker_hnn_1 bash hnn_user@054ba0c64625:/home/hnn_user$ ``` @@ -70,20 +118,22 @@ Open a bash terminal and run these commands (from [Docker Compose installation]( ## Uninstalling HNN -1. If you want to just remove the container and 1.5 GB HNN image, run these commands from a terminal window: - ``` +1. If you want to just remove the container and 2 GB HNN image, run these commands from a terminal window: + + ```bash $ docker rm -f docker_hnn_1 $ docker rmi jonescompneurolab/hnn ``` + 2. To continue and remove Docker, follow these instructions from [Uninstall Docker CE](https://docs.docker.com/install/linux/docker-ce/centos/#uninstall-docker-ce) - ``` + + ```bash $ sudo yum remove docker-ce $ sudo rm -rf /var/lib/docker ``` - # Troubleshooting If you run into other issues with the installation, please [open an issue on our GitHub](https://github.com/jonescompneurolab/hnn/issues). Our team monitors these issues and will be able to suggest possible fixes. -For other HNN software issues, please visit the [HNN bulletin board](https://www.neuron.yale.edu/phpBB/viewforum.php?f=46) \ No newline at end of file +For other HNN software issues, please visit the [HNN bulletin board](https://www.neuron.yale.edu/phpBB/viewforum.php?f=46) diff --git a/installer/docker/README.md b/installer/docker/README.md index a750d54e7..0320c3ea6 100644 --- a/installer/docker/README.md +++ b/installer/docker/README.md @@ -8,22 +8,26 @@ This directory contains files for building the HNN container and using docker-co ## Pulling the prebuilt Docker container from Docker Hub The newest version of HNN is available as a prebuilt container posted on Docker Hub, which can be used instead of building the container and all of its prerequisites (NEURON) from scratch. -``` +```bash docker pull jonescompneurolab/hnn ``` ## Building HNN container from this directory -``` + +The CACHEBUST argument reuses the docker cache up to the point where new HNN source code is included (container will always include latest source code). + +```bash cd hnn/installer/docker -docker build --tag jonescompneurolab/hnn . +docker build --tag jonescompneurolab/hnn --build-arg CACHEBUST=$(date +%s) . ``` ## Running HNN container without docker-compose Using docker-compose is the preferred way to run HNN containers, because it sets needed environment variables and defines volumes automatically. However, if docker-compose is not available or the user wants to modify docker run arguments, the following command Replicates behavior by docker-compose: -``` + +```bash # Set DISPLAY for Mac and Windows export DOCKER_DISPLAY=host.docker.internal:0 -# For docker toolbox only +# For docker toolbox only export DOCKER_DISPLAY=192.168.99.1:0 # For Linux export DOCKER_DISPLAY=:0 diff --git a/installer/docker/start_hnn.sh b/installer/docker/start_hnn.sh index 5a0b5285f..4ce685311 100755 --- a/installer/docker/start_hnn.sh +++ b/installer/docker/start_hnn.sh @@ -15,7 +15,7 @@ function retry_hnn { return 1 else echo "HNN GUI stopped by user. Restart container to open again" - return 0 + exit 0 fi } @@ -33,7 +33,7 @@ python3 hnn.py if [[ "$?" -eq "0" ]]; then # HNN quit gracefully echo "HNN GUI stopped by user. Restart container to open again" - sleep infinity + exit 0 fi done= @@ -42,10 +42,6 @@ XHOST=${DISPLAY%:0} for PORT in 0 1 2 3 4; do for XHOST in $XHOST 192.168.99.1 192.168.65.2 ""; do retry_hnn $XHOST $PORT - if [[ "$?" -eq "0" ]]; then - # HNN quit gracefully - sleep infinity - fi done done diff --git a/installer/mac/docker-desktop.md b/installer/mac/docker-desktop.md index 6b11d08f3..c7015b228 100644 --- a/installer/mac/docker-desktop.md +++ b/installer/mac/docker-desktop.md @@ -49,45 +49,62 @@ 1. Download the source code (zip) for our latest HNN release from our [GitHub releases page](https://github.com/jonescompneurolab/hnn/releases) 2. Open the .zip file and click "Extract all". Choose any destination folder on your machine. 3. Open a cmd.exe window and change to the directory part of the extracted HNN release shown below: - ``` + + ```bash $ cd REPLACE-WITH-FOLDER-EXTRACTED-TO/hnn/installer/mac ``` -3. Start the Docker container. Note: the jonescompneurolab/hnn Docker image will be downloaded from Docker Hub (about 1.5 GB). The docker-compose command can be used to manage Docker containers described in the specification file docker-compose.yml. The parameter "up" starts the containers (just one in our case) in that file and "-d" starts the docker container in the background. +3. Start the Docker container. Note: the jonescompneurolab/hnn Docker image will be downloaded from Docker Hub (about 2 GB). The `docker-compose` command can be used to manage Docker containers described in the specification file docker-compose.yml. + + ```bash + $ docker-compose run hnn + Pulling hnn (jonescompneurolab/hnn:)... + latest: Pulling from jonescompneurolab/hnn + 34dce65423d3: Already exists + 796769e96d24: Already exists + 2a0eada9611d: Already exists + d6830a7cd972: Already exists + ddf2bf28e180: Already exists + 77bf1279b29f: Pull complete + 6c8ddf82616f: Pull complete + a991616934ba: Pull complete + 2cece6240c19: Pull complete + df826e7d26b9: Pull complete + 824d51cbc89d: Pull complete + 0d16f27c744b: Pull complete + Digest: sha256:0c27e2027828d2510a8867773562bbc966c509f45c9921cc2d1973c575d327b3 + Status: Downloaded newer image for jonescompneurolab/hnn:latest ``` - $ docker-compose up -d - Starting mac_hnn_1 ... done - ``` - * You can see that the HNN container is running - ``` - $ docker ps -a - CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES - 1fa235c2f831 jonescompneurolab/hnn "/home/hnn_user/star…" 6 seconds ago Up 5 seconds mac_hnn_1 - ``` - - * If starting the GUI doesn't work the first time, the first thing to check is XQuartz settings (see screnshot above). Then restart XQuartz and try starting the HNN container again with - ``` - $ docker-compose restart - ``` + 4. The HNN GUI should show up. Make sure that you can run simulations by clicking the 'Run Simulation' button. This will run a simulation with the default configuration. After it completes, graphs should be displayed in the main window. + * If starting the GUI doesn't work, the first thing to check is XQuartz settings (see screnshot above). Then restart XQuartz and try starting the HNN container again. 5. You can now proceed to running the tutorials at https://hnn.brown.edu/index.php/tutorials/ . Some things to note: - * A directory called "hnn" exists both inside the container (at /home/hnn_user/hnn) and outside (in the directory set by step 2) that can be used to share files between the container and your host OS. + * A directory called "hnn_out" exists both inside the container (at /home/hnn_user/hnn_out) and outside (in the directory set by step 2) that can be used to share files between the container and your host OS. * The HNN repository with sample data and parameter files exists at /home/hnn_user/hnn_source_code. - * Clicking on 'Model Visualization' may only display a blank screen. This feature will not work with Docker Desktop on Mac because the 3D visualization requires access the the GPU device. Docker is not capable of passing through access to the Mac's hardware GPU. * If you run into problems starting the Docker container or the GUI is not displaying, please see the [Docker troubleshooting section](../docker/README.md#Troubleshooting) +## Updgrading to a new version of HNN -## Launching HNN again -1. Verify that XQuartz and Docker are running. XQuartz will not start automatically after a reboot by default. -2. Open a terminal window +1. Verify that XQuartz and Docker are running. XQuartz will not start automatically after a reboot by default. To confirm that Docker is running properly, typing `docker info` should return a bunch of output, but no errors. + + ```bash + $ docker info ``` + +2. Open a terminal window + + ```bash $ cd hnn/installer/mac - $ docker-compose restart + $ docker-compose up --no-start + Recreating mac_hnn_1 ... done + $ docker-compose run hnn ``` ## Editing files within HNN container -You may want run commands or edit files within the container. To access a command shell in the container, use [`docker exec`](https://docs.docker.com/engine/reference/commandline/exec/) as shown below: -``` + +You may want run commands or edit files within the container. To access a command shell in the container, start the container using `docker-compose run hnn` in one terminal window and open another terminal to use [`docker exec`](https://docs.docker.com/engine/reference/commandline/exec/) as shown below: + +```bash $ docker exec -ti mac_hnn_1 bash hnn_user@054ba0c64625:/home/hnn_user$ ``` @@ -97,7 +114,8 @@ If you'd like to be able to copy files from the host OS without using the shared ## Uninstalling HNN If you want to remove the container and 1.5 GB HNN image, run the following commands from a terminal window. You can then remove Docker Desktop by removing it from your Applications folder. -``` + +```bash $ docker rm -f mac_hnn_1 $ docker rmi jonescompneurolab/hnn ``` diff --git a/installer/mac/docker-toolbox.md b/installer/mac/docker-toolbox.md index 82c81593a..98a542f6c 100644 --- a/installer/mac/docker-toolbox.md +++ b/installer/mac/docker-toolbox.md @@ -1,6 +1,7 @@ # Installing HNN on Mac OS (Docker Toolbox) ## Prerequisite: XQuartz + 1. Download the installer image (version 2.7.11 tested): https://www.xquartz.org/ 2. Run the XQuartz.pkg installer within the image, granting privileges when requested. 3. Start the XQuartz application. An "X" icon will appear in the taskbar along with a terminal, signaling that XQuartz is waiting for connections. You can minimize the terminal, but do not close it. @@ -14,13 +15,15 @@ 1. Download the installer image: [Docker Toolbox for Mac](https://docs.docker.com/toolbox/toolbox_install_mac/) 2. Run the installer, selecting any directory for installation. 3. Choose "Docker Quickstart Terminal" tool -4. You may get an error such as the one below. You need to grant Docker Quickstart Terminal permission to control you computer in System Preferences -> Security -> Privacy -> Privacy -> Accessibility. If it's already checked, uncheck it and check it again. -4. After a couple of minutes the "Waiting for an IP" task should complete. -5. Run the commands below in the same terminal window or by relaunching "Docker Quickstart Terminal". +4. You may get an error such as the one below. You need to grant Docker Quickstart Terminal permission to control you computer in System Preferences -> Security -> Privacy -> Privacy -> Accessibility. If it's already checked, uncheck it and check it again. +5. After a couple of minutes the "Waiting for an IP" task should complete. +6. Run the commands below in the same terminal window or by relaunching "Docker Quickstart Terminal". ## Start HNN + 1. Verify that XQuartz and Docker are running. These will not start automatically after a reboot. To confirm that Docker is running properly, typing `docker info` should return a bunch of output, but no errors. - ``` + + ```bash $ docker info ``` @@ -30,71 +33,92 @@ 1. Download the source code (zip) for our latest HNN release from our [GitHub releases page](https://github.com/jonescompneurolab/hnn/releases) 2. Open the .zip file and click "Extract all". Choose any destination folder on your machine. 3. Open a cmd.exe window and change to the directory part of the extracted HNN release shown below: - ``` + + ```bash $ cd REPLACE-WITH-FOLDER-EXTRACTED-TO/hnn/installer/mac ``` - + * Option 2: Cloning (requires Xcode Command Line Tools) 1. Check that you have Git installed from a terminal window - ``` + + ```bash $ git version git version 2.17.2 (Apple Git-113) ``` + 2. Type the following to clone the repo. If you already have a previous version of the repository, bring it up to date with the command `git pull origin master` instead of the `git clone` command below. - ``` + ```bash $ git clone https://github.com/jonescompneurolab/hnn.git $ cd hnn/installer/mac ``` - -3. Start the Docker container. Note: the jonescompneurolab/hnn Docker image will be downloaded from Docker Hub (about 1.5 GB). The docker-compose command can be used to manage Docker containers described in the specification file docker-compose.yml. The parameter "up" starts the containers (just one in our case) in that file and "-d" starts the docker container in the background. - ``` - [~/hnn/installer/mac]$ docker-compose run -d --name mac_hnn_1 -e "DISPLAY=192.168.99.1:0" hnn - Starting mac_hnn_1 ... done +3. Start the Docker container. Note: the jonescompneurolab/hnn Docker image will be downloaded from Docker Hub (about 2 GB). The `docker-compose` command can be used to manage Docker containers described in the specification file docker-compose.yml. + + ```bash + $ docker-compose run -e "DISPLAY=192.168.99.1:0" hnn + Pulling hnn (jonescompneurolab/hnn:)... + latest: Pulling from jonescompneurolab/hnn + 34dce65423d3: Already exists + 796769e96d24: Already exists + 2a0eada9611d: Already exists + d6830a7cd972: Already exists + ddf2bf28e180: Already exists + 77bf1279b29f: Pull complete + 6c8ddf82616f: Pull complete + a991616934ba: Pull complete + 2cece6240c19: Pull complete + df826e7d26b9: Pull complete + 824d51cbc89d: Pull complete + 0d16f27c744b: Pull complete + Digest: sha256:0c27e2027828d2510a8867773562bbc966c509f45c9921cc2d1973c575d327b3 + Status: Downloaded newer image for jonescompneurolab/hnn:latest ``` - * You can see that the HNN container is running - ``` - $ docker ps -a - CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES - 1fa235c2f831 jonescompneurolab/hnn "/home/hnn_user/star…" 6 seconds ago Up 5 seconds mac_hnn_1 - ``` - - * If starting the GUI doesn't work the first time, the first thing to check is XQuartz settings (see screnshot above). Then restart XQuartz and try starting the HNN container again with - ``` - [~/hnn/installer/mac]$ docker-compose restart - ``` -5. The HNN GUI should show up. Make sure that you can run simulations by clicking the 'Run Simulation' button. This will run a simulation with the default configuration. After it completes, graphs should be displayed in the main window. -6. You can now proceed to running the tutorials at https://hnn.brown.edu/index.php/tutorials/ . Some things to note: - * A directory called "hnn" exists both inside the container (at /home/hnn_user/hnn) and outside (in the directory set by step 2) that can be used to share files between the container and your host OS. + +4. The HNN GUI should show up. Make sure that you can run simulations by clicking the 'Run Simulation' button. This will run a simulation with the default configuration. After it completes, graphs should be displayed in the main window. + * If starting the GUI doesn't work the first time, the first thing to check is XQuartz settings (see screnshot above). Then restart XQuartz and try starting the HNN container again. +5. You can now proceed to running the tutorials at https://hnn.brown.edu/index.php/tutorials/ . Some things to note: + * A directory called "hnn_out" exists both inside the container (at /home/hnn_user/hnn_out) and outside (in the directory set by step 2) that can be used to share files between the container and your host OS. * The HNN repository with sample data and parameter files exists at /home/hnn_user/hnn_source_code. * If you run into problems starting the Docker container or the GUI is not displaying, please see the [Docker troubleshooting section](../docker/README.md#Troubleshooting) +## Stopping Docker Toolbox VM + +The Docker Toolbox VM will remain running the background using some resources. If you are not using HNN, you can shut down the VM by the following command: + + ```bash + $ docker-machine stop + ``` + +## Updgrading to a new version of HNN -## Launching HNN again 1. Verify that XQuartz and Docker are running. XQuartz will not start automatically after a reboot by default. 2. Open a terminal window - ``` + + ```bash $ cd hnn/installer/mac - $ docker-compose restart + $ docker-compose up --no-start + Recreating mac_hnn_1 ... done + $ docker-compose run -e "DISPLAY=192.168.99.1:0" hnn ``` - ## Editing files within HNN container -You may want run commands or edit files within the container. To access a command shell in the container, use [`docker exec`](https://docs.docker.com/engine/reference/commandline/exec/) as shown below: -``` + +You may want run commands or edit files within the container. To access a command shell in the container, start the container using `docker-compose run hnn` in one terminal window and open another terminal to use [`docker exec`](https://docs.docker.com/engine/reference/commandline/exec/) as shown below: + +```bash $ docker exec -ti mac_hnn_1 bash hnn_user@054ba0c64625:/home/hnn_user$ ``` If you'd like to be able to copy files from the host OS without using the shared directory, you do so directly with [`docker cp`](https://docs.docker.com/engine/reference/commandline/cp/). - ## Uninstalling HNN If you want to remove the container and 1.5 GB HNN image, run the following commands from a terminal window. You can then remove Docker Desktop by removing it from your Applications folder. -``` + +```bash $ docker rm -f mac_hnn_1 $ docker rmi jonescompneurolab/hnn ``` diff --git a/installer/mac/native_install.md b/installer/mac/native_install.md index 28ef98681..96d8eb3c8 100644 --- a/installer/mac/native_install.md +++ b/installer/mac/native_install.md @@ -1,23 +1,26 @@ # HNN native install (Mac OS) This method will run HNN without using virtualization, meaning the GUI may feel more responsive and simulations may run slightly faster. However, the procedure is a set of steps that the user must follow, and there is a possibility that differences in the base environment may require additional troubleshooting. Thus, it is best suited for advanced users. For the recommended Docker-based installation please see the instructions below. - - Alternative: [Docker install instructions](README.md) + +- Alternative: [Docker install instructions](README.md) ## Run pre-install checks + 1. The command below will run a script to check for environment variables and python environments that may conflict with these installation instructions. We recommend that you fix the errors before continuing. - ``` + + ```bash curl -s "https://raw.githubusercontent.com/jonescompneurolab/hnn/master/installer/mac/check-pre.sh" | bash ``` - ## Prerequisite 1: XQuartz + 1. Download the installer image (version 2.7.11 tested): https://www.xquartz.org/ 2. Open the .dmg image and run XQuartz.pkg within the image, granting privileges when requested. 3. Start the XQuartz.app by searching for XQuartz in Spotlight (upper right search icon). An "X" icon will appear in the taskbar along with a terminal. We will not use this window because it is difficult to copy and paste into it, so you can close it by clicking on the red x in the upper left corner. - * Alternatively steps 2 and 3 can be run from the terminal app (enter your user password when prompted after the `sudo` command): + - Alternatively steps 2 and 3 can be run from the terminal app (enter your user password when prompted after the `sudo` command): - ``` + ```bash hdiutil attach ~/Downloads/XQuartz-2.7.11.dmg sudo installer -pkg /Volumes/XQuartz-2.7.11/XQuartz.pkg -target / hdiutil detach /Volumes/XQuartz-2.7.11 @@ -26,18 +29,20 @@ This method will run HNN without using virtualization, meaning the GUI may feel ``` ## Opening a terminal window -1. Open up macOS's terminal.app by searching for terminal in Spotlight (upper right search icon). We will use this terminal for running the commands below. +1. Open up macOS's terminal.app by searching for terminal in Spotlight (upper right search icon). We will use this terminal for running the commands below. ## Prerequisite 2: Xcode Command Line Tools The Xcode Command Line Tools package includes utilities for compiling code from the terminal (gcc, make, etc.). This is needed for compiling mod files in NEURON. 1. To install the package, type the following from a terminal.app window: - ``` + + ```bash xcode-select --install ``` - * If you get the following error, you can skip this step. + + - If you get the following error, you can skip this step. `xcode-select: error: command line tools are already installed, use "Software Update" to install updates` 2. Then select `Install` at the prompt @@ -64,7 +69,7 @@ The Xcode Command Line Tools package includes utilities for compiling code from Note: for users wishing to use the command line, the above steps can be accomplished with these commands: -``` +```bash cd /tmp/ curl -O https://neuron.yale.edu/ftp/neuron/versions/v7.6/nrn-7.6.x86_64-osx.pkg sudo installer -pkg /tmp/nrn-7.6.x86_64-osx.pkg -allowUntrusted -target / @@ -73,7 +78,8 @@ sudo installer -pkg /tmp/nrn-7.6.x86_64-osx.pkg -allowUntrusted -target / ## Prerequisite 4: Miniconda (Python 3) 1. Run the commands below from a terminal window (as a regular user). This will create a python environment isolated from other installations on the system. You could use homebrew `brew install python3` if you wish (has been tested with HNN), but this guide will cover the miniconda version. - ``` + + ```bash cd /tmp/ curl -O https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh sh ./Miniconda3-latest-MacOSX-x86_64.sh -b @@ -84,72 +90,84 @@ sudo installer -pkg /tmp/nrn-7.6.x86_64-osx.pkg -allowUntrusted -target / 1. Set the bash (or other shell) environment variables. Note that depending on your shell (bash or c shell you will use the 4 export commands below or the 4 set commands below, respectively) - * bash + - bash - Add the following in your ~/.bash_profile (e.g. type "open ~/.bash_profile" in the terminal without the quotes to edit it): + Add the following to the end your ~/.bash_profile after all lines referring to conda (e.g. type "open ~/.bash_profile" in the terminal without the quotes to edit it): - ``` - export PYTHONPATH=$PYTHONPATH:/Applications/NEURON-7.6/nrn/lib/python - export PATH=$PATH:/Applications/NEURON-7.6/nrn/x86_64/bin + ```bash + export PYTHONPATH=/Applications/NEURON-7.6/nrn/lib/python:$PYTHONPATH + export PATH=/Applications/NEURON-7.6/nrn/x86_64/bin:$PATH export PATH=$PATH:$HOME/miniconda3/bin/ - export NRN_PYLIB="~/anaconda3/lib/libpython3.6m.dylib" + if [[ -n ${CONDA_PREFIX} ]]; then + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${CONDA_PREFIX}/lib + fi ``` - * tcsh + + - tcsh Add the following in your ~/.cshrc and/or ~/.tcshrc (e.g. type "open ~/.cshrc" or as appropriate in the terminal without the quotes to edit the file): - ``` + ```csh set PYTHONPATH=($PYTHONPATH /Applications/NEURON-7.6/nrn/lib/python) set path = ($path /Applications/NEURON-7.6/nrn/x86_64/bin) set path = ($path $HOME/miniconda3/bin/) - set NRN_PYLIB="~/anaconda3/lib/libpython3.6m.dylib" + if ( $?CONDA_PREFIX && "$CONDA_PREFIX" != "" ) then + set LD_LIBRARY_PATH = $CONDA_PREFIX/lib + endif ``` 2. Open a new terminal window for the settings in the previous step to take effect 3. Create a conda environment with the Python prerequisites for HNN. + ```bash + conda create -y -n hnn python=3.7 mpi4py openmpi pyqtgraph pyopengl matplotlib scipy nlopt psutil ``` - conda create -n hnn python=3.6 mpi4py pyqtgraph pyopengl matplotlib scipy - ``` + 4. Activate the HNN conda environment - ``` + ```bash source activate hnn ``` -5. Install some prerequisites with pip - - ``` - pip install nlopt psutil - ``` ## Clone and compile HNN source code + 1. The following commands will clone the source code repository, enter the hnn directory, and compile HNN's mod files for NEURON. This is where Xcode Command Line Tools are needed.: - ``` + + ```bash git clone https://github.com/jonescompneurolab/hnn.git cd hnn make ``` ## Run post-install checks + 1. Run the command below from the HNN source code directory to check that all of the steps above have completed as expected. You may proceed if this script fails, but it could aid in troubleshooting starting the HNN GUI. - ``` + + ```bash installer/mac/check-post.sh ``` ## Run the HNN model + 1. Start the HNN GUI from a terminal window: - ``` + + ```bash source activate hnn python hnn.py ``` -2. The HNN GUI should appear and you should now be able to run the tutorials at https://hnn.brown.edu/index.php/tutorials/ + +2. The HNN GUI should show up. Make sure that you can run simulations by clicking the 'Run Simulation' button. This will run a simulation with the default configuration. After it completes, graphs should be displayed in the main window. + 3. When you run simulations for the first time, the following dialog boxes may pop-up and ask you for permission to allow connections through the firewall. Saying 'Deny' is fine since simulations will just run locally on your Mac. +4. You can now proceed to running the tutorials at https://hnn.brown.edu/index.php/tutorials/ . Some things to note: + * A directory called "hnn_out" exists in your home directory where the results from your simulations (data and param files) will be stored. + # Troubleshooting For Mac OS specific issues: please see the [Mac OS troubleshooting page](troubleshooting.md) diff --git a/installer/ubuntu/README.md b/installer/ubuntu/README.md index 441021a95..733671e83 100644 --- a/installer/ubuntu/README.md +++ b/installer/ubuntu/README.md @@ -1,17 +1,20 @@ # Installing HNN on Ubuntu (Docker install) This guide describes installing HNN on Ubuntu using Docker. This method will automatically download the HNN Docker container image when HNN is started for the first time. If you would prefer to install HNN without Docker, please see the instructions below. - - Alternative: [Native install instructions (advanced users)](native_install.md) -**Note: please verify that your OS supports Docker CE** - - Ubuntu 16.04 and later versions are supported - - See [OS requirements](https://docs.docker.com/install/linux/docker-ce/ubuntu/#os-requirements) - - It may be possible to install older versions of docker meant for earlier Ubuntu OSs. We recommend following the currently supported procedure from Docker, but Ubuntu provides docker in its own repositories, which would be specific for your OS. If a Docker CE package is not available, search for docker.io and docker packages in that order. +- Alternative: [Native install instructions (advanced users)](native_install.md) +## Verify that your OS supports Docker CE + +- Ubuntu 16.04 and later versions are supported +- See [OS requirements](https://docs.docker.com/install/linux/docker-ce/ubuntu/#os-requirements) +- It may be possible to install older versions of docker meant for earlier Ubuntu OSs. We recommend following the currently supported procedure from Docker, but Ubuntu provides docker in its own repositories, which would be specific for your OS. If a Docker CE package is not available, search for docker.io and docker packages in that order. ## Prerequisite: install Docker + 1. To install docker, type the following commands in a terminal (x86_64 only). They are from [Docker's Ubuntu install instructions](https://docs.docker.com/install/linux/docker-ce/ubuntu/) for installing docker-ce from Docker's official repository. - ``` + + ```bash # get prerequisites for adding the docker repository and verifying with the GPG key sudo apt-get update sudo apt-get -y install apt-transport-https ca-certificates curl gnupg-agent software-properties-common @@ -25,45 +28,90 @@ This guide describes installing HNN on Ubuntu using Docker. This method will aut # verify that docker runs sudo docker run hello-world ``` + 2. Add your user to the docker group to avoid having to run docker commands with "sudo" - ``` + + ```bash sudo usermod -a -G docker [username] ``` + 3. Log out and back in (may need to reboot) for the group change to take effect ## Prerequisite: install Docker Compose + Open a bash terminal and run these commands (from [Docker Compose installation](https://docs.docker.com/compose/install/)): - ``` + + ```bash bash -c 'sudo curl -L "https://github.com/docker/compose/releases/download/1.23.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose' sudo chmod +x /usr/local/bin/docker-compose docker-compose --version ``` ## Start HNN + 1. Check that Docker is running properly by typing the following in a new terminal window. + ```bash + $ docker info ``` - docker info - ``` + 2. Clone or download the [HNN repo](https://github.com/jonescompneurolab/hnn). If you already have a previous version of the repository, bring it up to date with the command `git pull origin master` instead of the `git clone` command below. + + ```bash + $ git clone https://github.com/jonescompneurolab/hnn.git + $ cd hnn/installer/docker ``` - git clone https://github.com/jonescompneurolab/hnn.git - cd hnn/installer/docker - ``` -3. Start the Docker container. Note: the jonescompneurolab/hnn Docker image will be downloaded from Docker Hub (about 1.5 GB). The docker-compose command can be used to manage Docker containers described in the specification file docker-compose.yml. The parameter "up" starts the containers (just one in our case) in that file and "-d" starts the docker container in the background. + +3. Start the Docker container. Note: the jonescompneurolab/hnn Docker image will be downloaded from Docker Hub (about 2 GB). The docker-compose command can be used to manage Docker containers described in the specification file docker-compose.yml. + + ```bash + $ docker-compose run hnn + Pulling hnn (jonescompneurolab/hnn:)... + latest: Pulling from jonescompneurolab/hnn + 34dce65423d3: Already exists + 796769e96d24: Already exists + 2a0eada9611d: Already exists + d6830a7cd972: Already exists + ddf2bf28e180: Already exists + 77bf1279b29f: Pull complete + 6c8ddf82616f: Pull complete + a991616934ba: Pull complete + 2cece6240c19: Pull complete + df826e7d26b9: Pull complete + 824d51cbc89d: Pull complete + 0d16f27c744b: Pull complete + Digest: sha256:0c27e2027828d2510a8867773562bbc966c509f45c9921cc2d1973c575d327b3 + Status: Downloaded newer image for jonescompneurolab/hnn:latest ``` - docker-compose up -d - ``` + 4. The HNN GUI should show up. Make sure that you can run simulations by clicking the 'Run Simulation' button. This will run a simulation with the default configuration. After it completes, graphs should be displayed in the main window. 5. You can now proceed to running the tutorials at https://hnn.brown.edu/index.php/tutorials/ . Some things to note: - * A directory called "hnn" exists both inside the container (at /home/hnn_user/hnn) and outside (in the directory set by step 2) that can be used to share files between the container and your host OS. - * If you run into problems starting the Docker container or the GUI is not displaying, please see the [Docker troubleshooting section](../docker/README.md#Troubleshooting) - * If you closed the HNN GUI or it is no longer running, and you would like to restart it, run the following command from the same directory set in step 2: - ``` - docker-compose restart - ``` -5. **NOTE:** You may want run commands or edit files within the container. To access a command prompt in the container, use [`docker exec`](https://docs.docker.com/engine/reference/commandline/exec/) as shown below: + - A directory called "hnn_out" exists both inside the container (at /home/hnn_user/hnn_out) and outside (in the directory set by step 2) that can be used to share files between the container and your host OS. + - The HNN repository with sample data and parameter files exists at /home/hnn_user/hnn_source_code. + - If you run into problems starting the Docker container or the GUI is not displaying, please see the [Docker troubleshooting section](../docker/README.md#Troubleshooting) + +## Updgrading to a new version of HNN + +1. Verify Docker is still running. To confirm that Docker is running properly, typing `docker info` should return a bunch of output, but no errors. + + ```bash + $ docker info + ``` + +2. Open a terminal window + + ```bash + $ cd hnn/installer/docker + $ docker-compose up --no-start + Recreating docker_hnn_1 ... done + $ docker-compose run hnn ``` - C:\Users\myuser>docker exec -ti docker_hnn_1 bash + +## Editing files within HNN container + +You may want run commands or edit files within the container. To access a command shell in the container, start the container using `docker-compose run hnn` in one terminal window and open another terminal to use [`docker exec`](https://docs.docker.com/engine/reference/commandline/exec/) as shown below: + + ```bash + $ docker exec -ti docker_hnn_1 bash hnn_user@054ba0c64625:/home/hnn_user$ ``` @@ -71,13 +119,16 @@ Open a bash terminal and run these commands (from [Docker Compose installation]( ## Uninstalling HNN -1. If you want to just remove the container and 1.5 GB HNN image, run these commands from a terminal window: - ``` - docker rm -f docker_hnn_1 - docker rmi jonescompneurolab/hnn +1. If you want to just remove the container and 2 GB HNN image, run these commands from a terminal window: + + ```bash + $ docker rm -f docker_hnn_1 + $ docker rmi jonescompneurolab/hnn ``` + 2. To continue and remove Docker, follow these instructions from [Uninstall Docker CE](https://docs.docker.com/install/linux/docker-ce/ubuntu/#uninstall-docker-ce) - ``` + + ```bash sudo apt-get purge docker-ce sudo rm -rf /var/lib/docker ``` diff --git a/installer/windows/docker-desktop.md b/installer/windows/docker-desktop.md index adf8339a9..f1f239e5f 100644 --- a/installer/windows/docker-desktop.md +++ b/installer/windows/docker-desktop.md @@ -1,7 +1,9 @@ # Installing HNN on Windows 10 Pro (Docker Desktop) ## Prerequisite: Virtualization support + There are two related requirements needed for Docker to be able to run HNN in a virtual machine on your Windows system + 1. Hardware virtualization features (manual setting) If not already enabled, it may be necessary to manually set these through your PC manufacturer's BIOS settings. Only old systems do not support this feature. However, if Docker cannot turn this feature on from its installer, you may need to reboot your computer and change your PC manufacturer's BIOS settings. You can check whether it is enabled from the Task Manger. The picture below shows that hardware virtualization is disabled and will need to be manually enabled in the BIOS. @@ -24,6 +26,7 @@ There are two related requirements needed for Docker to be able to run HNN in a 3. **If you enabled Hyper-V, please reboot your computer before continuing below to install docker.** ## Prerequisite: VcXsrv + 1. Download the installer from [https://sourceforge.net/projects/vcxsrv/files/latest/download](https://sourceforge.net/projects/vcxsrv/files/latest/download) (click [here](https://downloads.sourceforge.net/project/vcxsrv/vcxsrv/1.20.1.4/vcxsrv-64.1.20.1.4.installer.exe?r=https%3A%2F%2Fsourceforge.net%2Fprojects%2Fvcxsrv%2Ffiles%2Fvcxsrv%2F1.20.1.4%2Fvcxsrv-64.1.20.1.4.installer.exe%2Fdownload%3Fuse_mirror%3Dversaweb%26r%3Dhttps%253A%252F%252Fsourceforge.net%252Fprojects%252Fvcxsrv%252Ffiles%252Flatest%252Fdownload&ts=1550243133) for the direct download link for version 64.1.20.1.4) 2. Run the installer, choosing any installation folder. 3. Start the XLaunch desktop app from the VcXsrv folder in the start menu. @@ -54,12 +57,14 @@ There are two related requirements needed for Docker to be able to run HNN in a 8. Reboot your computer after installing Docker - ## Start HNN + 1. Verify that VcXsrv (XLaunch application) and Docker are running. VcXsrv will not start automatically after a reboot. The Docker Desktop icon should be present in the lower-right dock. To confirm that Docker is running properly, typing the following in a new cmd.exe window. + + ```powershell + C:\Users\myuser> docker info ``` - docker info - ``` + 2. Clone or download the [HNN repo](https://github.com/jonescompneurolab/hnn). **Chose one of the following methods:** * Option 1: Cloning (requires Git for Windows) @@ -67,75 +72,89 @@ There are two related requirements needed for Docker to be able to run HNN in a 1. First install [Git for Windows](https://gitforwindows.org/) 2. Type the following in a cmd.exe window. If you already have a previous version of the repository, bring it up to date with the command `git pull origin master` instead of the `git clone` command below. - ``` + ```powershell C:\Users\myuser> git clone https://github.com/jonescompneurolab/hnn.git C:\Users\myuser> cd hnn\installer\windows + C:\Users\myuser\hnn\installer\windows> ``` - + * Option 2: Downloading a HNN release 1. Download the source code (zip) for our latest HNN release from our [GitHub releases page](https://github.com/jonescompneurolab/hnn/releases) 2. Open the .zip file and click "Extract all". Choose any destination folder on your machine. 3. Open a cmd.exe window and change to the directory part of the extracted HNN release shown below: - ``` + + ```powershell C:\Users\myuser> cd REPLACE-WITH-FOLDER-EXTRACTED-TO\hnn\installer\windows + C:\Users\myuser\hnn\installer\windows> ``` -3. Start the Docker container. Note: the jonescompneurolab/hnn Docker image will be downloaded from Docker Hub (about 1.5 GB). The docker-compose command can be used to manage Docker containers described in the specification file docker-compose.yml. The parameter "up" starts the containers (just one in our case) in that file and "-d" starts the docker container in the background. +3. Start the Docker container. Note: the jonescompneurolab/hnn Docker image will be downloaded from Docker Hub (about 2 GB). The docker-compose command can be used to manage Docker containers described in the specification file docker-compose.yml. + + ```powershell + C:\Users\myuser\hnn\installer\windows> docker-compose run hnn + Pulling hnn (jonescompneurolab/hnn:)... + latest: Pulling from jonescompneurolab/hnn + 34dce65423d3: Already exists + 796769e96d24: Already exists + 2a0eada9611d: Already exists + d6830a7cd972: Already exists + ddf2bf28e180: Already exists + 77bf1279b29f: Pull complete + 6c8ddf82616f: Pull complete + a991616934ba: Pull complete + 2cece6240c19: Pull complete + df826e7d26b9: Pull complete + 824d51cbc89d: Pull complete + 0d16f27c744b: Pull complete + Digest: sha256:0c27e2027828d2510a8867773562bbc966c509f45c9921cc2d1973c575d327b3 + Status: Downloaded newer image for jonescompneurolab/hnn:latest ``` - C:\Users\myuser\hnn\installer\windows> docker-compose up -d - Starting windows_hnn_1 ... done - ``` - * You can see that the HNN container is running - ``` - C:\Users\myuser> docker ps -a - CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES - 1fa235c2f831 jonescompneurolab/hnn "/home/hnn_user/star…" 6 seconds ago Up 5 seconds windows_hnn_1 - ``` - - * If starting the GUI doesn't work the first time, the first thing to check is VcXsrv settings have "Disable access control" (see above). Then restart VcXsrv and try starting the HNN container again with - ``` - C:\Users\myuser\hnn\installer\windows> docker-compose restart - ``` + 4. If a prompt appears from the lower-right and ask you to share the drive, click 'Share'. + * If starting the GUI doesn't work the first time, the first thing to check is VcXsrv settings have "Disable access control" (see above). Then restart VcXsrv and try starting the HNN container again. 5. A window will pop up stating "Docker needs to access your computer's filesystem". This is necessary to share data and parameter files that HNN creates with your Windows OS. Enter your Windows login password. 6. The HNN GUI should show up. Make sure that you can run simulations by clicking the 'Run Simulation' button. This will run a simulation with the default configuration. After it completes, graphs should be displayed in the main window. 7. You can now proceed to running the tutorials at https://hnn.brown.edu/index.php/tutorials/ . Some things to note: - * A directory called "hnn" exists both inside the container (at /home/hnn_user/hnn) and outside (in the directory set by step 2) that can be used to share files between the container and your host OS. + * A directory called "hnn_out" exists both inside the container (at /home/hnn_user/hnn_out) and outside (in the directory set by step 2) that can be used to share files between the container and your host OS. * The HNN repository with sample data and parameter files exists at /home/hnn_user/hnn_source_code * If you run into problems starting the Docker container or the GUI is not displaying, please see the [Docker troubleshooting section](../docker/README.md#Troubleshooting) +## Updgrading to a new version of HNN -## Launching HNN again 1. Verify that VcXsrv and Docker are running. VcXsrv will not start automatically after a reboot by default. 2. Open a Command Prompt (cmd.exe) - ``` + + ```powershell C:\Users\myuser> cd hnn\installer\windows - C:\Users\myuser> docker-compose restart + C:\Users\myuser\hnn\installer\windows> docker-compose up --no-start + Recreating mac_hnn_1 ... done + C:\Users\myuse\rhnn\installer\windows> docker-compose run hnn ``` ## Editing files within HNN container -You may want run commands or edit files within the container. To access a command shell in the container, use [`docker exec`](https://docs.docker.com/engine/reference/commandline/exec/) as shown below: -``` + +You may want run commands or edit files within the container. To access a command shell in the container, start the container using `docker-compose run hnn` in one Command Prompt window and open another Command Prompt window to use [`docker exec`](https://docs.docker.com/engine/reference/commandline/exec/) as shown below: + +```powershell C:\Users\myuser> docker exec -ti windows_hnn_1 bash hnn_user@054ba0c64625:/home/hnn_user$ ``` If you'd like to be able to copy files from the host OS without using the shared directory, you do so directly with [`docker cp`](https://docs.docker.com/engine/reference/commandline/cp/). - ## Uninstalling HNN If you want to remove the container and 1.5 GB HNN image, run the following commands from a cmd.exe window. You can then remove Docker Desktop using "Add/Remove Programs" -``` + +```powershell C:\Users\myuser> docker rm -f windows_hnn_1 C:\Users\myuser> docker rmi jonescompneurolab/hnn ``` - # Troubleshooting If you run into other issues with the installation, please [open an issue on our GitHub](https://github.com/jonescompneurolab/hnn/issues). Our team monitors these issues and will be able to suggest possible fixes. diff --git a/installer/windows/docker-toolbox.md b/installer/windows/docker-toolbox.md index 4a93b984b..be01af835 100644 --- a/installer/windows/docker-toolbox.md +++ b/installer/windows/docker-toolbox.md @@ -5,12 +5,13 @@ Nearly all PC's have this feature, but it may not be enabled by default. If not already enabled, it may be necessary to manually set these through your PC manufacturer's BIOS settings. However, if Docker cannot turn this feature on from its installer, you may need to reboot your computer and change your PC manufacturer's BIOS settings. You can check whether it is enabled from the Task Manger. The picture below shows that hardware virtualization is disabled and will need to be manually enabled in the BIOS. - + See [https://www.trishtech.com/2017/08/check-if-virtualization-is-enabled-in-windows-10](https://www.trishtech.com/2017/08/check-if-virtualization-is-enabled-in-windows-10) for more details. If you run into problems enabling hardware virtualization support, we recommend that you follow the [native install instructions](native_install.md) instead. Also running our [VirtualBox VM with HNN pre-installed](https://hnn.brown.edu/index.php/installation-instructions/) is possible without hardware virtualization support. ## Prerequisite: VcXsrv (XLaunch) + 1. Download the installer from [https://sourceforge.net/projects/vcxsrv/files/latest/download](https://sourceforge.net/projects/vcxsrv/files/latest/download) * Here's the link to the [direct download of version 64.1.20.1.4](https://downloads.sourceforge.net/project/vcxsrv/vcxsrv/1.20.1.4/vcxsrv-64.1.20.1.4.installer.exe?r=https%3A%2F%2Fsourceforge.net%2Fprojects%2Fvcxsrv%2Ffiles%2Fvcxsrv%2F1.20.1.4%2Fvcxsrv-64.1.20.1.4.installer.exe%2Fdownload%3Fuse_mirror%3Dversaweb%26r%3Dhttps%253A%252F%252Fsourceforge.net%252Fprojects%252Fvcxsrv%252Ffiles%252Flatest%252Fdownload&ts=1550243133) 2. Run the installer, choosing any installation folder. @@ -26,30 +27,33 @@ If you run into problems enabling hardware virtualization support, we recommend 1. Download the installer: [Docker Toolbox for Windows](https://docs.docker.com/toolbox/toolbox_install_windows/) 2. Run the installer. Click 'Yes' to allow the application to make changes to your device. 3. In "Select Components" check the components "Docker Compose for Windows" and "VirtualBox". "Kitematic" is not needed. Click 'Next'. -3. In "Select Additional Tasks", make sure to **check "Add docker binaries to PATH"**. Click 'Next'. -4. Choose the default for the other options and click 'Install'. -5. Setup will run "pre-create checks" in the "Docker Quickstart Terminal" window and then install VirtualBox -6. When the installer has finished, it will leave a "Docker Quickstart Terminal" window open. Use this window for the remaining commands below +4. In "Select Additional Tasks", make sure to **check "Add docker binaries to PATH"**. Click 'Next'. +5. Choose the default for the other options and click 'Install'. +6. Setup will run "pre-create checks" in the "Docker Quickstart Terminal" window and then install VirtualBox +7. When the installer has finished, it will leave a "Docker Quickstart Terminal" window open. Use this window for the remaining commands below * If, during installation, you get the error message shown below, hardware support for virtualization isn't turned on, which is required for Docker on Windows. This may be fixable by changing settings in your PC manufacturer's BIOS. See the note on "Hardware virtualization features" under the "Prerequisite: Virtualization support" heading at the top of this page. -7. We want HNN to use all of the CPU cores available on your system when it runs a simulation, and Docker only uses half by default. To change this setting we need to first stop the Docker VM that was started above in step 5. +8. We want HNN to use all of the CPU cores available on your system when it runs a simulation, and Docker only uses half by default. To change this setting we need to first stop the Docker VM that was started above in step 5. ``` $ docker-machine stop ``` -8. Type 'VirtualBox' into the start menu search bar and launch "Oracle VM VirtualBox" -9. Click on the VM "default" in the left pane and then click "Settings" -10. Navigate to "System", then the "Processor" tab and move the slider all the way to the right. +9. Type 'VirtualBox' into the start menu search bar and launch "Oracle VM VirtualBox" +10. Click on the VM "default" in the left pane and then click "Settings" +11. Navigate to "System", then the "Processor" tab and move the slider all the way to the right. -11. Click 'Ok', then restart "Docker Quickstart Terminal". When you get the "interactive shell" prompt, you can continue on. +12. Click 'Ok', then restart "Docker Quickstart Terminal". When you get the "interactive shell" prompt, you can continue on. ## Start HNN + 1. Verify that VcXsrv (XLaunch application) and Docker are running. Both will not start automatically after a reboot. The Docker Desktop icon should be present in the lower-right dock. To confirm that Docker is running properly, typing `docker info` should return a bunch of output, but no errors. - ``` + + ```bash $ docker info ``` + 2. Clone or download the [HNN repo](https://github.com/jonescompneurolab/hnn). **Chose one of the following methods:** * Option 1: Downloading a HNN release @@ -57,7 +61,8 @@ If you run into problems enabling hardware virtualization support, we recommend 1. Download the source code (zip) for our latest HNN release from our [GitHub releases page](https://github.com/jonescompneurolab/hnn/releases) 2. Open the .zip file and click "Extract all". Choose any destination folder on your machine. 3. In the terminal, change to the directory part of the extracted HNN release shown below: - ``` + + ```bash $ cd REPLACE-WITH-FOLDER-EXTRACTED-TO\hnn\installer\windows ``` @@ -66,54 +71,70 @@ If you run into problems enabling hardware virtualization support, we recommend 1. If you didn't install Git for Windows aboe (not reuired), download the installer at [Git for Windows](https://gitforwindows.org/) 2. If you already have a previous version of the repository, bring it up to date with the command `git pull origin master` instead of the `git clone` command below. - ``` + ```bash $ cd ~ $ git clone https://github.com/jonescompneurolab/hnn.git $ cd hnn/installer/windows ``` -3. Start the Docker container. Note: the jonescompneurolab/hnn Docker image will be downloaded from Docker Hub (about 1.5 GB). The docker-compose command can be used to manage Docker containers described in the specification file docker-compose.yml. The parameter "up" starts the containers (just one in our case) in that file and "-d" starts the docker container in the background. +3. Start the Docker container. Note: the jonescompneurolab/hnn Docker image will be downloaded from Docker Hub (about 2 GB). The docker-compose command can be used to manage Docker containers described in the specification file docker-compose.yml. + + ```bash + $ docker-compose run -e "DISPLAY=192.168.99.1:0" hnn + Pulling hnn (jonescompneurolab/hnn:)... + latest: Pulling from jonescompneurolab/hnn + 34dce65423d3: Already exists + 796769e96d24: Already exists + 2a0eada9611d: Already exists + d6830a7cd972: Already exists + ddf2bf28e180: Already exists + 77bf1279b29f: Pull complete + 6c8ddf82616f: Pull complete + a991616934ba: Pull complete + 2cece6240c19: Pull complete + df826e7d26b9: Pull complete + 824d51cbc89d: Pull complete + 0d16f27c744b: Pull complete + Digest: sha256:0c27e2027828d2510a8867773562bbc966c509f45c9921cc2d1973c575d327b3 + Status: Downloaded newer image for jonescompneurolab/hnn:latest ``` - $ docker-compose run -d --name windows_hnn_1 -e "DISPLAY=192.168.99.1:0" hnn - windows_hnn_1 - ``` - * You can see that the HNN container is running - ``` - $ docker ps -a - CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES - 1fa235c2f831 jonescompneurolab/hnn "/home/hnn_user/star…" 6 seconds ago Up 5 seconds windows_hnn_1 - ``` - - * If starting the GUI doesn't work the first time, the first thing to check is VcXsrv settings have "Disable access control" (see above). Then restart VcXsrv and try starting the HNN container again with - ``` - $ docker restart windows_hnn_1 - ``` + 4. A window will pop up stating "Docker needs to access your computer's filesystem". This is necessary to share data and parameter files that HNN creates with your Windows OS. Enter your Windows login password. 5. The HNN GUI should show up. Make sure that you can run simulations by clicking the 'Run Simulation' button. This will run a simulation with the default configuration. After it completes, graphs should be displayed in the main window. + * If starting the GUI doesn't work the first time, the first thing to check is VcXsrv settings have "Disable access control" (see above). Then restart VcXsrv and try starting the HNN container again. 6. You can now proceed to running the tutorials at https://hnn.brown.edu/index.php/tutorials/ . Some things to note: - * A directory called "hnn" exists both inside the container (at /home/hnn_user/hnn) and outside (in the directory set by step 2) that can be used to share files between the container and your host OS. + * A directory called "hnn_out" exists both inside the container (at /home/hnn_user/hnn_out) and outside (in the directory set by step 2) that can be used to share files between the container and your host OS. * The HNN repository with sample data and parameter files exists at /home/hnn_user/hnn_source_code * If you run into problems starting the Docker container or the GUI is not displaying, please see the [Docker troubleshooting section](../docker/README.md#Troubleshooting) +## Stopping Docker Toolbox VM + +The Docker Toolbox VM will remain running the background using some resources. If you are not using HNN, you can shut down the VM by the following command: + + ```bash + $ docker-machine stop + ``` + +## Updgrading to a new version of HNN -## Launching HNN again 1. Verify that XLaunch and Docker are running. Both will not start automatically after a reboot by default. 2. Open a "Docker Quickstart Terminal" and type - ``` + + ```bash $ cd hnn/installer/windows - $ docker restart windows_hnn_1 + $ docker-compose up --no-start + Recreating mac_hnn_1 ... done + $ docker-compose run hnn ``` -3. To stop the HNN and Docker Toolbox - ``` - $ docker-machine stop - ``` ## Editing files within HNN container + You may want run commands or edit files within the container. To access a command shell in the container, use [`docker exec`](https://docs.docker.com/engine/reference/commandline/exec/) as shown below: -``` + +```bash $ docker exec -ti windows_hnn_1 bash hnn_user@054ba0c64625:/home/hnn_user$ ``` @@ -123,12 +144,12 @@ If you'd like to be able to copy files from the host OS without using the shared ## Uninstalling HNN If you want to remove the container and 1.5 GB HNN image, run the following commands from a quickstart terminal window. You can then remove Docker Desktop using "Add/Remove Programs" -``` + +```bash $ docker rm -f windows_hnn_1 $ docker rmi jonescompneurolab/hnn ``` - # Troubleshooting If you run into other issues with the installation, please [open an issue on our GitHub](https://github.com/jonescompneurolab/hnn/issues). Our team monitors these issues and will be able to suggest possible fixes. diff --git a/installer/windows/hnn.ps1 b/installer/windows/hnn.ps1 index f9dbee53a..555c230b6 100644 --- a/installer/windows/hnn.ps1 +++ b/installer/windows/hnn.ps1 @@ -448,13 +448,14 @@ elseif ($null -ne $script:CONDA_PATH) { if (!$script:env_exists) { Write-Host "Setting up anaconda hnn environment..." - conda create -y -n hnn python=3.7 PyOpenGL pyqtgraph matplotlib scipy conda psutil - pip3 install nlopt + # python 3.7 doesn't work with NEURON (tried 7.7) as of 8/19/19 + conda create -y -n hnn python=3.6 PyOpenGL pyqtgraph matplotlib scipy conda psutil + Start-Process "$CONDA_ENV\Scripts\pip3" "install nlopt" -Wait Set-Location $CONDA_ENV mkdir .\etc\conda\activate.d 2>&1>$null mkdir .\etc\conda\deactivate.d 2>&1>$null - "set NRN_PYLIB=$script:PYTHON_DLL" | Set-Content "$CONDA_ENV\etc\conda\activate.d\env_vars.bat" + #"set NRN_PYLIB=$script:PYTHON_DLL" | Set-Content "$CONDA_ENV\etc\conda\activate.d\env_vars.bat" "set PYTHONHOME=$CONDA_ENV" | Add-Content "$CONDA_ENV\etc\conda\activate.d\env_vars.bat" } else { diff --git a/installer/windows/native_install.md b/installer/windows/native_install.md index 32d316482..ace2b8905 100644 --- a/installer/windows/native_install.md +++ b/installer/windows/native_install.md @@ -1,49 +1,59 @@ # HNN native install (Windows) This method will run HNN without using virtualization, meaning the GUI may feel more responsive and simulations may run slightly faster. However, the procedure is a set of steps that the user must follow, and there is a possibility that differences in the base environment may require additional troubleshooting. Thus, it is best suited for advanced users. For the recommended Docker-based installation please see the instructions below. - - Alternative: [Docker install instructions](README.md) + +- Alternative: [Docker install instructions](README.md) A [PowerShell install script](hnn.ps1) will manage downloading all prerequisites except Microsoft MPI which requires a web browser to download. If the script finds msmpisetup.exe in the Downloads folder, it will take care of installing it. ## Requirements - - A 64-bit OS - - Windows 7 or later. Windows Vista is not supported for lack of multiprocessing support. - - PowerShell version 1.0 or later. If PowerShell is not installed, please follow the link below for downloading and running the PowerShell installer: - https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell + +- A 64-bit OS +- Windows 7 or later. Windows Vista is not supported for lack of multiprocessing support. +- PowerShell version 1.0 or later. If PowerShell is not installed, please follow [this link](https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell) for downloading and running the PowerShell installer. ## Prerequisite: Microsoft MPI -1. Download Microsoft MPI (msmpisetup.exe) from the link below and save it to the user's Downloads folder (C:\Users\\[MY_USERNAME]\Downloads): https://msdn.microsoft.com/en-us/library/bb524831.aspx +1. Download Microsoft MPI (msmpisetup.exe) from [this link](https://msdn.microsoft.com/en-us/library/bb524831.aspx) and save it to the user's Downloads folder (C:\Users\\[MY_USERNAME]\Downloads). ## Run install script 1. Run the script from a cmd prompt: - ``` + + ```powershell @"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/jonescompneurolab/hnn/master/installer/windows/hnn.ps1'))" ``` + OR from a powershell prompt: - ``` + + ```powershell Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/jonescompneurolab/hnn/master/installer/windows/hnn.ps1')) ``` - OR from a local copy: - ``` - powershell.exe -ExecutionPolicy Bypass -File .\hnn\installer\windows\hnn.ps1 + + OR from a local copy (already checked out with git): + + ```powershell + cd hnn + powershell.exe -ExecutionPolicy Bypass -File .\installer\windows\hnn.ps1 ``` - * There will be a permission prompt to install Microsoft MPI and a couple of terminal windows will + + - There will be a permission prompt to install Microsoft MPI and a couple of terminal windows will open up. There will be a prompt for pressing ENTER after nrnmech.dll has been built - * If an existing Python 3.X installation isn't found, expect that installation will pause for ~5min while installing Miniconda + - If an existing Python 3.X installation isn't found, expect that installation will pause for ~5min while installing Miniconda 2. After the script has completed, instructions will be displayed for using the environment either with virtualenv or Miniconda. Open up a new cmd.exe window (not PowerShell) for the environment variables to get set in the session. 3. Run: - ``` + + ```powershell activate hnn cd hnn python hnn.py ``` + 4. That will launch the HNN GUI. You should now be able to run the tutorials at https://hnn.brown.edu/index.php/tutorials/ # Troubleshooting If you run into other issues with the installation, please [open an issue on our GitHub](https://github.com/jonescompneurolab/hnn/issues). Our team monitors these issues and will investigate possible fixes. -For other HNN software issues, please visit the [HNN bulletin board](https://www.neuron.yale.edu/phpBB/viewforum.php?f=46) \ No newline at end of file +For other HNN software issues, please visit the [HNN bulletin board](https://www.neuron.yale.edu/phpBB/viewforum.php?f=46)