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

Add the ability to specify a branch for Singularity #163

Merged
merged 2 commits into from
Apr 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

- Upgrade NumPy from 1.20 to 1.21, Numba from 0.54 to 0.55, Rich from 6.2 to 11.0 [#152](https://github.com/litebird/litebird_sim/pull/152)

- Add the ability to create Singularity container from branches different than `master` [#163](https://github.com/litebird/litebird_sim/pull/163)

- Make MBS tests more robust against disappearing temporary directories [#162](https://github.com/litebird/litebird_sim/pull/162)

- Remove NumPy's and Healpy's deprecation warnings [#158](https://github.com/litebird/litebird_sim/pull/158)
Expand Down
2 changes: 1 addition & 1 deletion singularity/Singularity.m4
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ shell. Examples:
# reason why we run tests here is because AstroPy needs to
# download a few files, and if we postpone this to %test the
# filesystem will be read-only).
git clone https://github.com/litebird/litebird_sim.git /opt/litebird_sim
git clone -b BRANCH https://github.com/litebird/litebird_sim.git /opt/litebird_sim

cd /opt/litebird_sim

Expand Down
9 changes: 8 additions & 1 deletion singularity/create-singularity-file.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,21 @@

readonly ubuntu_version="$1"
readonly mpi_library="$2"
if [ "$3" == "" ]; then
readonly branch="master"
else
readonly branch="$3"
fi

if [ "$mpi_library" == "" ]; then
cat <<EOF
Usage: $(basename $0) UBUNTU_VERSION MPI_LIBRARY
Usage: $(basename $0) UBUNTU_VERSION MPI_LIBRARY [BRANCH]

where:

UBUNTU_VERSION is the number of the Ubuntu distribution to use (e.g., 20.04)
MPI_LIBRARY is either "openmpi", "mpich", or "none"
BRANCH specifies the branch to clone, or "master" if nothing is provided
EOF

exit 1
Expand Down Expand Up @@ -43,6 +49,7 @@ esac

m4 \
-DUBUNTU_VERSION="$ubuntu_version" \
-DBRANCH="$branch" \
$mpi_lib $mpi_lib_name $poetry_mpi \
Singularity.m4 > Singularity

Expand Down