Skip to content

Commit

Permalink
why is branch missing so many things?
Browse files Browse the repository at this point in the history
Merge branch 'main' into 136.checkout.tests
  • Loading branch information
ilaflott committed Nov 26, 2024
2 parents dd5051e + 5775bab commit 10ae59b
Show file tree
Hide file tree
Showing 169 changed files with 7,916 additions and 4,957 deletions.
23 changes: 14 additions & 9 deletions .github/workflows/build_conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,18 @@ jobs:
build:
runs-on: ubuntu-latest
container:
image: continuumio/miniconda3:latest
image: ghcr.io/noaa-gfdl/fre-cli:miniconda24.7.1_gcc14.2.0
steps:
- name: Checkout Files
uses: actions/checkout@v4
- name: Run Docker to Build
run: |
conda config --append channels conda-forge
conda config --append channels noaa-gfdl
conda install conda-build conda-verify
conda build .
- name: Checkout Files
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Add mkmf to PATH
run: |
echo $PWD/mkmf/bin >> $GITHUB_PATH
- name: Run Conda to Build
run: |
conda config --append channels conda-forge
conda config --append channels noaa-gfdl
conda install conda-build conda-verify
conda build .
99 changes: 59 additions & 40 deletions .github/workflows/create_test_conda_env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,44 +5,63 @@ on: [push]
jobs:
build-linux:
runs-on: ubuntu-latest

container:
image: ghcr.io/noaa-gfdl/fre-cli:miniconda24.7.1_gcc14.2.0
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '>=3.9'

- name: Add conda to system path
run: |
# $CONDA is an environment variable pointing to the root of the miniconda directory
echo $CONDA/bin >> $GITHUB_PATH
- name: Create fre-cli environment
run: |
# create environment fre-cli will be installed into
conda env create -f environment.yml --name fre-cli
# try to make sure the right things are in GITHUB_PATH
echo $CONDA/envs/fre-cli/bin >> $GITHUB_PATH
# install fre-cli w pip
$CONDA/envs/fre-cli/bin/python -m pip install --prefix $CONDA/envs/fre-cli .
- name: Run pytest in fre-cli environment
run: |
# try to make sure the right things are in GITHUB_PATH
echo $CONDA/envs/fre-cli/bin >> $GITHUB_PATH
which python
python --version
$CONDA/envs/fre-cli/bin/python --version
# run pytest
pytest --config-file=fre/pytest.ini --cov-config=fre/coveragerc --cov=fre fre/
- name: Run pylint in fre-cli environment
run: |
# try to make sure the right things are in GITHUB_PATH
echo $CONDA/envs/fre-cli/bin >> $GITHUB_PATH
which python
python --version
$CONDA/envs/fre-cli/bin/python --version
# run pytest
pylint fre/ || echo "pylint returned non-zero exit code. preventing workflow from dying with this echo."
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Create fre-cli environment
run: |
# create environment containing all dependencies
# the env cannot be explicitly activated in github CI/CD
conda env create -f environment.yml --name fre-cli
# sets CONDA to wherever it may be on the image
source /root/.bashrc
# add conda env's executables and mkmf to github's PATH equiv.
echo $CONDA/envs/fre-cli/bin >> $GITHUB_PATH
echo $PWD/mkmf/bin >> $GITHUB_PATH
# use *conda environment's pip* to install fre-cli
# called w/ full path to conda's python for explicitness
# called as a module (-m pip) for explicitness
$CONDA/envs/fre-cli/bin/python -m pip install --prefix $CONDA/envs/fre-cli .
- name: Run pytest in fre-cli environment
run: |
# add spack installed binaries to front of path so that
# conda's netcdf/hdf5 installs don't break compilation tests
export path_save=$PATH
export PATH="/opt/views/view/bin:$PATH"
# run pytest
pytest --junit-xml=pytest_results.xml --config-file=fre/pytest.ini --cov-config=fre/coveragerc --cov-report=xml --cov=fre fre/
# restore original path and install genbadge to generate coverage badge based on xml
export PATH="$path_save"
pip install genbadge
genbadge coverage -v -i coverage.xml -o docs/cov_badge.svg
genbadge tests -v -i pytest_results.xml -o docs/pytest_badge.svg
- name: Run pylint in fre-cli environment
run: |
# run pylint, ignored modules avoid warnings arising from code internal to those modules
pylint --max-args 6 -ry --ignored-modules netCDF4,cmor fre/ || echo "pylint returned non-zero exit code. preventing workflow from dying with this echo."
- name: Install Sphinx and Build Documentation
run: |
pip install sphinx renku-sphinx-theme sphinx-rtd-theme
pip install --upgrade sphinx-rtd-theme
sphinx-apidoc --output-dir docs fre/ --separate
sphinx-build docs build
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
if: ${{ github.ref == 'refs/heads/main' }}
with:
publish_branch: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: build/
force_orphan: true
27 changes: 0 additions & 27 deletions .github/workflows/documentation.yml

