Skip to content

Commit

Permalink
Merge branch 'main' into feat/show-by-default
Browse files Browse the repository at this point in the history
  • Loading branch information
clatapie authored Jul 28, 2023
2 parents 001e67e + 23bbfea commit b51b086
Show file tree
Hide file tree
Showing 27 changed files with 1,273 additions and 217 deletions.
26 changes: 17 additions & 9 deletions .devcontainer/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ with your custom image:
- '50055:50055'
image: 'ghcr.io/myaccount/mapdlimage:mytag'
user: "0:0"
volumes:
.. warning:: Also you might need to change some environment variables or Docker options to adjust to your image configuration.
For example you might need to change the :envvar:`AWP_ROOT222` if you MAPDL container does not have the installation in the default directory.
Be careful to not commit those changes in your PRs.

You can now open the current folder (or PyMAPDL repository) using
Expand All @@ -76,22 +76,30 @@ License
-------

As mentioned before, you must have a valid license to run MAPDL.
When you launch the container, the file :file:`script.sh` automatically checks if the environment
variable :envvar:`ANSYSLMD_LICENSE_FILE` exists.
When you launch the container, the file :file:`script.sh` automatically
checks if the environment variable :envvar:`ANSYSLMD_LICENSE_FILE` exists.
This environment variable sets the port and IP address of the license server.
If you do not have set this environment variable before launching the
container, you are prompt to enter your license server port and address.

If you do not have set this environment variable before launching the container, you are prompt to enter
your license server port and address.

You can set your license using the environment variable :envvar:`ANSYSLMD_LICENSE_FILE` from the terminal before launching
VS Code. This is recommended if you are using Windows OS.
For example, if you have a license server at the address ``123.45.67.89``, you can set the license using:
You can set the environment variable :envvar:`ANSYSLMD_LICENSE_FILE`
from the terminal before launching VS Code.
This is recommended if you are using Windows OS.
For example, if you have a license server at the address ``123.45.67.89``,
you can set the license using:

.. code:: pwsh-session
$env:ANSYSLMD_LICENSE_FILE = '[email protected]'
code . # launch VS Code
On Linux

.. code:: bash
$ export ANSYSLMD_LICENSE_FILE [email protected]
code . # launch VS Code
And then open the folder in the container using the *Command palette*.


Expand Down
15 changes: 4 additions & 11 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
// Uncomment the next line if you want to keep your containers running after VS Code shuts down.
// "shutdownAction": "none",
// Uncomment the next line to run commands after the container is created - for example installing curl.
"postCreateCommand": "/bin/bash ./.devcontainer/script.sh", //"'pkill -9 -f ansys_inc/v222/ansys'",
"postCreateCommand": "/bin/bash ./.devcontainer/script.sh",

// Uncomment to connect as a non-root user if you've added one. See https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "root",
Expand All @@ -35,20 +35,13 @@
]
},
"vscode": {
"openFiles": [
".devcontainer/README.rst"
],
"extensions": [
"hbenl.vscode-test-explorer",
"LittleFoxTeam.vscode-python-test-adapter",
"ms-azuretools.vscode-docker",
"ms-python.python",
"ms-vscode-remote.remote-containers",
"ms-vscode-remote.remote-ssh-edit",
"ms-vscode-remote.remote-ssh",
"ms-vscode-remote.remote-wsl",
"ms-vscode-remote.vscode-remote-extensionpack",
"ms-vscode.remote-explorer",
"njpwerner.autodocstring",
"VisualStudioExptTeam.vscodeintellicode",
"yzhang.markdown-all-in-one",
]
}
}
Expand Down
61 changes: 24 additions & 37 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,51 +1,38 @@
# Requirements
# ------------
#
# You should have a valid `ANSYSLMD_LICENSE_FILE` env var. For example:
#
# $ ANSYSLMD_LICENSE_FILE=1055@myserver
#
# This env var will be copied to the container `.bashrc` file so it will
# be available in the future runs.
# If you do not have a valid env var when starting the container, you will
# be prompted through the terminal to input a valid port and IP for the
# license server.

version: '3.3'
services:
# Update this to the name of the service you want to work with in your docker-compose.yml file
mapdldev:
# If you want add a non-root user to your Dockerfile, you can use the "remoteUser"
# property in devcontainer.json to cause VS Code its sub-processes (terminals, tasks,
# debugging) to execute as the user. Uncomment the next line if you want the entire
# container to run as this user instead. Note that, on Linux, you may need to
# ensure the UID and GID of the container user you create matches your local user.
# See https://aka.ms/vscode-remote/containers/non-root for details.
#
# user: vscode

