@@ -4,25 +4,22 @@ inputs:
44 NAME :
55 required : true
66 type : string
7- PY :
7+ OPENMDAO_PIXI_ENVIRONMENT :
88 required : true
99 type : string
10- NUMPY :
10+ OPENMDAO_INSTALL_FROM :
1111 required : true
1212 type : string
13- SCIPY :
14- required : true
15- type : string
16- PYOPTSPARSE :
13+ OPENMDAO :
1714 required : true
1815 type : string
1916 SNOPT :
2017 required : true
2118 type : string
22- OPENMDAO :
19+ DYMOS :
2320 required : true
2421 type : string
25- DYMOS :
22+ PYOPTSPARSE :
2623 required : true
2724 type : string
2825 SSH_PRIVATE_KEY :
@@ -32,11 +29,22 @@ inputs:
3229 SNOPT_LOCATION_77 :
3330 required : true
3431
32+ # Deprecate
33+ PY :
34+ required : true
35+ type : string
36+ NUMPY :
37+ required : true
38+ type : string
39+ SCIPY :
40+ required : true
41+ type : string
42+
3543runs :
3644 using : " composite"
3745 steps :
3846 - name : Display run details
39- shell : bash
47+ shell : bash -l {0}
4048 run : |
4149 echo "============================================================="
4250 echo "Run #${GITHUB_RUN_NUMBER}"
4654 echo "Initiated by: ${GITHUB_ACTOR}"
4755 echo "============================================================="
4856
57+ - name : Checkout Aviary
58+ uses : actions/checkout@v6
59+
4960 - name : Create SSH key
50- shell : bash
61+ shell : bash -l {0}
5162 env :
5263 SSH_PRIVATE_KEY : ${{inputs.SSH_PRIVATE_KEY}}
5364 SSH_KNOWN_HOSTS : ${{inputs.SSH_KNOWN_HOSTS}}
@@ -57,81 +68,36 @@ runs:
5768 sudo chmod 600 ~/.ssh/id_rsa
5869 echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
5970
60- - name : Setup miniconda
61- uses : conda-incubator/setup-miniconda@v3
71+ - name : ' Setup OpenMDAO pixi Environment'
72+ id : setup_pixi_environment
73+ uses : OpenMDAO/OpenMDAO/.github/actions/setup_openmdao_pixi@master
6274 with :
63- auto-update-conda : true
64- python-version : ${{ inputs.PY }}
65- channels : conda-forge
66-
67- - name : Install dependencies
68- shell : bash -l {0}
69- run : |
70- echo "============================================================="
71- echo "Install dependencies"
72- echo "============================================================="
73- conda install numpy=${{ inputs.NUMPY }} scipy=${{ inputs.SCIPY }} -q -y
74- conda install matplotlib pandas panel hvplot -q -y
75- pip install testflo -q
75+ environment : ' ${{ inputs.OPENMDAO_PIXI_ENVIRONMENT }}'
76+ openmdao_install_from : ' ${{ inputs.OPENMDAO_INSTALL_FROM }}'
77+ openmdao_version : ' ${{ inputs.OPENMDAO }}'
7678
77- - name : Install pyOptSparse
78- if : inputs.PYOPTSPARSE
79+ - name : Install SNOPT
80+ if : inputs.SNOPT_LOCATION_77
7981 shell : bash -l {0}
8082 run : |
83+ eval "$(pixi shell-hook -e ${{ inputs.OPENMDAO_PIXI_ENVIRONMENT }} --manifest-path=${{ env.PIXI_MANIFEST }})"
8184 echo "============================================================="
82- echo "Determine which branch/version of pyoptsparse to install"
83- echo "============================================================="
84- if [[ "${{ inputs.PYOPTSPARSE }}" == "latest" ]]; then
85- function latest_version() {
86- local REPO_URL=$1/releases/latest
87- local LATEST_URL=`curl -fsSLI -o /dev/null -w %{url_effective} $REPO_URL`
88- local LATEST_VER=`echo $LATEST_URL | awk '{split($0,a,"/tag/"); print a[2]}'`
89- echo $LATEST_VER
90- }
91- BRANCH="-b $(latest_version https://github.com/mdolab/pyoptsparse)"
92- else
93- BRANCH="-b ${{ inputs.PYOPTSPARSE }}"
94- fi
95-
96- echo "============================================================="
97- echo "Install pyoptsparse"
85+ echo "Install SNOPT"
9886 echo "============================================================="
9987 if [[ "${{ inputs.SNOPT }}" == "7.7" && "${{ inputs.SNOPT_LOCATION_77 }}" ]]; then
10088 mkdir SNOPT
10189 echo " > Secure copying SNOPT 7.7 over SSH"
10290 scp -qr ${{ inputs.SNOPT_LOCATION_77 }} SNOPT
103- SNOPT="-s SNOPT/src"
91+ python -m build_pyoptsparse.snopt_module SNOPT/src
10492 elif [[ "${{ inputs.SNOPT }}" ]]; then
10593 echo "SNOPT version ${{ inputs.SNOPT }} was requested but source is not available"
10694 fi
10795
108- conda config --add channels conda-forge
109-
110- pip install git+https://github.com/OpenMDAO/build_pyoptsparse@v2.0.13
111- build_pyoptsparse -v $BRANCH $SNOPT
112-
113- echo "The build script has been grabbing an older version of IPOPT with some problems."
114- conda install ipopt=3.14
115-
116- - name : Install OpenMDAO
117- if : inputs.OPENMDAO
118- shell : bash -l {0}
119- run : |
120- echo "============================================================="
121- echo "Install OpenMDAO"
122- echo "============================================================="
123- if [[ "${{ inputs.OPENMDAO }}" == "dev" ]]; then
124- pip install git+https://github.com/OpenMDAO/OpenMDAO
125- elif [[ "${{ inputs.OPENMDAO }}" == "latest" ]]; then
126- pip install openmdao
127- else
128- pip install openmdao==${{ inputs.OPENMDAO }}
129- fi
130-
13196 - name : Install Dymos
13297 if : inputs.DYMOS
13398 shell : bash -l {0}
13499 run : |
100+ eval "$(pixi shell-hook -e ${{ inputs.OPENMDAO_PIXI_ENVIRONMENT }} --manifest-path=${{ env.PIXI_MANIFEST }})"
135101 echo "============================================================="
136102 echo "Install Dymos"
137103 echo "============================================================="
@@ -143,27 +109,60 @@ runs:
143109 pip install dymos==${{ inputs.DYMOS }}
144110 fi
145111
146- - name : Checkout Aviary
147- uses : actions/checkout@v6
148-
149112 - name : Install Aviary
150113 shell : bash -l {0}
151114 run : |
115+ eval "$(pixi shell-hook -e ${{ inputs.OPENMDAO_PIXI_ENVIRONMENT }} --manifest-path=${{ env.PIXI_MANIFEST }})"
152116 echo "============================================================="
153117 echo "Install Aviary"
154118 echo "============================================================="
155119 pip install -e .[all]
156120
121+ - name : Check MPI and PETSc
122+ shell : bash -l {0}
123+ continue-on-error : true
124+ run : |
125+ eval "$(pixi shell-hook -e ${{ inputs.OPENMDAO_PIXI_ENVIRONMENT }} --manifest-path=${{ env.PIXI_MANIFEST }})"
126+ if python -c "import mpi4py, petsc4py" 2>/dev/null; then
127+ echo "============================================================="
128+ echo "Check MPI and PETSc installation"
129+ echo "============================================================="
130+ export PRTE_MCA_rmaps_default_mapping_policy=:oversubscribe
131+ export OMPI_MCA_rmaps_base_oversubscribe=1
132+ export OMPI_MCA_btl=^openib
133+ echo "-----------------------"
134+ echo "Quick test of mpi4py:"
135+ mpirun -n 3 python -c "from mpi4py import MPI; print(f'Rank: {MPI.COMM_WORLD.rank}')"
136+ echo "-----------------------"
137+ echo "Quick test of petsc4py:"
138+ mpirun -n 3 python -c "import numpy; from mpi4py import MPI; comm = MPI.COMM_WORLD; \
139+ import petsc4py; petsc4py.init(); \
140+ x = petsc4py.PETSc.Vec().createWithArray(numpy.ones(5)*comm.rank, comm=comm); \
141+ print(x.getArray())"
142+ echo "-----------------------"
143+
144+ # shellcheck disable=SC2129
145+ echo "PRTE_MCA_rmaps_default_mapping_policy=:oversubscribe" >> "$GITHUB_ENV"
146+ echo "OMPI_MCA_rmaps_base_oversubscribe=1" >> "$GITHUB_ENV"
147+ echo "OMPI_MCA_btl=^openib" >> "$GITHUB_ENV"
148+
149+ echo "Workaround for intermittent failures with OMPI https://github.com/open-mpi/ompi/issues/7393"
150+ echo "TMPDIR=/tmp" >> "$GITHUB_ENV"
151+ else
152+ echo "mpi4py or petsc4py not installed in this environment, skipping MPI checks"
153+ fi
154+
157155 - name : Display conda environment info
158156 shell : bash -l {0}
159157 run : |
158+ eval "$(pixi shell-hook -e ${{ inputs.OPENMDAO_PIXI_ENVIRONMENT }} --manifest-path=${{ env.PIXI_MANIFEST }})"
160159 conda info
161160 conda list
162161 conda env export --file environment.yml
163162 mv environment.yml ${{ inputs.NAME }}_environment.yml
164163
165164 - name : ' Upload environment artifact'
166- uses : actions/upload-artifact@v4
165+ uses : actions/upload-artifact@v7
167166 with :
168167 name : ${{ inputs.NAME }}_environment
169168 path : ${{ inputs.NAME }}_environment.yml
0 commit comments