This file was deleted.

29 changes: 17 additions & 12 deletions .github/workflows/publish_conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,25 @@ name: publish_conda
on:
push:
branches:
- main
- main
jobs:
publish:
runs-on: ubuntu-latest
container:
image: continuumio/miniconda3:latest
image: ghcr.io/noaa-gfdl/fre-cli:miniconda24.7.1_gcc14.2.0
steps:
- name: Checkout Files
uses: actions/checkout@v4
- name: Run Docker to Build and Upload
run: |
conda config --append channels conda-forge
conda config --append channels noaa-gfdl
conda install conda-build anaconda-client conda-verify
export ANACONDA_API_TOKEN=${{ secrets.ANACONDA_TOKEN }}
conda config --set anaconda_upload yes
conda build .
- name: Checkout Files
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Add mkmf to PATH
run: |
echo $PWD/mkmf/bin >> $GITHUB_PATH
- name: Run Conda to Build and Publish
run: |
conda config --append channels conda-forge
conda config --append channels noaa-gfdl
conda install conda-build anaconda-client conda-verify
export ANACONDA_API_TOKEN=${{ secrets.ANACONDA_TOKEN }}
conda config --set anaconda_upload yes
conda build .
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@ coverage.xml
.pytest_cache/
cover/

# files pulled/created via testing
fre/tests/test_files/cmip6-cmor-tables/
fre/tests/test_files/outdirfre/
fre/pp/tests/configure_yaml_out/
fre/yamltools/tests/combine_yamls_out/
fre/app/generate_time_averages/tests/time_avg_test_files/

# Translations
*.mo
*.pot
Expand Down
13 changes: 0 additions & 13 deletions .gitlab-ci.yml

This file was deleted.

6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[submodule "mkmf"]
path = mkmf
url = https://github.com/NOAA-GFDL/mkmf
[submodule "fre/gfdl_msd_schemas"]
path = fre/gfdl_msd_schemas
url = https://github.com/NOAA-GFDL/gfdl_msd_schemas
29 changes: 29 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# fre-cli Code of Conduct

## Purpose
Modeling Systems Division, and GFDL as whole, seeks to create a friendly, safe and welcoming environment for all, regardless of gender, sexual orientation, ability, ethnicity, socioeconomic status, and religion. In order to protect this collaborative environment, the following Code of Conduct sets out a series of guidelines to follow while interacting with the fre-cli repository, and its contributors. This code applies equally to mentors, mentees, and independent contributors.

## Expected Behavior
* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the overall
community

## Unacceptable Behavior
* The use of sexualized language or imagery, and sexual attention or advances of
any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email address,
without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Addressing Grievances:
Unacceptable behavior from any community member will not be tolerated. Anyone asked to stop unacceptable behavior is expected to comply immediately. Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by emailing [email protected]

