LDMX-Software / ldmx-sw

The Light Dark Matter eXperiment simulation and reconstruction framework.
https://ldmx-software.github.io
GNU General Public License v3.0
20 stars 16 forks source link

[Discussion] Move back from the submodule approach to a monorepo #1275

Closed EinarElen closed 1 month ago

EinarElen commented 1 month ago

I'm making this issue so we can have the discussions regarding whether or not to move away from submodules in a persistent place (as opposed to slack 😄).

Summarizing the discussion on Slack briefly

From @tomeichlersmith

Questions:

From @EinarElen:

From @tvami

tvami commented 1 month ago

My main point is that maybe the measure should be "how ldmx specific the package is" instead of stability. And given that both Framework and MagFieldMap are very ldmx specific, I'd argue that they should also be merged into the mono-repo.

tomeichlersmith commented 1 month ago

Okay, after doing some extremely simple estimates, I am not worried about pulling MagFieldMap into ldmx-sw anymore.

tom@nixos:~/code/ldmx/monorepo-ification/ldmx-sw$ du -sh \
  --exclude 'Tracking/acts*' \
  --exclude '*G4DarkBreM*' \
  --exclude '*doxygen-awesome-css*' \
  --exclude 'Trigger/ruckus*' \
  --exclude 'Trigger/HLS_arbitrary_Precision_Types*'
425M    .

GitHub doesn't have a hard limit on the total size of a repo, but they generally suggest a soft limit of ~1GB. This means our code base could double in size and we'd still would have space for 10 more copies of the magnetic field map (15MB). If we have that many copies, we should probably look at a better solution like a calibrations database entry for the mag-field anyways.

tvami commented 1 month ago

What should T be?

Why dont we go ahead with T = May 1st? There is a sw-dev meeting next week and a SWAN meeting 2 weeks from now, and this would give yet another week for people to act.

How to deal with stale branches (Tom favours removing them)

+1 from me

Should this be a major release?

I'd say so. Even tho it doesnt change the physics it's a big change structurally.

tvami commented 1 month ago

What should T be?

Why dont we go ahead with T = May 1st? There is a sw-dev meeting next week and a SWAN meeting 2 weeks from now, and this would give yet another week for people to act.

@bryngemark @vdutta what do you think about this? (I see Tom and Einar already "thumbs-up"-ed it)

tomeichlersmith commented 1 month ago

Notes from SW-Dev Meeting 4/17

tomeichlersmith commented 1 month ago

trunk now contains the results of running the following script. I am using a simple cleanup change #1293 to double check that this change doesn't alter the code results compared to v3.4.0. I ran this script with git 2.34.1.

#!/bin/sh

set -o errexit
set -o nounset
set -o xtrace

# submodules without submodules of their own are easier
for sm in Conditions Ecal Framework Hcal MagFieldMap TrigScint cmake
do
  sm_main="$(git -C ${sm} remote show origin | sed -n '/HEAD branch/s/.*: //p')"
  git remote add ${sm}_origin git@github.com:LDMX-Software/${sm}.git
  git fetch ${sm}_origin ${sm_main}
  git merge -s ours --no-commit --allow-unrelated-histories ${sm}_origin/${sm_main}
  git rm --cached ${sm}
  sed -i "/${sm}/d" .gitmodules
  rm -rf ${sm}/.git
  git add ${sm} .gitmodules
  git commit -m "transition ${sm} from submodule to subdirectory"
  git remote rm ${sm}_origin
done

# this method of copying the commit reference of the submodules of the submodules
# disregards the commit history of that submodule :(
for sm in SimCore Tracking Trigger
do
  git -C ${sm} submodule status > ${sm}.submods.list
  git -C ${sm} submodule --quiet foreach git remote get-url origin > ${sm}.submods.remote
  sm_main="$(git -C ${sm} remote show origin | sed -n '/HEAD branch/s/.*: //p')"
  git remote add ${sm}_origin git@github.com:LDMX-Software/${sm}.git
  git fetch ${sm}_origin ${sm_main}
  git merge -s ours --no-commit --allow-unrelated-histories ${sm}_origin/${sm_main}
  git rm --cached ${sm}
  sed -i "/${sm}/d" .gitmodules
  rm -rf ${sm}/.git .git/modules/${sm}
  paste ${sm}.submods.list ${sm}.submods.remote | while read commit relpath describe url
    do
      rm -rf "${sm}/${relpath}"
      git submodule add "${url}" "${sm}/${relpath}"
      git -C "${sm}/${relpath}" checkout "${commit}"
      git add "${sm}/${relpath}"
    done
  git add ${sm} .gitmodules
  git commit -m "transition ${sm} from submodule to subdirectory"
  git remote rm ${sm}_origin
  rm ${sm}.submods.list ${sm}.submods.remote
done