-
Notifications
You must be signed in to change notification settings - Fork 1
[NESSI 2022.11] Making a pull request to the NESSI 2022.11 software layer
This page describes how to add software to the NESSI/2022.11 software stack. Overall the steps are as follows
- Set up directory (local git repository) connected to GitHub repositories
- Create a new branch in that directory (local git repository)
- Add a software package to be built
- Commit the changes and push it to your fork of the software-layer repository
- Create a pull request (PR) to branch
nessi.no-2022.11-dev
of theNorESSI/software-layer
repository
We assume that you have forked EESSI/software-layer and followed the steps to set up SSH-based access to GitHub. In the example, we name our working directory foss-2022a
. Any name will do. In the commands, replace YOUR_GH_ACCOUNT
with you actual GitHub account.
Run
git clone [email protected]:YOUR_GH_ACCOUNT/software-layer foss-2022a
which prints something like
Cloning into 'foss-2022a'...
remote: Enumerating objects: 1731, done.
remote: Counting objects: 100% (482/482), done.
remote: Compressing objects: 100% (220/220), done.
remote: Total 1731 (delta 271), reused 430 (delta 224), pack-reused 1249
Receiving objects: 100% (1731/1731), 449.44 KiB | 1.16 MiB/s, done.
Resolving deltas: 100% (951/951), done.
Change directory and show remotes
cd foss-2022a
git remote -v
The second command will print something like
origin [email protected]:YOUR_GH_ACCOUNT/software-layer (fetch)
origin [email protected]:YOUR_GH_ACCOUNT/software-layer (push)
Change the name of the remote to make more clear that it is your fork (YOUR_REMOTE
below could be identical to your GitHub account name YOUR_GH_ACCOUNT
)
git remote rename origin YOUR_REMOTE
Add a remote for the target repository NorESSI/software-layer
git remote add NorESSI [email protected]:NorESSI/software-layer
Show all remotes
git remote -v
This should print something like
NorESSI [email protected]:NorESSI/software-layer (fetch)
NorESSI [email protected]:NorESSI/software-layer (push)
YOUR_REMOTE [email protected]:YOUR_GH_ACCOUNT/software-layer (fetch)
YOUR_REMOTE [email protected]:YOUR_GH_ACCOUNT/software-layer (push)
Now fetch contents of the NorESSI remote
git fetch NorESSI
This should print something like
remote: Enumerating objects: 3, done.
remote: Counting objects: 100% (3/3), done.
remote: Total 3 (delta 2), reused 3 (delta 2), pack-reused 0
Unpacking objects: 100% (3/3), done.
From github.com:NorESSI/software-layer
* [new branch] main -> NorESSI/main
* [new branch] nessi.no-2022.11-dev -> NorESSI/nessi.no-2022.11-dev
Create a new branch for the changes you want to make
git branch nessi.no-2022.11-foss-2022a-GCC-11.2.0 NorESSI/nessi.no-2022.11-dev
This should print something like
Branch 'nessi.no-2022.11-foss-2022a-GCC-11.2.0' set up to track remote branch 'nessi.no-2022.11-dev' from ’NorESSI'.
Note 1, while you can freely chose a name for the first argument (e.g., nessi.no-2022.11-foss-2022a-GCC-11.2.0), it might be good if it denotes the target repository (nessi.no-2022.11), the tool chain (foss-2022a) and the software to be added (GCC-11.2.0) ... exact naming should follow some agreed conventions to understand easily what the intention of the pull request will be.
Note 2, the second argument is fixed (as of now).
Show overview of branches
git branch
Should print (*
denotes the state of the directory, i.e., which branch it refers to)
* main
nessi.no-2022.11-foss-2022a-GCC-11.2.0
Show more detailed information about branches
git branch -vv
Should print something like
* main d7446ab [YOUR_REMOTE/main] Merge pull request #215 from trz42/enhancement/single_src_for_defaults
nessi.no-2022.11-foss-2022a-GCC-11.2.0 32aa711 [NorESSI/nessi.no-2022.11-dev] fix RUN_QUIET setting
Checkout the branch you created for your changes
git checkout nessi.no-2022.11-foss-2022a-GCC-11.2.0
Should print something like
Switched to branch 'nessi.no-2022.11-foss-2022a-GCC-11.2.0'
Your branch is up to date with ’NorESSI/nessi.no-2022.11-dev’.
Add the software you want to build by editing EESSI-pilot-install-software.sh
vim EESSI-pilot-install-software.sh
The changes are shown by the following command
git diff
This should print
diff --git a/EESSI-pilot-install-software.sh b/EESSI-pilot-install-software.sh
index 5d8ab76..26ac9f7 100755
--- a/EESSI-pilot-install-software.sh
+++ b/EESSI-pilot-install-software.sh
@@ -459,6 +459,15 @@ echo_green "All set, let's start installing some software in ${EASYBUILD_INSTALL
#cat $($EB --last-log)
#check_exit_code $exit_code "${ok_msg}" "${fail_msg}"
+## install GCC/11.2.0 for foss/2022a
+export GCC_EC="GCC-11.2.0.eb"
+echo ">> Starting slow with ${GCC_EC} ..."
+ok_msg="${GCC_EC} installed, yippy! Off to a good start..."
+fail_msg="Installation of ${GCC_EC} failed!"
+$EB --robot ${GCC_EC}
+check_exit_code $? "${ok_msg}" "${fail_msg}"
echo ">> Creating/updating Lmod cache..."
export LMOD_RC="${EASYBUILD_INSTALLPATH}/.lmod/lmodrc.lua"
Add and commit changes
git commit -am "Adding GCC/11.2.0 to NESSI/2022.11"
Should print something like
[nessi.no-2022.11-GCC-11.2.0 7eb8308] Adding GCC/11.2.0 to NESSI/2022.11
1 file changed, 7 insertions(+)
Push changes to your fork (important to not pushing it directly to NorESSI/software-layer)
git push YOUR_REMOTE nessi.no-2022.11-GCC-11.2.0
Should print something like
Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
Delta compression using up to 8 threads
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 567 bytes | 567.00 KiB/s, done.
Total 3 (delta 2), reused 0 (delta 0)
remote: Resolving deltas: 100% (2/2), completed with 2 local objects.
remote:
remote: Create a pull request for 'nessi.no-2022.11-GCC-11.2.0' on GitHub by visiting:
remote: https://github.com/YOUR_GH_ACCOUNT/software-layer/pull/new/nessi.no-2022.11-GCC-11.2.0
remote:
To github.com:YOUR_GH_ACCOUNT/software-layer
* [new branch] nessi.no-2022.11-GCC-11.2.0 -> nessi.no-2022.11-GCC-11.2.0
- Open the link shown by the
git push
command (see above). The image below shows what you need to change. - (1st highlighted area) On the page, be careful to change the target of the pull request.
- Change 'base repository' from
EESSI/software-layer
toNorESSI/software-layer
. - Change 'base' from
main
tonessi.no-2022.11-dev
- Change 'base repository' from
- (2nd highlighted area) Add a meaningful title, e.g., "Add GCC/11.2.0 to NESSI/2022.11" or "Add package/version with toolchain to NESSI/2022.11"
- (3rd highlighted area) A short comment might be useful.
- It might be good to scroll down and verify that the pull request contains the changes (see
files
). - (4th highlighted area) Change to 'Create pull request' and click the button.
- A complete example pull request might look like the screenshot below