-
Notifications
You must be signed in to change notification settings - Fork 567
Containers
- You are sitting on a machine with a container engine installed (usually Docker or Podman)
- You have a local clone of Trilinos located at ${HOME}/Trilinos
# Pull image from registry
docker pull registry-ex.sandia.gov/trilinos-project/trilinos-containers/dev_ubi8_intel2023_intelmpi2021:latest
# Start a container from the image, with your code project mounted
docker run --rm -it --mount type=bind,src=${HOME}/Trilinos,dst=/root/Trilinos registry-ex.sandia.gov/trilinos-project/trilinos-containers/dev_ubi8_intel2023_intelmpi2021:latest
# Build and test Trilinos however you'd like. Below are instructions if you wish to use GenConfig
cd ~
source ./Trilinos/packages/framework/get_dependencies.sh --container
mkdir build
cd build
source ../Trilinos/packages/framework/GenConfig/gen-config.sh --force rhel8_oneapi-intelmpi_release-debug_shared_no-kokkos-arch_no-asan_no-complex_fpic_mpi_no-pt_no-rdc_no-uvm_deprecated-on_all /root/Trilinos
ninja
ctest
For more information about developing with persistent data in containers, read here.
tldr it helps to think of a Docker image as a program on your disk e.g., /bin/ls
.
Following that analogy, you can think of a Docker container as a running process e.g., when you type ls ~
.
Building an image is typically done by passing a Dockerfile
to Docker as illustrated here.
The Dockerfile is text file containing commands that Docker understands.
See the example shown below:
FROM debian:buster
RUN apt-get update
RUN apt-get -y install build-essential
The FROM
command indicates a base image to use, in this case debian:buster
.
Next we use a series of RUN
commands to run commands as if we were at the terminal.
In this case we run apt-get update
to update our packages in Debian.
Finally we install the build-essential
package which includes make
, gcc
, etc.
We can run docker build .
from the directory containing the Dockerfile.
This will create an image based on the contents of our Dockerfile and output the hash of the resulting image.
We can view the various images with the docker images
command:
REPOSITORY TAG IMAGE ID CREATED SIZE
<none> <none> 8c470891703a 10 minutes ago 354MB
Now we can run that image and poke around in a bash
shell.
To do this we need to pass certain flags to the run
command: i
for interactive and t
to allocate a tty.
Putting it all together, we get: docker run -it 8c470891703a
.
root@06292e5e2a27:/#
Wow, we're the root user in our new host.
Let's check the version of g++
:
root@06292e5e2a27:/# g++ --version
g++ (Debian 8.3.0-6) 8.3.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
root@06292e5e2a27:/# exit
Please see the link at the top of this section for more information.
Copyright © Trilinos a Series of LF Projects, LLC
For web site terms of use, trademark policy and other project policies please see https://lfprojects.org.
Trilinos Developer Home
Trilinos Package Owners
Policies
New Developers
Trilinos PR/CR
Productivity++
Support Policy
Test Dashboard Policy
Testing Policy
Managing Issues
New Issue Quick Ref
Handling Stale Issues and Pull Requests
Release Notes
Software Quality Plan
Proposing a New Package
Guidance on Copyrights and Licenses
Tools
CMake
Doxygen
git
GitHub Notifications
Mail lists
Clang-format
Version Control
Initial git setup
'feature'/'develop'/'master' (cheatsheet)
Simple centralized workflow
Building
SEMS Dev Env
Mac OS X
ATDM Platforms
Containers
Development Tips
Automated Workflows
Testing
Test Harness
Pull Request Testing
Submitting a Pull Request
Pull Request Workflow
Reproducing PR Errors
Addressing Test Failures
Trilinos Status Table Archive
Pre-push (Checkin) Testing
Remote pull/test/push
PR Creation & Approval Guidelines for Tpetra, Ifpack2, and MueLu Developers