Skip to content

Commit

Permalink
Fix our CI's run-in-docker action for MPI (#1019)
Browse files Browse the repository at this point in the history
  • Loading branch information
bmhowe23 authored Dec 11, 2023
1 parent c20d645 commit 7218418
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion .github/actions/run-in-docker/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@ runs:
steps:
- shell: bash
run: |
docker run -i ${{ inputs.image }} ${{ inputs.shell }} -s << 'EOF'
# Note: "bash -s << EOF" does not play nice with mpirun/mpiexec. It
# silently skips any shell commands that come after the mpirun/mpiexec,
# so don't use it. Use this instead, which seems to work better.
tmpFile=$(mktemp)
cat > $tmpFile << 'EOF'
${{ inputs.run }}
EOF
chown $(id -u):$(id -g) $tmpFile
container=$(docker run -id ${{ inputs.image }})
docker cp $tmpFile $container:$tmpFile
docker exec $container ${{ inputs.shell }} $tmpFile
docker stop $container
rm $tmpFile

0 comments on commit 7218418

Please sign in to comment.