Skip to content

NCRC github.inl.gov transition guide

Logan Harbour edited this page Feb 1, 2023 · 14 revisions

The NCRC at INL is transitioning all protected, distributed software to github.inl.gov. This service is public and will not require a proxy through INL HPC or hpcondemand to access resources remotely.

Follow these instructions in order to complete the transition. If you have any questions, please feel free to ask questions by e-mailing moose-ncrc@inl.gov.

Signing into github.inl.gov

Proceed to mooseframework.inl.gov/help/inl/applications.html and click on the "Level 4 - Source Access" link for your application of interest. The "Cloning" section contains information for how to first login and setup SSH key access to the new service.

Copying your application forks

If you are a developer, you likely "forked" applications in order to develop in your own repository before creating merge requests. If you would like to move these forks, you may do so with the instructions that follow. Note that all forks on hpcgitlab.hpc.inl.gov will remain archived for your access in the future as needed.

First, proceed to github.inl.gov/ncrc, find the repo you want to fork, go to it, and click "Fork" in the top right corner.

Set the following environment variables based on your case, where <HPC_USERNAME> should be set to your INL HPC username, <GITHUBINL_USERNAME> should be set to your github.inl.gov username, and <REPO_NAME> should be set to the name of the repo:

export HPC_USERNAME=<HPC_USERNAME>
export GITHUBINL_USERNAME=<GITHUBINL_USERNAME>
export REPO_NAME=<REPO_NAME>

For example, if my HPC username was billb, my GitHub username was billy-bob, and I wanted to port my bison fork, I would run the following:

export HPC_USERNAME=billb
export GITHUBINL_USERNAME=billy-bob
export REPO_NAME=bison

After setting the variables, copy and run the following (with no need to change anything as you have set the variables above):

mkdir ~/move_fork
cd ~/move_fork
git clone --bare git@hpcgitlab.hpc.inl.gov:${HPC_USERNAME}/${REPO_NAME}.git
cd ${REPO_NAME}.git
git push --all --force git@github.inl.gov:${GITHUBINL_USERNAME}/${REPO_NAME}.git
cd ..
rm -rf ~/move_fork

Updating cloned repos

Updating a currently cloned repository is quite situational. To see how your current remotes are setup in a cloned repo, run the following in the repo:

git remote -v

The commands that follow are to be ran from within the repository. Change <GITHUB_USERNAME> to your github.inl.gov username and <REPO_NAME> to the name of the repo.

Please choose one of the following depending on your situation and the outcome of the command above:

  • With just origin: You have an origin remote that points to an idaholab repository, i.e., git@hpcgitlab.hpc.inl.gov:idaholab/<REPO_NAME>. This will be the case if you cloned an application's repository without forking it.
  • With origin and upstream: You have an origin remote that points to your fork and a upstream remote that points to the main repository (an idaholab repository). The method is used explicitly in the Bison setup instructions.
  • Neither of the above: You don't fit into one of the above.
  • You are a git master: You're very comfortable with git. You just want to be told what to do in a summary.

With just origin

git remote set-url origin git@github.inl.gov:ncrc/<REPO_NAME>.git

With origin and upstream

Set <GITHUBINL_USERNAME> to your github.inl.gov username and <REPO_NAME> to the name of the repo:

git remote set-url origin git@github.inl.gov:<GITHUBINL_USERNAME>/<REPO_NAME>.git
git remote set-url upstream git@github.inl.gov:ncrc/<REPO_NAME>.git

Neither of the above

Contact us at moose-ncrc@inl.gov. We're glad to help.

You are a git master

  • Change whatever your upstream remote is to git@github.inl.gov:ncrc/<REPO_NAME>.git
  • Change fork remotes to git@github.inl.gov:<USERNAME>/<REPO_NAME>.git

Updating cloned repo submodules

For applications that have protected submodules (the vast majority of them), you will also need to update what those submodules point to.

First, you must be on a branch that is up to date with the latest version of the application. This could be checking out a devel or master branch and making sure it is up to date, or rebasing a development branch on an up-to-date branch. For assistance with this, please feel free to contact us.

Once you are on a branch that is up to date, simply run:

git submodule sync