Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
apptainerubuntu22fairseq
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Surrey Shared Containers
apptainerubuntu22fairseq
Commits
96972da0
Commit
96972da0
authored
8 months ago
by
Alex, Tony (PG/R - Comp Sci & Elec Eng)
Browse files
Options
Downloads
Patches
Plain Diff
Update container.def
parent
c2aa8401
No related branches found
No related tags found
No related merge requests found
Pipeline
#88460
canceled
8 months ago
Stage: build
Stage: push
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
container.def
+47
-19
47 additions, 19 deletions
container.def
with
47 additions
and
19 deletions
container.def
+
47
−
19
View file @
96972da0
#
Get the base image from nvidia/cuda Docker image.
Boot
S
trap: docker
From: nvidia/cuda:11.8.0-cudnn8-
runtime
-ubuntu22.04
#
Use NVIDIA CUDA 11.8 with cuDNN 8 for Ubuntu 22.04 as the base
Boot
s
trap: docker
From: nvidia/cuda:11.8.0-cudnn8-
devel
-ubuntu22.04
### Recreating ubuntu22fairseq docker, with apptainer for testing
%post
# Install special software or additions
apt-get update -y # Good practice, update the package database.
apt-get install -y libopenblas-dev # Install the BLAS.
apt-get autoremove -y && apt-get autoclean -y # Good practice, to keep the Docker image as small as possible.
# Set the environment to noninteractive for apt installations
export DEBIAN_FRONTEND=noninteractive
%environment
# Set some environment vars
export PATH=/opt/root/bin:$PATH
export LD_LIBRARY_PATH=/opt/root/lib:$LD_LIBRARY_PATH
export PYTHONPATH=/opt/root/lib
# Update the apt repository and install essential packages
apt-get update && \
apt-get install -y wget bzip2 && \
apt-get clean
# Download and install Anaconda
echo "Downloading and installing Anaconda..."
ANACONDA_INSTALLER="Anaconda3-2023.07-1-Linux-x86_64.sh"
wget https://repo.anaconda.com/archive/$ANACONDA_INSTALLER
bash $ANACONDA_INSTALLER -b -p /opt/conda
rm $ANACONDA_INSTALLER
echo "Anaconda installed."
%runscript
# The command that will run when container is started via apptainer run command.
python /opt/root/tutorials/roofit/rf101_basics.py
# Set up conda path
echo "Setting up conda path..."
export PATH="/opt/conda/bin:$PATH"
# Update conda and create a Python 3.9.13 environment as default
echo "Updating conda and configuring Python 3.9.13 environment..."
conda init bash
conda config --set always_yes yes --set changeps1 no
conda update -n base -c defaults conda
conda create -y -n py3913_env python=3.9.13 # Create a Python 3.9.13 environment
echo "Python 3.9.13 environment created."
# Clean up package cache to reduce image size
echo "Cleaning up package cache to reduce image size..."
rm -rf /var/lib/apt/lists/*
echo "Cleanup complete."
%labels
# Add custom metadata to the container.
Author Me
Version v0.0.1
\ No newline at end of file
%environment
# Set environment variables
export PATH="/opt/conda/envs/py3913_env/bin:/opt/conda/bin:$PATH" # Ensure Python 3.9.13 from py3913_env is first in PATH
export LC_ALL=C.UTF-8
export LANG=C.UTF-8
export PYTHON="/opt/conda/envs/py3913_env/bin/python" # Define PYTHON variable to point to Python 3.9.13 in py3913_env
%runscript
# Default command when the container is run
echo "The container is equipped with Anaconda and all necessary dependencies."
echo "Activating the Python 3.9.13 conda environment (py3913_env) by default..."
source /opt/conda/etc/profile.d/conda.sh # Source conda profile script
conda activate py3913_env # Activate the Python 3.9.13 environment
exec bash # Start a bash shell in the container for interactive use
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment