Skip to content
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

Remove manage externals #236

Closed
wants to merge 39 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
e51545d
remove manage_externals
jedwards4b Dec 28, 2023
0530da8
cleanup checkout
jedwards4b Dec 28, 2023
081fffb
update hemco
jedwards4b Dec 29, 2023
261607d
correct FMS branch
jedwards4b Dec 29, 2023
ef5499b
update fms to cesm version
jedwards4b Dec 29, 2023
d16cc63
update cam external
jedwards4b Jan 1, 2024
162c1f8
partial update save
jedwards4b Jan 8, 2024
30fd93a
update most submodules
jedwards4b Jan 8, 2024
d335547
update externals and .gitmodules
jedwards4b Jan 8, 2024
1a584ab
update install and .gitmodules
jedwards4b Jan 8, 2024
3aabd0a
update .gitmodules
jedwards4b Jan 8, 2024
bf52100
update externals
jedwards4b Jan 9, 2024
4061d0f
update cam and clm submodules
jedwards4b Jan 9, 2024
8656685
update clm and fms submodules
jedwards4b Jan 9, 2024
68821b1
update cism
jedwards4b Jan 9, 2024
4b533a0
fix cism .gitmodules file
jedwards4b Jan 10, 2024
062a70b
update cime submodule
jedwards4b Jan 10, 2024
f4f4a4f
update cime
jedwards4b Jan 15, 2024
7a07403
update cime
jedwards4b Jan 15, 2024
5e1543d
update readme and add git-fleximod
jedwards4b Jan 18, 2024
6048455
add fleximod test workflow
jedwards4b Jan 18, 2024
c3b230c
debugging workflow
jedwards4b Jan 18, 2024
44be47d
debugging workflow
jedwards4b Jan 18, 2024
16e5c9b
debugging workflow
jedwards4b Jan 18, 2024
e5d2061
update git-fleximod
jedwards4b Feb 2, 2024
70f0fae
update mizuroute and cime
jedwards4b Feb 2, 2024
4410d8e
update git-fleximod
jedwards4b Feb 2, 2024
cd7c131
update git-fleximod
jedwards4b Feb 2, 2024
a54bde6
update fleximod version
jedwards4b Feb 2, 2024
c51b694
add support for fxhash
jedwards4b Feb 3, 2024
7a45e9a
new poetry based git-fleximod
jedwards4b Feb 4, 2024
3845606
fix issue in git-fleximod script, update ww3dev
jedwards4b Feb 5, 2024
139365a
update pop
jedwards4b Feb 5, 2024
2463c10
Merge commit 'b5d23fbf8b35c12f65ad6b35fb3d969a80740879' as '.lib/git-…
jedwards4b Feb 5, 2024
b5d23fb
Squashed '.lib/git-fleximod/' content from commit 25bcc7e
jedwards4b Feb 5, 2024
46baa05
rearrange folders
jedwards4b Feb 5, 2024
9b06d81
Squashed '.lib/git-fleximod/' changes from 25bcc7e..69a5dc5
jedwards4b Feb 5, 2024
6087c1c
Merge commit '9b06d813e58c6251fef7a0d86f66d610e5619c5f' into remove_m…
jedwards4b Feb 5, 2024
d37e95a
fix issue with creating dirs
jedwards4b Feb 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/workflows/fleximod-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
on:
push:
branches:
- master
- remove_manage_externals
pull_request:
branches:
- master
- remove_manage_externals
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.11"]
steps:
- uses: actions/checkout@v4
- name: git-fleximod test
run: |
$GITHUB_WORKSPACE/bin/git-fleximod test
20 changes: 0 additions & 20 deletions .gitignore

This file was deleted.

189 changes: 189 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,189 @@
# This is a git submodule file with additional support for
# git-fleximod (https://github.com/jedwards4b/git-fleximod)
#
# The additional flags supported by git-fleximod are
# fxtag - the tag associated with the submodule, this tag can be tested for
# consistancy with the submodule hash using git-fleximod status
# the hash can be updated to the tag using git-fleximod update
#
# fxrequired - indicates if a given submodule should be checked out on install
# submoudules can be toplevel or internal and required or optional
# toplevel means that the submodule should only be checked out if the
# module is the toplevel of the git repo (is not a submodule itself)
# internal means that the submodule is needed by the component whether
# the component is toplevel or the submodule of another repo
# required means that the submodule should always be checked out
# optional means that the submodule should only be checked out if the
# optional flag is provided to git-fleximod or the submodule name is
# explicitly listed on the git-fleximod command line.
#
# fxsparse - this is a path to a git sparse checkout file indicating that the
# submodule should be checked out in sparse mode
#
# fxurl - this field is used by git-fleximod test to insure that the url is pointing
# to the official url of the repo and not to an unofficial fork.
# It is intended for use of github workflows to test commits to protected
# repository branches.
#


