Skip to content

Commit

Permalink
#345 things are starting to work up to Qt configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
sapetnioc committed May 17, 2023
1 parent b6f89ad commit 1d9730a
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 32 deletions.
15 changes: 13 additions & 2 deletions conda/apptainer.def
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,25 @@ Bootstrap: docker
From: ubuntu:22.04

%environment
export HOME=/casa/home
export CASA=/casa
export CASA_CONF=$CASA/conf
export HOME=$CASA/home
export CASA_SRC=$CASA/src
export CASA_BUILD=$CASA/build
export CASA_INSTALL=$CASA/install
export CASA_TESTS=$CASA/tests
export BRAINVISA_BVMAKER_CFG=$CASA_SRC/bv_maker.cfg
for f in "$CASA_SRC/environment.sh" "$CASA_CONF/environment.sh" "$CASA/environment.sh"; do
if [ -e "$f" ]; then
source "$f"
fi
done

%post
mkdir /casa
apt update

%runscript
echo "Start casa container"
export PATH=/casa/conda/bin:$PATH
export LD_LIBRARY_PATH=/casa/conda/lib:$LD_LIBRARY_PATH

Expand Down
29 changes: 22 additions & 7 deletions conda/setup_conda
Original file line number Diff line number Diff line change
Expand Up @@ -25,33 +25,48 @@ if [ ! -e "$casaconda/home" ]; then
fi

system_image="$casaconda/system"
apptainer="apptainer -s run --containall -B $casaconda:/casa -B /tmp $system_image"
root_apptainer="apptainer run --writable --fakeroot --containall -B $casaconda:/casa -B /tmp $system_image"

if [ ! -e "$system_image" ]; then
apptainer build --sandbox "$casaconda/system" "$script_dir/apptainer.def"
cp -a "$script_dir/setup_run_apt" "$casaconda"
$root_apptainer /casa/setup_run_apt
fi

if [ ! -e "$casaconda/Miniforge3-Linux-x86_64.sh" ]; then
wget -O "$casaconda/Miniforge3-Linux-x86_64.sh" https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh
fi

apptainer="apptainer run --containall $mounts-B $casaconda:/casa -B /tmp $system_image"
root_apptainer="apptainer run --writable --fakeroot --containall -B $casaconda:/casa -B /tmp $system_image"

conda="$apptainer /casa/conda/bin/conda"
if [ ! -e "$casaconda/conda" ]; then
mkdir "$casaconda/conda"
$apptainer sh "/casa/Miniforge3-Linux-x86_64.sh" -u -b -p "/casa/conda"
$conda update conda -y
cp -a "$script_dir/setup_run_conda" "$casaconda"
$apptainer /casa/setup_run_conda
cp -a "$script_dir/setup_dev_conda" "$casaconda"
$apptainer /casa/setup_dev_conda
fi

for script in setup_run_apt setup_run_conda setup_run_compiled; do
cp -a "$script_dir/$script" "$casaconda"
$root_apptainer /casa/$script
done
cp -a "$script_dir/setup_run_compiled" "$casaconda"
$root_apptainer /casa/setup_run_compiled

if [ ! -e "$casaconda/src" ]; then
$apptainer git clone https://github.com/sapetnioc/brainvisa-submodules /casa/src
$apptainer git -C /casa/src submodule update --init --recursive
cd $casaconda/src
for d in *; do
if [ -d "$d" ]; then
main_branch=$( $apptainer git -C /casa/src/$d branch -r --contains HEAD --format '%(refname)' | grep --invert-match HEAD | python -c 'import sys; print(sys.stdin.read().split("/")[-1])' )
$apptainer git -C "/casa/src/$d" checkout $main_branch
fi
done
fi


# Update all sources
$apptainer git -C /casa/src submodule foreach ls
# $apptainer git -C /casa/src submodule foreach git pull

$apptainer /casa/src/brainvisa-cmake/bin/bv_env bash
45 changes: 22 additions & 23 deletions conda/setup_dev_conda
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ set -e

conda=/casa/conda/bin/conda

if [ -e /casa/conda/bin/nano ]; then
# if nano is installed, we assume that this script has already been
if [ -e /casa/conda/bin/gdb ]; then
# if gdb is installed, we assume that this script has already been
# executed.
echo "setup_dev_conda already executed => execution canceled"
exit 0
Expand Down Expand Up @@ -44,34 +44,32 @@ toolchain_packages=(

# Development tools and convenience utilities
development_tools=(
ack-grep
#! ack-grep
bash-completion
emacs-nox
nox #? was emacs-nox
flake8
gdb
gdbserver
#! gdbserver
valgrind
gedit
git-man
gitg
gitk
kate
kdiff3
kompare
kwrite
locate
#! gedit
#! git-man
#! gitg
#! gitk
#! kate
#! kdiff3
#! kompare
#! kwrite
#! locate
meld
nano
python2 # only for flake8 tests of casa-distro
python3-autopep8
python3-objgraph
python3-venv
autopep8
objgraph
#! venv
spyder
strace
#! strace
tox
vim
xterm
xdot
#! xterm
#! xdot
)

# Documentation building
Expand Down Expand Up @@ -108,13 +106,14 @@ brainvisa_standard_dev_dependencies=(
libpng #? was libpng-dev
#! libqt5x11extras5-dev
#! libqwt-qt5-dev
libsigcpp #? was libsigc++-2.0-dev
libsigcpp<3 #? was libsigc++-2.0-dev
#! libspnav-dev
libsvm #? was libsvm-dev
libtiff #? was libtiff-dev
#! libvtk9-dev
#! libvtk9-qt-dev
libxml2 #? was libxml2-dev
mesalib # necessary to have GL/gl.h found by Qt CMake files
#! qttools5-dev
#! qtmultimedia5-dev
#! qttools5-dev-tools
Expand Down

0 comments on commit 1d9730a

Please sign in to comment.