Repository navigation
fix(mpi): --efa runs the EFA installer's Open MPI under /opt/amazon/openmpi (#1491) - #1506
Merged
Merged
Conversation
This was referenced Nov 2, 2026
Live on c7gn.16xlarge, Ubuntu 24.04: with --efa the Open MPI apt install,
which ran the only apt-get update, is skipped, so the installer ran against
the AMI's stale indexes and failed ('Unable to locate package
environment-modules'); every member then failed closed at enrolment.
AL2023 passed (EFA traffic and /opt/amazon/openmpi mpirun verified).
scttfrdmn
force-pushed
the
fix/1491-efa-openmpi
branch
from
November 2, 2026 20:55
e8ead70 to
65a482b
Compare
Contributor
Author
Live test on EFA hardware (c7gn.16xlarge Spot, us-east-1a, CLI built from
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1491
What (owner decision)
With
--mpi --efa, rank 0's mpirun is now the EFA installer's Open MPI,/opt/amazon/openmpi/bin/mpirun, which is AWS's documented EFA path. Before this, the distribution's Open MPI was installed first and was first on PATH. Without--efa, nothing changes.Design (
pkg/userdata/mpi.go; rationale is in the Go comment, not the user data)Install: with
--efa, the yum/apt-get Open MPI install is skipped. The script printsUsing the EFA installer's Open MPI (#1491). The installer installs Open MPI 4.1 at/opt/amazon/openmpi, and by default (since 1.30.0) Open MPI 5 at/opt/amazon/openmpi5. An image that already has a distribution Open MPI keeps it, but out of the script's PATH.Fail closed: after
efa_installer.sh, the script requires/opt/amazon/openmpi/bin/mpirun. Without it, it exits 1 and the --mpi on an AL2 --ami dies at the jq hostfile step (jq not installed); no SPAWN_COMPLETE, so the cohort bills until TTL #1483 trap recordsmpi-bootstrap, rather than PATH falling through to/usr/bin/mpirunon Ubuntu.mpi.shwith--efa:PATH=/opt/amazon/openmpi/bin:/opt/amazon/efa/bin:$PATHLD_LIBRARY_PATH=/opt/amazon/openmpi/lib64:/opt/amazon/openmpi/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}, which keeps the MPI: add an apt install path for Ubuntu AMIs (today --mpi on Ubuntu can never work) #1487/feat(mpi): install Open MPI with apt-get on Ubuntu AMIs (#1487) #1492 no-empty-entry form. AL useslib64and Ubuntu useslib; I confirmedlibon Ubuntu.Without
--efait is byte-identical to main.Peers / orted: non-interactive ssh reads no profile.d.
ompi_infoon the installer's build shows--enable-orterun-prefix-by-default("mpirun default --prefix: yes"), so orted on the peers gets the prefix's PATH and library path. The mpirun line itself is unchanged.Root:
--allow-run-as-rootstays.cd /tmpbecamecd /tmp/. They are equivalent; the change lets the sandbox relocate the installer's working directory, so the test never writes to the host's /tmp.Container check (ubuntu:24.04, EFA installer 1.51.0,
-y --skip-kmod --skip-limit-conf --no-verify, as root)openmpi40-aws 4.1.8-1andopenmpi50-aws 5.0.9,libfabric-aws 2.7.0amzn2.0./opt/amazon/efa/binhasfi_info fi_mon_sampler fi_pingpong fi_strerror.--mca orte_base_help_aggregate 0:--allow-run-as-root -np 2: rc=0command -v mpirungives/opt/amazon/openmpi/bin/mpirun, both in the shell and inside the ranks.ompi_info:MCA mtl: ofiandMCA btl: ofi,--with-ofi=/opt/amazon/efa/.zippy_efa.sh(login shells) also prepends/opt/amazon/openmpi/bin, so login shells and the user data now agree./etc/sysctl.d/10-ptrace.confstays atkernel.yama.ptrace_scope = 1; the installer does not change it. AWS says to disable it for libfabric's CMA shared memory. Spawn's ranks run as root, and CAP_SYS_PTRACE bypasses yama scope 1, so this should not bite. It is in the live-check list.Distros
efa_installer.shin today'slatestexits 1 on AL2. Spawn fetchesaws-efa-installer-latest, so--efaon AL2 already fails closed on main. Filed as --efa on an Amazon Linux 2 --ami fails: the EFA installer dropped AL2 in 1.50.0 and spawn fetches aws-efa-installer-latest #1504. Not changed here.--efano longer runs feat(mpi): install Open MPI with apt-get on Ubuntu AMIs (#1487) #1492's apt path. The installer uses apt/dpkg itself../efa_installer.sh,curlandtarfor the EFA path, andmpirunas installed first.Gates (
pkg/userdata/mpi_efa_openmpi_test.go, whole-script sandbox, rank 0 plus 2 peers running their own scripts)The sandbox has a marked mpirun stand-in in each place: the distribution's on PATH, and the one the stand-in EFA installer writes to
/opt/amazon/openmpi/bin. The test reads which one rank 0 actually ran./opt/is added to the sandbox's relocated prefixes.Every revert below kept
go vetclean, and the named gate failed against it:TestMPIWithEFARunsTheInstallersOpenMPI(image with distro mpirun; yum, none; apt-get, none)--efampi.sh gets the old/usr/lib64/openmpi/binPATHran mpirun "distro"/"",want the EFA installer'sthe distribution's Open MPI was installed: ["yum install -y openmpi openmpi-devel"], and the same for apt-getTestMPIWithEFAFailsClosedWithoutTheInstallersOpenMPI-xcheck removedrank 0 exited 0, want 1,mpirun "distro" ran although the EFA installer installed no Open MPITestMPIWithoutEFARunsTheDistributionsOpenMPI(an/opt/amazon/openmpiexists on the image)--efampi.sh used alwayswithout --efa, rank 0 ran mpirun "efa",mpi.sh names /opt/amazonFollow-ups filed (no milestone)
--efaon AL2 fails, because the installer dropped AL2.aws-efa-installer-latestruns as root with no sha256 or signature check. That needs the same treatment as bootstrap: INSTANCE_ID is empty on Ubuntu (no ec2-metadata), so every tag read and the --command once-marker use an empty ID #1490/bootstrap: nothing moves the pinned AWS CLI version/sha256 the Linux bootstrap installs #1495, and bootstrap: Ubuntu in a private subnet cannot install the AWS CLI (awscli.amazonaws.com unreachable), so it now fails closed #1494's mirror could carry it.Checks
These pass:
make check, from /private/tmp.make lint: 0 issues in all 10 modules.semgrep scan --config=auto --error .: rc 0.No help text changed, so docs need no regeneration. There were no AWS calls.