[submodule "ccs_config"]
path = ccs_config
url = https://github.com/ESMCI/ccs_config_cesm.git
fxurl = https://github.com/ESMCI/ccs_config_cesm.git
fxtag = ccs_config_cesm0.0.88
fxrequired = T:T

[submodule "share"]
path = share
url = https://github.com/ESCOMP/CESM_share
fxurl = https://github.com/ESCOMP/CESM_share
fxtag = share1.0.18
fxrequired = T:T

[submodule "cime"]
path = cime
url = https://github.com/jedwards4b/cime
fxurl = https://github.com/ESMCI/cime
fxtag = cime6.0.198_rme05
fxrequired = T:T

[submodule "mct"]
path = libraries/mct
url = https://github.com/MCSclimate/MCT
fxurl = https://github.com/MCSclimate/MCT
fxrequired = T:T
fxtag = MCT_2.11.0

[submodule "mpi-serial"]
path = libraries/mpi-serial
url = https://github.com/ESMCI/mpi-serial
fxurl = https://github.com/ESMCI/mpi-serial
fxtag = MPIserial_2.5.0
fxrequired = T:T

[submodule "cpl7"]
path = components/cpl7
url = https://github.com/ESCOMP/CESM_CPL7andDataComps
fxurl = https://github.com/ESCOMP/CESM_CPL7andDataComps
fxtag = cpl77.0.7
fxrequired = T:T

[submodule "cam"]
path = components/cam
url = https://www.github.com/jedwards4b/CAM
fxurl = https://www.github.com/ESCOMP/CAM
fxtag = cam6_3_143_rme01
fxrequired = T:T

[submodule "ww3"]
path = components/ww3
url = https://github.com/ESCOMP/WW3-CESM
fxurl = https://github.com/ESCOMP/WW3-CESM
fxtag = ww3_221108
fxrequired = T:T

[submodule "ww3dev"]
path = components/ww3dev
url = https://github.com/jedwards4b/WW3_interface
fxurl = https://github.com/ESCOMP/WW3_interface
fxtag = main_0.0.13_rme02
fxrequired = T:T

[submodule "rtm"]
path = components/rtm
url = https://github.com/ESCOMP/RTM
fxurl = https://github.com/ESCOMP/RTM
fxrequired = T:T
fxtag = rtm1_0_78

[submodule "pysect"]
path = tools/statistical_ensemble_test/pyCECT
url = https://github.com/NCAR/PyCECT
fxurl = https://github.com/NCAR/PyCECT
fxrequired = T:T
fxtag = 3.2.2

[submodule "mosart"]
path = components/mosart
url = https://github.com/ESCOMP/MOSART
fxurl = https://github.com/ESCOMP/MOSART
fxrequired = T:T
fxtag = mosart1_0_48

[submodule "mizuroute"]
path = components/mizuroute
url = https://github.com/jedwards4b/mizuRoute
fxurl = https://github.com/ESCOMP/mizuRoute
fxrequired = T:T
fxtag = cesm-coupling.n02_v2.1.2_rme02

[submodule "fms"]
path = libraries/FMS
url = https://github.com/jedwards4b/FMS_interface
fxurl = https://github.com/ESCOMP/FMS_interface
fxrequired = T:T
fxtag = fi_230818_rme01

[submodule "parallelio"]
path = libraries/parallelio
url = https://github.com/NCAR/ParallelIO
fxurl = https://github.com/NCAR/ParallelIO
fxrequired = T:T
fxtag = pio2_6_2

[submodule "cdeps"]
path = components/cdeps
url = https://github.com/jedwards4b/CDEPS
fxurl = https://github.com/ESCOMP/CDEPS
fxrequired = T:T
fxtag = cdeps1.0.26_rme01

[submodule "cmeps"]
path = components/cmeps
url = https://github.com/ESCOMP/CMEPS.git
fxurl = https://github.com/ESCOMP/CMEPS.git
fxrequired = T:T
fxtag = cmeps0.14.49

[submodule "cice5"]
path = components/cice5
url = https://github.com/ESCOMP/CESM_CICE5
fxurl = https://github.com/ESCOMP/CESM_CICE5
fxrequired = T:T
fxtag = cice5_20220204

[submodule "cice6"]
path = components/cice
url = https://github.com/jedwards4b/CESM_CICE
fxurl = https://github.com/ESCOMP/CESM_CICE
fxrequired = T:T
fxtag = cesm_cice6_4_1_10_rme01

[submodule "cism"]
path = components/cism
url = https://github.com/jedwards4b/cism-wrapper.git
fxurl = https://github.com/ESCOMP/cism-wrapper.git
fxtag = cismwrap_2_1_96_rme02
fxrequired = T:T

[submodule "clm"]
path = components/clm
url = https://github.com/jedwards4b/CTSM
fxurl = https://github.com/ESCOMP/CTSM
fxrequired = T:T
fxtag = branch_tags/CESM3_dev.n04_ctsm5.1.dev145_rme02

