Skip to content

Commit 3ffd354

Browse files
committed
create config for RHEL build
1 parent 2ecdd54 commit 3ffd354

File tree

11 files changed

+176
-89
lines changed

11 files changed

+176
-89
lines changed

.github/workflows/g2new-redhat.yml

Lines changed: 34 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -20,44 +20,54 @@ jobs:
2020
name: gsas2new build on RHEL
2121
runs-on: self-hosted
2222
steps:
23-
# - name: create Python environment
23+
# - name: create Python run environment
2424
# shell: bash -l {0}
2525
# run: |
2626
# source /local/bht/mf3/bin/activate
27-
# conda create -p /local/bht/py313 python=3.13 numpy=2.2 \
27+
# conda create -p /local/bht/py313-run python=3.13 numpy=2.2 \
2828
# wxpython pyopengl PyCifRW pillow gitpython matplotlib scipy \
2929
# conda requests h5py imageio zarr xmltodict pybaselines seekpath \
30-
# cython meson pytest -y -c conda-forge --quiet
31-
# source /local/bht/py313/bin/activate
30+
# pytest -y -c conda-forge --quiet
31+
# source /local/bht/py313-run/bin/activate
32+
# which python
33+
# python -VV
34+
35+
# - name: create Python build environment
36+
# shell: bash -l {0}
37+
# run: |
38+
# source /local/bht/mf3/bin/activate
39+
# conda create -p /local/bht/py313-build python=3.13 numpy=2.2 \
40+
# gitpython cython meson conda-build anaconda-client -y -c conda-forge --quiet
41+
# source /local/bht/py313-build/bin/activate
3242
# which python
3343
# which meson
3444
# python -VV
35-
36-
- name: setup for build
45+
46+
47+
- name: clone build repo
3748
shell: bash -l {0}
3849
run: |
39-
source /local/bht/py313/bin/activate
40-
mkdir -p /local/bht/build-tmp
41-
cd /local/bht/build-tmp
42-
curl -L -O https://raw.githubusercontent.com/AdvancedPhotonSource/GSAS-II-buildtools/refs/heads/main/install/gitcompile.py
43-
python gitcompile.py --noshortcut --noprogress
50+
git clone https://github.com/AdvancedPhotonSource/GSAS-II-buildtools.git --depth 1 /local/bht/buildtools
51+
52+
# - name: setup for build
53+
# shell: bash -l {0}
54+
# run: |
55+
# source /local/bht/py313/bin/activate
56+
# mkdir -p /local/bht/build-tmp
57+
# cd /local/bht/build-tmp
58+
## curl -L -O https://raw.githubusercontent.com/AdvancedPhotonSource/GSAS-II-buildtools/refs/heads/main/install/gitcompile.py
59+
# cp /local/bht/buildtools/install/gitcompile.py .
60+
# python gitcompile.py --noshortcut --noprogress
4461

4562
- name: create gsas2new conda package
4663
shell: bash -l {0}
4764
run: |
48-
cd install
49-
if [ "$RUNNER_OS" == "Windows" ]; then
50-
echo "Windows build"
51-
python GSAS2new/makeBldFiles.py
52-
#conda config --set anaconda_upload yes
53-
#conda build GSAS2new --output-folder C:/tmp/builds --user briantoby --token ${{ secrets.ANACONDA_TOKEN }}
54-
else
55-
echo "Unix build"
56-
python GSAS2new/makeBldFiles.py
57-
#conda build GSAS2new --output-folder ~/build # use below due to patch above
58-
#conda build GSAS2new --output-folder ~/build --package-format .conda
59-
#anaconda -t ${{ secrets.ANACONDA_TOKEN }} upload ~/build/*/*.conda --user briantoby --force
60-
fi
65+
source /local/bht/py313-build/bin/activate
66+
cd /local/bht/buildtools/install/GSAS2new
67+
# kludge build.sh
68+
conda config --set anaconda_upload yes
69+
conda build RHEL --output-folder /local/bht/conda-build
70+
#anaconda -t ${{ secrets.ANACONDA_TOKEN }} upload ~/build/*/*.conda --user briantoby --token ${{ secrets.ANACONDA_TOKEN }}
6171
6272
# - name: create gsas2new self-installer
6373
# shell: bash -l {0}

.github/workflows/g2new-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build the gsas2new self-installer for all supported platforms and then test them.
1+
name: Build & test gsas2new self-installer on all platforms
22
# Called from .github/workflows/G2new-test_matrix.yml
33

44
permissions:

.github/workflows/matrix_comp-test.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
name: compile & test binaries (meson)
2-
# this passes on the matrix settings to another workflow
3-
# with multiple jobs. Intended to replace compile-all-meson.yml
2+
# this passes on the matrix settings to another workflow (comp-test.yml)
3+
# that compiles the binaries and tests them.
44
#
5-
# alas, there does not seem to be much point to building Linux binaries on
6-
# Ubuntu-latest
75

86
permissions:
97
contents: write
108

119
on:
12-
workflow_dispatch: # nice for debugging
10+
workflow_dispatch: # nice to have for debugging
1311

1412
# repository_dispatch: # TODO: launch from GSASII repo via Web API
1513

@@ -19,7 +17,7 @@ jobs:
1917
fail-fast: false
2018

2119
matrix:
22-
os: [windows-latest, macos-13, macos-14]
20+
# os: [windows-latest, macos-13, macos-14]
2321
# N.B. glibc on the ubuntu runners is way too new for use on Redhat systems
2422
# so build that on Redhat for dist as a GH release asset (see tinodi_build.sh)
2523
# os: [ubuntu-latest, windows-latest, macos-13, macos-14]