## Attribution
This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org/version/1/4/code-of-conduct.html), version 1.4, the [Citizen Code of Conduct](https://web.archive.org/web/20200330154000/http://citizencodeofconduct.org/), and the [GFDL Code of Conduct](https://www.gfdl.noaa.gov/wp-content/uploads/2022/05/GFDL_Code_of_Conduct.pdf).
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## **For Developers**

* Developers are free to use this repository's `README.md` to familiarize with the CLI and save time from having to install any dependencies, but development within a Conda environment is heavily recommended regardless
* Gain access to the repository with `git clone [email protected]:NOAA-GFDL/fre-cli.git` or your fork's link (recommended) and an SSH RSA key
* Gain access to the repository with `git clone --recursive [email protected]:NOAA-GFDL/fre-cli.git` or your fork's link (recommended) and an SSH RSA key
- Once inside the repository, developers can test local changes by running a `pip install .` inside of the root directory to install the fre-cli package locally with the newest local changes on top of the installed Conda fre-cli dependencies
- Test as a normal user would use the CLI
* Create a GitHub issue to reflect your contribution's background and reference it with Git commits
Expand Down
50 changes: 35 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
<!-- from https://anaconda.org/NOAA-GFDL/fre-cli/badges -->
[![Anaconda-Server Badge](https://anaconda.org/noaa-gfdl/fre-cli/badges/version.svg)](https://anaconda.org/noaa-gfdl/fre-cli)
[![Anaconda-Server Badge](https://anaconda.org/noaa-gfdl/fre-cli/badges/latest_release_date.svg)](https://anaconda.org/noaa-gfdl/fre-cli)
[![Anaconda-Server Badge](https://anaconda.org/noaa-gfdl/fre-cli/badges/latest_release_relative_date.svg)](https://anaconda.org/noaa-gfdl/fre-cli)
[![CI](https://github.com/NOAA-GFDL/fre-cli/workflows/publish_conda/badge.svg)](https://github.com/NOAA-GFDL/fre-cli/actions?query=workflow%3Apublish_conda+branch%3Amain++)
![Coverage Badge](https://noaa-gfdl.github.io/fre-cli/_images/cov_badge.svg)
![Pytest Badge](https://noaa-gfdl.github.io/fre-cli/_images/pytest_badge.svg)

# **FRE-CLI**

FMS Runtime Environment (FRE) CLI developed using Python's Click package

* [Sphinx Page](https://noaa-gfdl.github.io/fre-cli/index.html)
* [Project Outline](https://docs.google.com/document/d/19Uc01IPuuIuMtOyAvxXj9Mn6Ivc5Ql6NZ-Q6I8YowRI/edit?usp=sharing)
* [Sphinx Documentation](https://noaa-gfdl.github.io/fre-cli/index.html)
<!--* ... internal doc, should remove, if anything...
[Project Outline](https://docs.google.com/document/d/19Uc01IPuuIuMtOyAvxXj9Mn6Ivc5Ql6NZ-Q6I8YowRI/edit?usp=sharing) -->

![IMG_1076](https://github.com/NOAA-GFDL/fre-cli/assets/98476720/817cabe1-6e3b-4210-9874-b13f601265d6)

## **Background**

`fre-cli` is a modern, user-friendly CLI that will allow users to call FRE commands using a **_fre_** **tool** _subtool_ syntax. Leveraging Click, an easily installable Python package available via PyPI and/or Conda, `fre-cli` gives users intuitive and easy-to-understand access to many FRE tools and workflows from one packaged, centralized CLI.

![Screenshot from 2024-04-18 13-42-04](https://github.com/NOAA-GFDL/fre-cli/assets/98476720/43c028a6-4e6a-42fe-8bec-008b6758ea9b)
Expand All @@ -29,25 +37,37 @@ FMS Runtime Environment (FRE) CLI developed using Python's Click package

- _Can install local changes on top via `pip`_
- GFDL Workstation:
- `module load miniforge`
- `conda activate /nbhome/fms/conda/envs/fre-cli`
```
module load miniforge
conda activate /nbhome/fms/conda/envs/fre-cli
```
- Gaea:
- `module load miniforge`
- `conda activate /ncrc/home2/Flexible.Modeling.System/conda/envs/fre-cli`

```
module use /usw/conda/modulefiles
module load miniforge
conda activate /ncrc/home2/Flexible.Modeling.System/conda/envs/fre-cli
```

### (Method 3) Developer - Conda Environment Building
* If you have Conda loaded and want to create your OWN environment for development, testing, etc.:

- _Can install local changes on top via `pip`_
- Create a new Conda environment: `conda create -n [environmentName]`
- Append necessary channels
- `conda config --append channels noaa-gfdl`
- `conda config --append channels conda-forge`
- Run `conda install` on needed dependencies (`conda install click` will give you access to pip as well)
- `conda install noaa-gfdl::fre-cli` should install the [CLI package](https://anaconda.org/NOAA-GFDL/fre-cli) created from the [`meta.yaml`](https://github.com/NOAA-GFDL/fre-cli/blob/refactoring/meta.yaml)
- Steps:
```
# Create new conda enironment
conda create -n [environmentName]
# Append necessary channels
conda config --append channels noaa-gfdl
conda config --append channels conda-forge
# Run `conda install` on needed dependencies (`conda install click` will give you access to pip as well)
# should install the [CLI package](https://anaconda.org/NOAA-GFDL/fre-cli) created from the [`meta.yaml`](https://github.com/NOAA-GFDL/fre-cli/blob/refactoring/meta.yaml)
conda install noaa-gfdl::fre-cli
```
- All other dependencies used by the tools are installed along with this install (configured inside the meta.yaml), with the exception of local modules
- setup.py file allows [`fre.py`](https://github.com/NOAA-GFDL/fre-cli/blob/main/fre/fre.py) to be ran with `fre` as the entry point on the command line instead of `python fre.py`
- For further notes on development and contributing to `fre-cli` see [`CONTRIBUTING.md`](https://github.com/NOAA-GFDL/fre-cli/blob/breakup_README/CONTRIBUTING.md)
- For further notes on development and contributing to `fre-cli` see [`CONTRIBUTING.md`](https://github.com/NOAA-GFDL/fre-cli/blob/main/CONTRIBUTING.md)

After one of the above, one can enter commands and follow `--help` messages for guidance. A brief rundown of commands to be provided are within each tool's folder as a `README.md`

Expand Down
2 changes: 0 additions & 2 deletions docs/FAQ.rst

This file was deleted.

4 changes: 4 additions & 0 deletions docs/api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
=============
API
=============
Auto-harvested goodness, coming soon.
7 changes: 7 additions & 0 deletions docs/badges.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.. this file is explicitly for the hyperlinkage in the base README.md to the badge image files
======
Badges
======

.. image:: cov_badge.svg
.. image:: pytest_badge.svg
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

extensions = []
extensions = ['sphinx.ext.autodoc']

templates_path = ['_templates']
exclude_patterns = []
Expand Down
Loading

0 comments on commit 10ae59b

Please sign in to comment.