[submodule "mom"]
path = components/mom
url = https://github.com/jedwards4b/MOM_interface
fxurl = https://github.com/ESCOMP/MOM_interface
fxrequired = T:T
fxtag = mi_231107_rme01

[submodule "pop"]
path = components/pop
url = https://github.com/jedwards4b/POP2-CESM
fxurl = https://github.com/ESCOMP/POP2-CESM
fxrequired = T:T
fxtag = cesm_pop_2_1_20231208_rme02
13 changes: 13 additions & 0 deletions .lib/git-fleximod/.github/workflows/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: pre-commit
on:
pull_request:
push:
branches: [main]

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: pre-commit/[email protected]
18 changes: 18 additions & 0 deletions .lib/git-fleximod/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
exclude: ^utils/.*$

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 22.3.0
hooks:
- id: black
- repo: https://github.com/PyCQA/pylint
rev: v2.11.1
hooks:
- id: pylint
args:
- --disable=I,C,R,logging-not-lazy,wildcard-import,unused-wildcard-import,fixme,broad-except,bare-except,eval-used,exec-used,global-statement,logging-format-interpolation,no-name-in-module,arguments-renamed,unspecified-encoding,protected-access,import-error,no-member
20 changes: 20 additions & 0 deletions .lib/git-fleximod/License
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Copyright 2024 National Center for Atmospheric Sciences (NCAR)

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
“Software”), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
107 changes: 107 additions & 0 deletions .lib/git-fleximod/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
# git-fleximod

Flexible Submodule Management for Git

## Overview

Git-fleximod is a Python-based tool that extends Git's submodule capabilities, offering additional features for managing submodules in a more flexible and efficient way.

## Installation

#TODO Install using pip:
# pip install git-fleximod
If you choose to locate git-fleximod in your path you can access it via command: git fleximod

## Usage

Basic Usage:
git fleximod <command> [options]
Available Commands:
checkout: Checkout submodules according to git submodule hash configuration.
status: Display the status of submodules.
update: Update submodules to the tag indicated in .gitmodules variable fxtag.
test: Make sure that fxtags and submodule hashes are consistant,
make sure that official urls (as defined by fxurl) are set
make sure that fxtags are defined for all submodules
Additional Options:
See git fleximod --help for more details.

## Supported .gitmodules Variables

fxtag: Specify a specific tag or branch to checkout for a submodule.
fxrequired: Mark a submodule's checkout behavior, with allowed values:
- T:T: Top-level and required (checked out only when this is the Toplevel module).
- T:F: Top-level and optional (checked out with --optional flag if this is the Toplevel module).
- I:T: Internal and required (always checked out).
- I:F: Internal and optional (checked out with --optional flag).
fxsparse: Enable sparse checkout for a submodule, pointing to a file containing sparse checkout paths.
fxurl: This is the url used in the test subcommand to assure that protected branches do not point to forks

## Sparse Checkouts

To enable sparse checkout for a submodule, set the fxsparse variable
in the .gitmodules file to the path of a file containing the desired
sparse checkout paths. Git-fleximod will automatically configure
sparse checkout based on this file when applicable commands are run.
See [git-sparse-checkout](https://git-scm.com/docs/git-sparse-checkout#_internalsfull_pattern_set)
for details on the format of this file.

## Tests

The git fleximod test action is designed to be used by, for example, github workflows
to assure that protected branches are consistant with respect to submodule hashes and fleximod fxtags

## Examples

Here are some common usage examples:

Checkout submodules, including optional ones:
```bash
git fleximod checkout --optional
```

Updating a specific submodule to the fxtag indicated in .gitmodules:

```bash
git fleximod update submodule-name
```
Example .gitmodules entry:
```ini, toml
[submodule "cosp2"]
path = src/physics/cosp2/src
url = https://github.com/CFMIP/COSPv2.0
fxsparse = ../.cosp_sparse_checkout
fxtag = v2.1.4cesm
```
Explanation:

This entry indicates that the submodule named cosp2 at tag v2.1.4cesm
should be checked out into the directory src/physics/cosp2/src
relative to the .gitmodules directory. It should be checked out from
the URL https://github.com/CFMIP/COSPv2.0 and use sparse checkout as
described in the file ../.cosp_sparse_checkout relative to the path
directory.

Additional example:
```ini, toml
[submodule "cime"]
path = cime
url = https://github.com/jedwards4b/cime
fxrequired = T:T
fxtag = cime6.0.198_rme01
```

Explanation:

This entry indicates that the submodule cime should be checked out
into a directory named cime at tag cime6.0.198_rme01 from the URL
https://github.com/jedwards4b/cime. This should only be done if
the .gitmodules file is at the top level of the repository clone.

## Contributing

We welcome contributions! Please see the CONTRIBUTING.md file for guidelines.

## License

Git-fleximod is released under the MIT License.
Loading