|
| 1 | +name: Github-CI |
| 2 | + |
| 3 | +on: |
| 4 | + # Dispatch this workflow whenever master or dev get a PR or commit |
| 5 | + push: |
| 6 | + branches : ["dev","master"] |
| 7 | + pull_request: |
| 8 | + branches: ["dev","master"] |
| 9 | + # ... or when the workflow is started manually |
| 10 | + workflow_dispatch: |
| 11 | + |
| 12 | +jobs: |
| 13 | + build_libraries: |
| 14 | + # Build libraries for the current version of the docker image |
| 15 | + # (to be used in any subsequent compilation and run jobs on said image) |
| 16 | + runs-on: ubuntu-latest |
| 17 | + container: ursg/vlasiator_ci:20230220_1 |
| 18 | + |
| 19 | + steps: |
| 20 | + - name: Checkout source |
| 21 | + uses: actions/checkout@v3 |
| 22 | + - name: Run library build script |
| 23 | + run: ./build_libraries.sh |
| 24 | + - name: Build libraries tar |
| 25 | + run: tar --zstd -cvf libraries.tar.zstd libraries/ |
| 26 | + - name: Upload libraries as artifact |
| 27 | + uses: actions/upload-artifact@v3 |
| 28 | + with: |
| 29 | + name: libraries |
| 30 | + path: libraries.tar.zstd |
| 31 | + retention-days: 5 |
| 32 | + if-no-files-found: error |
| 33 | + |
| 34 | + build_libraries_riscv: |
| 35 | + # Build libraries for the current version of the docker image |
| 36 | + # (to be used in any subsequent compilation and run jobs on said image) |
| 37 | + runs-on: risc-v |
| 38 | + |
| 39 | + steps: |
| 40 | + - name: Submit library job |
| 41 | + run: | |
| 42 | + srun --interactive -p arriesgado-jammy -J vlasiator-libs -n 1 -c 4 --pty -t 01:00:00 bash -lc 'module load openmpi; cp ~/vlasiator/build_libraries.sh .; ./build_libraries.sh arriesgado' |
| 43 | + - name: Build libraries tar |
| 44 | + run: tar -czvf libraries-arriesgado.tar.gz libraries-arriesgado/ |
| 45 | + - name: Upload libraries as artifact |
| 46 | + uses: actions/upload-artifact@v3 |
| 47 | + with: |
| 48 | + name: libraries-arriesgado |
| 49 | + path: libraries-arriesgado.tar.gz |
| 50 | + retention-days: 5 |
| 51 | + if-no-files-found: error |
| 52 | + |
| 53 | + build_production: |
| 54 | + # Build Vlasiator with production flags |
| 55 | + runs-on: ubuntu-latest |
| 56 | + container: ursg/vlasiator_ci:20230220_1 |
| 57 | + needs: build_libraries |
| 58 | + |
| 59 | + steps: |
| 60 | + - name: Checkout source |
| 61 | + uses: actions/checkout@v3 |
| 62 | + with: |
| 63 | + submodules: true |
| 64 | + - name: Download libraries |
| 65 | + uses: actions/download-artifact@v3 |
| 66 | + with: |
| 67 | + name: libraries |
| 68 | + - name: Unpack libraries |
| 69 | + run: tar --zstd -xvf libraries.tar.zstd |
| 70 | + - uses: ursg/gcc-problem-matcher@master |
| 71 | + - name: Compile vlasiator (Release build) |
| 72 | + run: | |
| 73 | + VLASIATOR_ARCH=github_actions make clean |
| 74 | + VLASIATOR_ARCH=github_actions make -j 3 |
| 75 | + # - name: Compile vlasiator (Release build) |
| 76 | + # run: | |
| 77 | + # srun -M carrington --job-name release_compile --interactive --nodes=1 -n 1 -c 16 --mem=40G -p short -t 0:10:0 bash -c 'module purge; module load GCC/11.2.0; module load OpenMPI/4.1.1-GCC-11.2.0 ; module load PMIx/4.1.0-GCCcore-11.2.0; module load PAPI/6.0.0.1-GCCcore-11.2.0; export VLASIATOR_ARCH=carrington_gcc_openmpi; make clean; make -j 16' |
| 78 | + |
| 79 | + |
| 80 | + build_testpackage: |
| 81 | + # Build Vlasiator with testpackage flags, on the carrington cluster |
| 82 | + # (for subsequent running of the integration test package) |
| 83 | + runs-on: carrington |
| 84 | + |
| 85 | + steps: |
| 86 | + - name: Clean workspace |
| 87 | + run: | |
| 88 | + rm -rf libraries library-build testpackage |
| 89 | + rm -f libraries.tar.zst dtestpackage_check_description.txt testpackage-output.tar.gz metrics.txt stdout.txt stderr.txt testpackage_output_variables.txt |
| 90 | + rm -f *.xml |
| 91 | + - name: Checkout source |
| 92 | + uses: actions/checkout@v3 |
| 93 | + with: |
| 94 | + submodules: true |
| 95 | + - name: Make clean |
| 96 | + run: VLASIATOR_ARCH=carrington_gcc_openmpi make clean |
| 97 | + - uses: ursg/gcc-problem-matcher@master |
| 98 | + - name: Compile vlasiator (Testpackage build) |
| 99 | + run: | |
| 100 | + export VLASIATOR_ARCH=carrington_gcc_openmpi |
| 101 | + srun -M carrington --job-name tp_compile --interactive --nodes=1 -n 1 -c 16 --mem=40G -p short -t 0:10:0 bash -c 'module purge; module load GCC/11.2.0; module load OpenMPI/4.1.1-GCC-11.2.0 ; module load PMIx/4.1.0-GCCcore-11.2.0; module load PAPI/6.0.0.1-GCCcore-11.2.0; export VLASIATOR_ARCH=carrington_gcc_openmpi; make -j 16 testpackage; sleep 10s' |
| 102 | + - name: Sleep for 10 seconds |
| 103 | + run: sleep 10s |
| 104 | + shell: bash |
| 105 | + - name: Upload testpackage binary |
| 106 | + uses: actions/upload-artifact@v3 |
| 107 | + with: |
| 108 | + name: vlasiator-testpackage |
| 109 | + path: vlasiator |
| 110 | + if-no-files-found: error |
| 111 | + #- name: Upload build log |
| 112 | + # uses: actions/upload-artifact@v3 |
| 113 | + # with: |
| 114 | + # name: Testpackage build log |
| 115 | + # path: build.log |
| 116 | + |
| 117 | + build_riscv: |
| 118 | + runs-on: risc-v |
| 119 | + needs: build_libraries_riscv |
| 120 | + |
| 121 | + steps: |
| 122 | + - name: Checkout source |
| 123 | + uses: actions/checkout@v3 |
| 124 | + with: |
| 125 | + submodules: true |
| 126 | + - name: Download libraries |
| 127 | + uses: actions/download-artifact@v3 |
| 128 | + with: |
| 129 | + name: libraries-arriesgado |
| 130 | + - name: Unpack libraries |
| 131 | + run: tar -xzvf libraries-arriesgado.tar.gz |
| 132 | + - name: STOPGAP remove conflicting submoduled header libraries from the tarball extract |
| 133 | + run: rm ./libraries-arriesgado/include/fsgrid.hpp ./libraries-arriesgado/include/dccrg.hpp |
| 134 | + - name: Make clean |
| 135 | + run: VLASIATOR_ARCH=arriesgado make clean |
| 136 | + - name: Compile vlasiator (RISC-V) |
| 137 | + run: | |
| 138 | + srun --interactive -p arriesgado-jammy -J vlasiator_build -n 1 -c 4 --pty -t 01:00:00 bash -lc 'module load boost papi openmpi; export VLASIATOR_ARCH=arriesgado; make -j4' |
| 139 | + - name: Upload riscv binary |
| 140 | + uses: actions/upload-artifact@v3 |
| 141 | + with: |
| 142 | + name: vlasiator-riscv |
| 143 | + path: vlasiator |
| 144 | + if-no-files-found: error |
| 145 | + |
| 146 | + build_tools: |
| 147 | + # Build vlsvdiff and vlsvextract for testpackage use |
| 148 | + runs-on: carrington |
| 149 | + |
| 150 | + steps: |
| 151 | + - name: Clean workspace |
| 152 | + run: | |
| 153 | + rm -rf libraries library-build testpackage |
| 154 | + rm -f libraries.tar.zst dtestpackage_check_description.txt testpackage-output.tar.gz metrics.txt stdout.txt stderr.txt testpackage_output_variables.txt |
| 155 | + rm -f *.xml |
| 156 | + - name: Checkout source |
| 157 | + uses: actions/checkout@v3 |
| 158 | + with: |
| 159 | + submodules: true |
| 160 | + - uses: ursg/gcc-problem-matcher@master |
| 161 | + - name: Make clean |
| 162 | + run: VLASIATOR_ARCH=carrington_gcc_openmpi make clean |
| 163 | + - name: Compile tools |
| 164 | + run: | |
| 165 | + export VLASIATOR_ARCH=carrington_gcc_openmpi |
| 166 | + srun -M carrington --job-name tp_compile --interactive --nodes=1 -n 1 -c 16 --mem=40G -p short -t 0:10:0 bash -c 'module purge; module load GCC/11.2.0; module load OpenMPI/4.1.1-GCC-11.2.0 ; module load PMIx/4.1.0-GCCcore-11.2.0; module load PAPI/6.0.0.1-GCCcore-11.2.0; export VLASIATOR_ARCH=carrington_gcc_openmpi; make -j 16 vlsvextract vlsvdiff' |
| 167 | + - name: Upload tools binaries |
| 168 | + uses: actions/upload-artifact@v3 |
| 169 | + with: |
| 170 | + name: vlasiator-tools |
| 171 | + path: | |
| 172 | + vlsvextract_DP |
| 173 | + vlsvdiff_DP |
| 174 | + if-no-files-found: error |
| 175 | + |
| 176 | + run_testpackage: |
| 177 | + # Run the testpackage on the carrington cluster |
| 178 | + runs-on: carrington |
| 179 | + needs: [build_testpackage, build_tools] |
| 180 | + continue-on-error: true |
| 181 | + |
| 182 | + steps: |
| 183 | + - name: Checkout source |
| 184 | + uses: actions/checkout@v3 |
| 185 | + with: |
| 186 | + submodules: true |
| 187 | + - name: Download testpackage binary |
| 188 | + uses: actions/download-artifact@v3 |
| 189 | + with: |
| 190 | + name: vlasiator-testpackage |
| 191 | + - name: Download tools |
| 192 | + uses: actions/download-artifact@v3 |
| 193 | + with: |
| 194 | + name: vlasiator-tools |
| 195 | + - name: Run testpackage |
| 196 | + id: run |
| 197 | + run: | |
| 198 | + chmod +x $GITHUB_WORKSPACE/vlasiator |
| 199 | + chmod +x $GITHUB_WORKSPACE/vlsv*_DP |
| 200 | + cd testpackage |
| 201 | + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GITHUB_WORKSPACE/libraries/lib |
| 202 | + #srun -M carrington -t 01:30:00 --job-name CI_testpackage --interactive --nodes=1 -c 4 -n 16 --mem-per-cpu=5G -p short ./small_test_carrington_github_ci.sh |
| 203 | + sbatch -W -o testpackage_run_output.txt ./small_test_carrington_github_ci.sh |
| 204 | + cat testpackage_run_output.txt |
| 205 | + cat $GITHUB_STEP_SUMMARY > $GITHUB_WORKSPACE/testpackage_check_description.txt |
| 206 | + cd $GITHUB_WORKSPACE |
| 207 | + tar -czvf testpackage-output.tar.gz testpackage_check_description.txt testpackage_output_variables.txt |
| 208 | + if [ -f $GITHUB_WORKSPACE/testpackage_failed ]; then |
| 209 | + # Fail this step if any test failed. |
| 210 | + exit 1 |
| 211 | + fi |
| 212 | + - name: Upload testpackage output |
| 213 | + uses: actions/upload-artifact@v3 |
| 214 | + if: always() |
| 215 | + with: |
| 216 | + name: testpackage-output |
| 217 | + path: testpackage-output.tar.gz |
| 218 | + # Note: Testpackage output is further processed in the pr_report.yml workflow |
| 219 | + # (to produce Checks against pull requests) |
| 220 | + |
| 221 | + build_ionosphereTests: |
| 222 | + # Build IonosphereSolverTests miniApp (currently broken) |
| 223 | + runs-on: carrington |
| 224 | + #container: ursg/vlasiator_ci:20230220_1 |
| 225 | + needs: [build_libraries] |
| 226 | + steps: |
| 227 | + - name: Checkout source |
| 228 | + uses: actions/checkout@v3 |
| 229 | + with: |
| 230 | + submodules: true |
| 231 | + # - name: Download libraries |
| 232 | + # uses: actions/download-artifact@v3 |
| 233 | + # with: |
| 234 | + # name: libraries |
| 235 | + # - name: Unpack libraries |
| 236 | + # run: tar --zstd -xvf libraries.tar.zstd |
| 237 | + # - uses: ursg/gcc-problem-matcher@master |
| 238 | + - name: Compile ionosphereSolverTests |
| 239 | + run: | |
| 240 | + cd mini-apps/ionosphereSolverTests/ |
| 241 | + srun -M carrington --job-name iST_compile --interactive --nodes=1 -n 1 -c 3 --mem=40G -p short -t 0:10:0 bash -c 'module purge; module load GCC/11.2.0; module load OpenMPI/4.1.1-GCC-11.2.0 ; module load PMIx/4.1.0-GCCcore-11.2.0; module load PAPI/6.0.0.1-GCCcore-11.2.0; export VLASIATOR_ARCH=carrington_gcc_openmpi; make -j 3 main differentialFlux sigmaProfiles' |
| 242 | + # VLASIATOR_ARCH=carrington_gcc_openmpi make -j 3 main differentialFlux sigmaProfiles |
| 243 | + - name: Upload ionosphereTest binaries |
| 244 | + uses: actions/upload-artifact@v3 |
| 245 | + with: |
| 246 | + name: vlasiator-tools |
| 247 | + path: | |
| 248 | + mini-apps/ionosphereSolverTests/main |
| 249 | + mini-apps/ionosphereSolverTests/differentialFlux |
| 250 | + mini-apps/ionosphereSolverTests/sigmaProfiles |
| 251 | + if-no-files-found: error |
0 commit comments