-
Notifications
You must be signed in to change notification settings - Fork 3
Updated files for creating CESM cases under git(hub) control #93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Hi @kdraeder Cheers, |
|
The kind of review depends on who you think the right audience is. |
hkershaw-brown
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Kevin,
I put some notes on things I did not follow. In general I'd say it reads like record of what you have done to keep track of cases. I'm not sure if
I think in general for anyone putting their case directory under version control for a particular experiment, they would do the following, rather than
cd case_directory
git init
git add .
git commit
git push to their own github repo
I think if other people are going to use (commit to) DART_CASEs then you'll need some way to enforce unique names for the branches, or protect the branches.
| They should not be merged into main, in order to keep the size of the branches small, | ||
| which allows more to fit within github's limit on free repositories. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the GitHub limit is everything (all branches) in the repo.
| 1. Set the CASE name for this assimilation. | ||
| If you're **re**using a DART\_CASES-controlled case name, | ||
| clean the existing git branch, which might mean just | ||
|
|
||
| ` git rm -r $CASE ; git branch -d $CASE ` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why would you delete an existing branch?
What if someone else made the case?
| 3. Add lines like this before create\_newcase | ||
|
|
||
| ``` | ||
| git clone git@github.com:<your_github>/DART_CASES.git $EXP/${CASE}_git ` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is for <your_github> rather than NCAR/DART_CASES
| 7. Update the CASEROOT variable in CESM. | ||
| 8. `git add` the files that should be archived. You can use a variant of list\_of\_files\_to\_commit.csh | ||
| 9. Commit them (with a useful message) | ||
| 10. Push the contents of the CASE branch to DART\_CASES. There is a special syntax to push the new branch to the GitHub repository when the branch does not exist yet in the "origin". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you taking about push -u here?
You can push any branch to the origin.
| or are, but want to keep your cases separate from other DAReS CASEs, | ||
| fork https://github.com/NCAR/DART_CASES.git to your github. | ||
| 1. Put a copy of list\_of\_files\_to\_commit.csh (found in the top directory | ||
| of branch "main") into your shell\_scripts directory. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is shell_scripts in
DART/modesl/cam-fv/shell_scripts ?
| 0. If you're not an employee in NSF NCAR's Data Assimilation Research Section, | ||
| or are, but want to keep your cases separate from other DAReS CASEs, | ||
| fork https://github.com/NCAR/DART_CASES.git to your github. | ||
| 1. Put a copy of list\_of\_files\_to\_commit.csh (found in the top directory |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not add everything in the case?
|
Thanks for pointing out One question that may determine the answers to a lot of others is whether there should be an archive You started a thought with "I'm not sure if", which I'm guessing ends with something like "anyone else will want to do it this way". Entirely possible, and helpful to know, if you think that's the case. So far it looks to me like Good point about enforcing the branch names. I'll look into that if the strategy I've proposed survives the review. If this seems like it could be useful to anyone but me, I'll clarify the confusing parts. Thanks for working through it. |
|
I think my brain was farting when I made the comment, there are two sentences that just tail off. The init would be for a new repo for each case. So ignore that if you are using a branch for each case, you have it correct for the branch for each case. I think the thing I would be worried about would be multiple people using (or deleting the same branch). So long as people are aware of that when they make use of this CASES repo. |
|
To add a bit more to my tutorial; does 'a new repo for each case' mean only a local repo, I'll work on the protection for branches, and answer your other questions. |
|
new repo for each case, github and local. But ignore that for your method which is this one repo, with a branch for each case |
I dug into the old style branch protection and the newer "rule sets" and eventually found what I think I want But, of course, that option is not offered in the form that defines a new branch rule. |
|
I've looked into the protection of branches some more, run some tests, and need someone to test some things I cloned a repository onto /glade: I put some files in what would be the CESM CASE directory; .../Git_perms2/example_file. I (re)initialized it to impose the permissions I want to protect this "CESM assimilation CASE" I checked out the new branch, named the same as the CASE So now I'm wondering; do the permission restrictions on HEAD and index prevent other people |
|
Hi Kevin I'm not sure what your goal is here. You can't prevent someone cloning this repo and making changes in their local clone. |
|
This is partly about understanding how git(hub) actually works. I've read a lot of confusing documentation and comments about it, so I'm figuring out relationships between local file permissions, local git permissions (init --shared), and github branch protections. So far it seems that local permissions have nothing to do with github branch protections and can't be propagated to there, but branch protections are not my focus at the moment. It's partly about my wanting to set up 2 kinds of assimilations; cases where I don't want anyone else to be able to do work in the local directories or push to github, and cases where I do. An example of the latter is the Reanalysis, which should at least be easy for someone else in the group to continue if I weren't able to, and ideally would be run by more than 1 person, so that no one is responsible for it 100% of the time. During the Reanalysis we decided that changes to the run configuration should be approved by someone and archived on github. One or more people need permission to do each stage of this; change files, add and commit them to git, push them to github, approve them, and run the job. The immediate goal here is that I've created a case in which I think that I've given permission to group members to change the files, but not commit them to git. I need someone else in the group to test that. |
|
I cannot read any of your work directory: ls -l /glade/work/raeder/Exp |
|
This is partly about understanding how git(hub) actually works. I've read a lot of confusing documentation and comments about it, so I'm figuring out relationships between local file permissions, local git permissions (init --shared), and github branch protections. So far it seems that local permissions have nothing to do with github branch protections and can't be propagated to there, but branch protections are not my focus at the moment. It's partly about my wanting to set up 2 kinds of assimilations; cases where I don't want anyone else to be able to do work in the local directories or push to github, and cases where I do. An example of the latter is the Reanalysis, which should at least be easy for someone else in the group to continue if I weren't able to, and ideally would be run by more than 1 person, so that no one is responsible for it 100% of the time. During the Reanalysis we decided that changes to the run configuration should be approved by someone and archived on github. One or more people need permission to do each stage of this; change files, add and commit them to git, push them to github, approve them, and run the job. The immediate goal here is that I've created a case in which I think that I've given permission to group members to change the files, but not commit them to git. I need someone else in the group to test that. [2024-4-10 Oops, forgot to submit this comment weeks ago] |
The previous instructions applied to putting existing cases under git(hub) control.
These additions describe how to create a controlled CESM case in a way that keeps cases separate for cleanly working with multiple cases simultaneously.