# Uncomment if you want to override the service's Dockerfile to one in the .devcontainer
# folder. Note that the path of the Dockerfile and context is relative to the *primary*
# docker-compose.yml file (the first in the devcontainer.json "dockerComposeFile"
# array). The sample below assumes your primary file is in the root of your project.
#
# build:
# context: .
# dockerfile: .devcontainer/Dockerfile
restart: always
shm_size: '8gb'
shm_size: '8gb' # Increase the shared memory directory
# to avoid running issues. By Default this is very small (64MB)
container_name: mapdldev
mem_reservation: 8g
environment:
- ANSYS_LOCK=OFF
- AWP_ROOT222=/ansys_inc
- ANSYSLMD_LICENSE_FILE=${ANSYSLMD_LICENSE_FILE}
- PYANSYS_OFF_SCREEN=true
- ANSYS_LOCK=OFF # Avoid lock file creation.
- AWP_ROOT222=/ansys_inc # Specifying the installation directory
- ANSYSLMD_LICENSE_FILE=${ANSYSLMD_LICENSE_FILE} # License server env var
- PYANSYS_OFF_SCREEN=true # To avoid plotting.
ports:
- '50052:50052'
- '50055:50055'
image: 'ghcr.io/pyansys/mapdl:v22.2-ubuntu'
- '50052:50052' # For the gRPC server
- '50055:50055' # For the DB server
image: 'ghcr.io/ansys/mapdl:v22.2-ubuntu'
user: "0:0"
volumes:
# Update this to wherever you want VS Code to mount the folder of your project
# Update this to wherever you want VS Code to mount the folder of your project inside the container.
- ../:/local:cached

# Uncomment the next line to use Docker from inside the container. See https://aka.ms/vscode-remote/samples/docker-from-docker-compose for details.
# - /var/run/docker.sock:/var/run/docker.sock

# Uncomment the next four lines if you will use a ptrace-based debugger like C++, Go, and Rust.
# cap_add:
# - SYS_PTRACE
# security_opt:
# - seccomp:unconfined

# Overrides default command so things don't shut down after the process ends.
entrypoint: /bin/bash -c "echo 'Container is ready. You can now attach to it.'; while sleep 10000; do :; done"
entrypoint: /bin/bash -c "echo 'Container is ready. You can now attach to it at the port 50052'; while sleep 10000; do :; done"

7 changes: 7 additions & 0 deletions .devcontainer/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,11 @@ if [[ -z "${ANSYSLMD_LICENSE_FILE}" ]]; then
else
echo "ANSYSLMD_LICENSE_FILE was found."
echo "It is defined as ${ANSYSLMD_LICENSE_FILE}"

# Storing env var in .bashrc file so it is automatically loaded.
printf "\n%s\n" "ANSYSLMD_LICENSE_FILE=${ANSYSLMD_LICENSE_FILE}" >> ~/.bashrc

# Activating the new configuration
source ~/.bashrc

fi
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,12 @@ jobs:
run: |
xvfb-run make -C doc html SPHINXOPTS="-j auto -W --keep-going"
- name: "Substitute defective GIF"
run: |
cd doc/_build/html/examples/gallery_examples/00-mapdl-examples
cp ../../../../../source/images/dcb.gif ../../../_images/
sed -i 's+../../../_images/sphx_glr_composite_dcb_004.gif+../../../_images/dcb.gif+g' composite_dcb.html
cd ../../../../../../
- name: "Upload HTML Documentation"
uses: actions/upload-artifact@v3
with:
Expand Down
4 changes: 4 additions & 0 deletions doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,7 @@ linkcheck:
@echo
@echo "Check finished. Report is in $(LINKCHECKDIR)."

html-noexamples:
@$(SPHINXBUILD) -D plot_gallery=0 -b html "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)."
1 change: 1 addition & 0 deletions doc/source/api/geometry.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ Geometry
:toctree: _autosummary

mapdl_geometry.Geometry
mapdl_geometry.LegacyGeometry
Binary file added doc/source/images/dcb.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/source/images/multiblock_pic1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/source/images/multiblock_pic2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/source/images/multiblock_pic3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit b51b086

Please sign in to comment.