Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: combine the docker-compose files #3169

Merged
merged 11 commits into from
Jun 18, 2024
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ docker/mapdl/v211
docker/mapdl/v212
docker/mapdl/_old
docker/mapdl/*.sh
distributions/
Revathyvenugopal162 marked this conversation as resolved.
Show resolved Hide resolved
Revathyvenugopal162 marked this conversation as resolved.
Show resolved Hide resolved


# temp testing
Expand Down
6 changes: 6 additions & 0 deletions doc/source/getting_started/docker.rst
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,12 @@ Using the `docker-compose.yml <pymapdl_docker_compose_base_>`_ file is recommend
This is the *base* configuration file for launching an instance of MAPDL that you can connect
to remotely.

you can use the following command to launch MAPDL:

.. code:: bash

docker-compose -f docker-compose.yml up -d mapdl


.. _pymapdl_connect_to_MAPDL_container:

Expand Down
17 changes: 0 additions & 17 deletions docker/docker-compose.dpf.yml

This file was deleted.

39 changes: 0 additions & 39 deletions docker/docker-compose.local.yml

This file was deleted.

80 changes: 67 additions & 13 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,78 @@
version: '3.3'

# This is a docker-compose file which launch a remote MAPDL instance in a dockerized environment.
# You can connect to this instance throught the port 50052 and 50055 (for the database feature).
# This is a docker-compose file that will run Ansys MAPDL and DPF in a container.
# You can connect to this instance through port 50052 and 50055 (for the database feature).
#
# For the license, you need to provide the hostname of the license server.
#
# REQUIREMENTS:
# =============
#
# - docker
# - docker images from ghcr.io (you might need to do 'docker login ghcr.io' first)
# - Docker
# - Docker images from ghcr.io (you might need to do 'docker login ghcr.io' first)
#
# USAGE:
# ======
# USAGE - MAPDL
# ============
#
# 1. You need two environment variables. One called ``DOCKER_IMAGE`` which contains the path to the
# docker image, and another one called ``ANSYSLMD_LICENSE_FILE`` which points to the license server.
# 1. You need two environment variables. One called `DOCKER_IMAGE` which contains the path to the
# Docker image, and another one called `ANSYSLMD_LICENSE_FILE` which points to the license server.
# For example:
#
# export ANSYSLMD_LICENSE_FILE=1055@mylicensehost
# export DOCKER_IMAGE=myregistry.com/myimage:mytag
#
# 2. Run the following command:
#
# docker-compose up
# docker-compose up -d mapdl
#
# Optionally, you can specify the '-d' flag for detached mode (the container will run in the background).
#

# USAGE - DPF
# ===========

# 1. You need to have the 'DPF_DOCKER_IMAGE' environment variable set. For example:
#
# export DPF_DOCKER_IMAGE=ghcr.io/ansys/dpf-core:22.2dev
#
# as well as the `ANSYSLMD_LICENSE_FILE` env var.
# 2. Run the following command:
#
# docker-compose up -d dpf
#
# Optionally, you can specify the '-d' flag for detached mode (the container will run in the background).
#
#
# USAGE - MAPDL LOCAL
# ===================
# It is said to be running as 'local' because it will mount the current directory in '/local'
# inside the container (presumably you will have the cloned repository in the current directory),
# and it will override the entrypoint to run the 'bash' command.
#
# Optionally you can specify the '-d' flag for detaching mode (the container will run in the background).
# 1. You need to have the 'mapdl' service running. You can do this by running the command:
#
# docker-compose up -d mapdl
#
# 2. Once you have done this, you can start the service by running:
#
# docker-compose -f d mapdl-local
#
# 3. you can run together by `
Revathyvenugopal162 marked this conversation as resolved.
Show resolved Hide resolved
# docker-compose -up -d mapdl mapdl-local
Revathyvenugopal162 marked this conversation as resolved.
Show resolved Hide resolved
#
# NOTES
# =====
#
# - If you need to run a license server, please have a look at 'docker-compose.license_server.yml'
# file. In that case, the command to launch everything is:
#
# docker-compose -f docker-compose.yml -f docker-compose.license-server.yml -f docker-compose.local.yml up
#
# NOTES:
# ======
#
# - 'AWP_ROOT222' is where Ansys is installed.
# - The entrypoint must be defined in the docker image.
# - `AWP_ROOT222` is where Ansys is installed.
# - The entrypoint must be defined in the Docker image.
# - If you want to mount the local directory, please add the 'volumes' section to the 'mapdl' service.
#
# volumes:
Expand All @@ -55,4 +95,18 @@ services:
image: ${DOCKER_IMAGE}
user: "0:0"
entrypoint: "/bin/bash ansys -grpc"


dpf:
image: ${DPF_DOCKER_IMAGE}
ports:
- '50056:50052'
restart: always
environment:
- ANSYSLMD_LICENSE_FILE=${ANSYSLMD_LICENSE_FILE}

mapdl-local:
user: "0:0"
volumes:
- ./:/local:cached
# Overwriting entrypoint
entrypoint: /bin/sh -c "echo 'Container is ready. You can now attach to it.'; while sleep 1000; do :; done"