5. Tutorial for administrators of the wc_env and wc_env_dependencies images¶
Administrators should follow these steps to build and disseminate the wc_env and wc_env_dependencies images.
Create contexts for building the wc_env and wc_env_dependencies Docker images.
Create Dockerfile templates for the wc_env and wc_env_dependencies Docker images.
Set the configuration for wc_env_manager.
Use wc_env_manager to build the wc_env and wc_env_dependencies Docker images.
Use wc_env_manager to push the wc_env and wc_env_dependencies Docker images to DockerHub.
5.1. Create contexts for building the wc_env and wc_env_dependencies images¶
First, create contexts for building the images. This can include licenses and installers for proprietary software packages.
Prepare CPLEX installation
Download CPLEX installer from https://ibm.onthehub.com
Save the installer to the base image context
Set the execution bit for the installer by running chmod ugo+x /path/to/installer
Prepare Gurobi installation
Create license at http://www.gurobi.com/downloads/licenses/license-center
Copy the license to the gurobi_license build argument for the base image in the wc_env_manager configuration
Prepare Marvin installation
Download Marvin from https://chemaxon.com/products/marvin/download
Copy license key from https://accounts.chemaxon.com/licenses to the marvin_license build argument for the base image in the wc_env_manager configuration
Prepare Mosek installation
Request an academic license at https://license.mosek.com/academic/
Receive a license by email
Save the license to the context for the base image as mosek.lic
Prepare XPRESS installation
Install the XPRESS license server on another machine
Download XPRESS from https://clientarea.xpress.fico.com
Use the xphostid utility to get your host id
Use the host id to create a floating license at https://app.xpress.fico.com
Save the license file to the context for the base image as xpauth.xpr
Run the installation program and follow the onscreen instructions
Copy the IP address or hostname of the license server to the xpress_license_server build argument for the base image in the wc_env_manager configuration.
Save the license file to the context for the base image as xpauth.xpr.
Edit the server property in the first line of xpauth.xpr in the context for the base image. Set the property to the IP address or hostname of the license server.
5.2. Create Dockerfile templates for wc_env and wc_env_dependencies¶
Second, create templates for the Dockerfiles to be rendered by Jinja, and save the Dockerfiles within the contexts for the images. The default templates illustrate how to create the Dockerfile templates.
/path/to/wc_env_manager/wc_env_manager/assets/base-image/Dockerfile.template
/path/to/wc_env_manager/wc_env_manager/assets/image/Dockerfile.template
5.3. Set the configuration for wc_env_manager¶
Third, Set the configuration for wc_env_manager by creating a configuration file ./wc_env_manager.cfg following the schema outlined in /path/to/wc_env_manager/wc_env_manager/config/core.schema.cfg and the defaults in /path/to/wc_env_manager/wc_env_manager/config/core.default.cfg.
Set the repository and tags for wc_env and wc_env_dependencies.
Set the paths for the Dockerfile templates.
Set the contexts for building the Docker images and the files that should be copied into the images.
Set the build arguments for building the Docker images. This can include licenses for proprietary software packages. For example,:
[wc_env_manager] [[base_image]] [[[build_args]]] gurobi_version = 8.0.1 gurobi_license = ... ...
Set the WC modeling packages that should be installed into wc_env. For example,:
[wc_env_manager] [[image]] python_packages = ''' pytest pytest-cov '''
Set your DockerHub username and password.
5.4. Build the wc_env and wc_env_dependencies Docker images¶
Use the following command to build the wc_env and wc_env_dependencies images:
wc-env-manager build
5.5. Push the wc_env and wc_env_dependencies Docker images to DockerHub¶
Use the following command to push the wc_env and wc_env_dependencies images to GitHub:
wc-env-manager push