This project runs the Granta MI:Scripting Toolkit V2 for Python inside a docker container for development purposes.
- Docker and Docker Compose
- A My Granta account
-
Make sure you have docker installed.
-
Download the MIScriptingToolkit V2.
- Click on "Restricted" on the left side and login with your My Granta account.
- Click on "Download" on the left side in the Download Software section.
- Select the Granta MI version that you require. The MI:Scripting Toolkit V2 requires at least Granta MI v11.0.
- Select "Options".
- Scroll down to "MI:Scripting Toolkit v2.0 for Python" and download the zip file.
-
Copy the zip file to the
Toolkit_zip_filesfolder.NOTE: Currently only version 2.0 of the scripting toolkit is supported.
-
Run
docker-compose buildto build the container.NOTE: If you would like to install additional python packages into the image you can list these in the included
requirements.txtfile. You will then need to run the previous build command again.
- Run
docker-compose run mstkto run the container and drop into an interactive shell. This requires you be in the directory with the includeddocker-compose.ymlfile.- Alternatively, you can run
docker run -it mstkfrom anywhere, given you have built the image.
- Alternatively, you can run
- Run
docker-compose run mstk pythonto run the container and drop into a Python REPL.- Alternatively, you can uncomment the
commandportion of thedocker-compose.ymlfile and rundocker-compose run mstkto acheive the same effect. - Alternatively, you can run
docker run -it mstk pythonfrom anywhere, given you have built the image. - You can verify you have the toolkit available by typing
from GRANTA_MIScriptingToolkit import granta as gdlinto your REPL.
- Alternatively, you can uncomment the
- If you would like to mount a folder from your host into the mstk docker container, uncomment the
volumessection of thedocker-compose.ymlfile and put in the path to the folder you would like to mount.
- The Granta:MI Scripting Toolkit documentation can be found in the zip file that was downloaded. Unzip the file and open up the docs index file at
MI_ScriptingToolkit_v2.0.0_for_Python/HTML5/index.htm.
If you would like to build upon this docker image you must follow the above build instructions first listed in the Getting Started section. Then in your Dockerfile begin with FROM mstk. That's it! Your new docker image will now have the Granta:MI Scripting Toolkit available in the system Python environment.
- Data Lifecycle Management Team - https://github.com/orgs/LLNL/teams/dlm
- Joe Eklund - https://github.com/joe-eklund
- Sam Eklund - https://github.com/samueldeklund
- Sam Maphey - https://github.com/sammaphey
Create an issue or fork and open a PR if you'd like to contribute.
mstk-docker is distributed under the terms of the MIT license. All new contributions must be made under this license.
LLNL-CODE-766762
SPDX-License-Identifier: MIT