.github/workflows/matrix_g2new-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: build & test self-installers (gsas2new)
22
# Master workflow to build and test the gsas2new*.(exe,sh) self-installers
33
# this passes on the matrix settings to another workflow
4-
# with multiple jobs. Intended to replace gsas2new.yml
4+
# with multiple jobs.
55

66
permissions:
77
contents: write

install/GSAS2new/RHEL/EULA.txt

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
====================================================
2+
This is a single-download installer for GSAS-II. It includes other
3+
software such as Git, used to install and update GSAS-II, a Python
4+
interpreter and a number of Python packages required by GSAS-II. The
5+
installer you are running will install Python, etc. and then will install
6+
the packaged version of GSAS-II, as listed above. Once that has been
7+
completed, the software will invoke the gitstrap.py script, which will
8+
use git to update to the latest version of GSAS-II (this requires an
9+
internet connection). Then it will create shortcuts to simplify
10+
GSAS-II use. Note that the gitstrap.py script can be rerun manually to
11+
obtain updates.
12+
13+
*** Note that while this installer can be used again to install
14+
GSAS-II in a new location, once these files are installed, they should
15+
not be moved. ***
16+
17+
If you use GSAS-II in your research, please show your support by citing:
18+
B.H. Toby & R.B. Von Dreele, J. Appl. Cryst. 46, 544-549 (2013)
19+
(also see Help/About)
20+
21+
See the LICENSE file in the GSAS-II source code
22+
(https://github.com/AdvancedPhotonSource/GSAS-II) for software license
23+
information. In addition, this installer uses the BSD-3-Clause license
24+
and additional tools associated with it have their own licensing
25+
terms, which are licensed under BSD-3-Clause, MIT and OpenSSL
26+
licenses. By installing this you agree to the licensing terms of individual
27+
packages as well. Licenses and copyright notices of these
28+
projects can be found at the following URL:
29+
https://github.com/conda-forge/micromamba-feedstock/tree/master/recipe.
30+
31+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
32+
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
33+
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
34+
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
35+
DISCLAIMED. IN NO EVENT SHALL CONTINUUM ANALYTICS BE LIABLE
36+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
37+
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
38+
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
39+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
40+
AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
41+
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
42+
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
43+
THE POSSIBILITY OF SUCH DAMAGE.
44+
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# these are the packages needed to build/upload the GSAS2new conda package
2+
# that contains GSAS-II and its .git directory. Too minimal to run GSAS-II.
3+
name: conda-build-env
4+
channels:
5+
- conda-forge
6+
dependencies:
7+
- python
8+
- numpy
9+
- conda
10+
- conda-build
11+
- constructor
12+
- git
13+
- gitpython
14+
- anaconda-client
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/bin/bash
2+
logfile=/tmp/g2post_out.log
3+
gitlog1=/tmp/gitstrap1.log
4+
gitlog2=/tmp/gitstrap2.log
5+
echo "Finish up GSAS-II installation"
6+
# update the GSAS-II package if possible, create shortcuts & byte-compile...
7+
echo "launching bootstrap process"
8+
# try to update to latest GSAS-II version (will fail if no network)
9+
source $PREFIX/bin/activate
10+
echo python $PREFIX/gitstrap.py --nocheck --log=$gitlog1 --noshortcut >> $logfile 2>&1
11+
python $PREFIX/gitstrap.py --nocheck --log=$gitlog1 --noshortcut >> $logfile 2>&1
12+
# finish installation
13+
echo python $PREFIX/gitstrap.py --nocheck --log=$gitlog2 --nodownload >> $logfile 2>&1
14+
python $PREFIX/gitstrap.py --nocheck --log=$gitlog2 --nodownload >> $logfile 2>&1
15+
#============================================================================
16+
#============================================================================
17+
# create scripts that might be of use for GSAS-II
18+
#============================================================================
19+
# create bootstrap-reset script
20+
resetScript=$PREFIX/bin/reset-gsasII.sh
21+
echo "# Commands to run GSAS-II load/update process" > $resetScript
22+
echo "source $PREFIX/bin/activate" >> $resetScript
23+
echo "$PREFIX/bin/python $PREFIX/gitstrap.py --reset" >> $resetScript
24+
chmod +x $resetScript
25+
#============================================================================
26+
# create start script
27+
startScript=$PREFIX/bin/gsasII.sh
28+
echo "# Commands to start GSAS-II" > $startScript
29+
echo "source $PREFIX/bin/activate" >> $startScript
30+
echo "$PREFIX/bin/python $PREFIX/GSAS-II/GSASII/G2.py \$*" >> $startScript
31+
chmod +x $startScript
32+
#============================================================================
33+
#============================================================================
34+
echo "GSAS-II installer completed"
35+
if [[ "$OSTYPE" == "darwin"* ]]; then
36+
echo "*** GSAS-II app will be highlighted in Finder ***"
37+
echo "*** you may wish to drag it to the dock. ***"
38+
fi
33 KB
Loading

install/GSAS2new/RHEL/gsas2.png

59.1 KB
Loading

install/GSAS2new/RHEL/post-link.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
logfile=/tmp/G2complete_postlink.log
3+
#
4+
#============= Restore the git repository file
5+
#
6+
echo Completing install of GSAS-II from conda package > $logfile
7+
mv -v $PREFIX/GSAS-II/keep_git $PREFIX/GSAS-II/.git >> $logfile 2>&1
8+
mv -v $PREFIX/GSAS-II/keep.gitignore $PREFIX/GSAS-II/.gitignore >> $logfile 2>&1
9+
#
10+
# This does not run gitstrap.py here because it is assumed that will
11+
# happen later when the conda constructor installer runs. If this package
12+
# is ever to be used independently, it should be run here.

0 commit comments

Comments
 (0)