JupyterHub Advanced Tools
JupyterLab🔗
JupyterLab is available from the Apps menu. It allows to run Jupyter notebooks interacting with Modelon Impact. For more information about JupyterLab, see the JupyterLab documentation.
Run a Jupyter Notebook🔗
To run a Jupyter notebook in JupyterLab, find the notebook in the file browser, double-click it to view it, and hit the 'play' button to run the notebook cell by cell, or the 'fast forward' button to run the entire notebook.
Visual Studio Code🔗
VS (Visual Studio) Code provides an option for experienced users to perform advanced operations:
- File browser - browse through the files on your user disk on JupyterHub
- Advanced version control operations
- Opening a Terminal window
- Adding / Removing Extensions
Version Control in Visual Studio Code🔗
This section provides some tips for how to do version control operations which are currently not supported by the Modelon Workspace Management using Visual Studio code.
View differences local vs. remote🔗
For a version controlled repository, the differences of the local working copy with the remote repository can be viewed file by file. To do this:
- Go to the "Source control" view in the left sidebar in Visual Studio Code
- Click the file in the list of changed files to view the diff.
Edit conflicts🔗
When there are conflicts between the local modifications to the working copy and remote updates, these can be edited file by file, conflict by conflict, in Visual Studio Code.
- Go to the "Source control" view in the left sidebar in Visual Studio Code
- Click on a conflicted file in the list of changed files to view the diff
- For each conflict, select any of the options to resolve the conflict, e.g. "Accept Current Change". The code can also be edited manually.
- When all conflicts in the file have been resolved, Visual Studio code requests to mark the conflicted file as resolved. Click "Yes" to mark the conflict in this file as resolved.
- Do steps 2-4 for all conflicted files in the list (marked by "C"). All conflicts are now resolved and any changes can be committed from the Workspace Management
Server Management🔗
Sever management is available from the Apps menu. This page provides basic information about the Modelon Impact and Collaboration plugin versions and the current disk usage.
It also allows to:
- Log out from JupyterHub
- Restart the Modelon Impact server (button available through "Environment variables"
- Setting environment variables
Adding a Web-app🔗
To add a web app in Modelon Impact on JupyterHub:
- Open VS Code in Browser
- Paste requested web-app into "/home/jovyan/impact/customizations"
- Go back to Modelon Impact and refresh it (CTRL+R).
- Web-app will be visible under the App drop down menu.
Adding a Custom Function🔗
To add a custom function in Modelon Impact on JupyterHub:
- Open VS Code in Browser
- Paste requested custom function into "/home/jovyan/impact/custom_functions"
- Go back to Modelon Impact and refresh it (CTRL+R).
- Custom function will be visible under the Play (run) button when any model is opened.
Allocating More Memory🔗
Some models need more memory allocation for successful compilation. To allocate more memory for Modelon Impact on JupyterHub:
- Go to Server management in the Apps drop-down.
- Choose ENVIRONMENT VARIABLES and click on set environment variables using VS Code. This will open "/home/jovyan/.impact/setenv.sh" file including all environment variables.
- Add a row to allocate more memory, e.g. export IMPACT_COMPILATION_JVM_MEM_OPT=-Xmx8g to allocate 8GB RAM (default is 4GB).
- Save this file (CTRL+S).
- Restart the server using the "Restart Impact" button on the server management page.