diff --git a/.github/dependabot.yml b/.github/dependabot.yml
new file mode 100644
index 0000000..6867e71
--- /dev/null
+++ b/.github/dependabot.yml
@@ -0,0 +1,11 @@
+# To get started with Dependabot version updates, you'll need to specify which
+# package ecosystems to update and where the package manifests are located.
+# Please see the documentation for all configuration options:
+# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
+
+version: 2
+updates:
+ - package-ecosystem: "github-actions"
+ directory: "/"
+ schedule:
+ interval: "weekly"
diff --git a/.github/workflows/deploy_recipe.yaml b/.github/workflows/deploy_recipe.yaml
new file mode 100644
index 0000000..02c92b8
--- /dev/null
+++ b/.github/workflows/deploy_recipe.yaml
@@ -0,0 +1,54 @@
+name: Deploy Recipes to Google Dataflow
+
+env:
+ JOB_NAME: ${{ github.event.inputs.recipe_id }}-${{ github.run_id }}-${{ github.run_attempt }}
+ # Can we sanitize the job name here to remove special characters?
+
+on:
+ workflow_dispatch:
+ inputs:
+ recipe_id:
+ description: 'The id of a single recipe to submit to Dataflow'
+ required: true
+ default: 'all'
+
+jobs:
+ deploy-recipes:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ - name: "Authenticate to Google Cloud"
+ id: "auth"
+ uses: "google-github-actions/auth@v2"
+ with:
+ credentials_json: "${{ secrets.LEAP_BAKERY_SERVICE_ACCOUNT }}"
+ - name: "Install dependencies"
+ run: |
+ python -m pip install --upgrade pip
+ pip install pangeo-forge-runner
+ - name: "Deploy recipes"
+ run: |
+ pangeo-forge-runner bake \
+ --repo=${{ github.server_url }}/${{ github.repository }}.git \
+ --ref=${{ github.sha }} \
+ --feedstock-subdir='feedstock' \
+ --Bake.job_name=${{ env.JOB_NAME }} \
+ --Bake.recipe_id=${{ github.event.inputs.recipe_id }} \
+ -f configs/config_dataflow.py
+ env:
+ GOOGLE_APPLICATION_CREDENTIALS: "${{ steps.auth.outputs.credentials_file_path }}"
+ - name: Wait for Dataflow jobs to finish
+ # I tried to make this reusable but the fucking thing would not accept env.JOB_NAME as input.
+ # AT that point, screw it, not worth it.
+ run: |
+ jobname="${{ env.JOB_NAME }}"
+ while true; do
+ count=$(gcloud dataflow jobs list --status=active --filter="name:${jobname}" --format="value(id)" | wc -l)
+ echo "Active Dataflow jobs: $count"
+ if [ "$count" -eq "0" ]; then
+ echo "No active Dataflow jobs found."
+ break
+ fi
+ echo "Waiting for Dataflow jobs to finish..."
+ sleep 20
+ done
diff --git a/.github/workflows/validate-catalog.yaml b/.github/workflows/validate-catalog.yaml
new file mode 100644
index 0000000..0a79e9e
--- /dev/null
+++ b/.github/workflows/validate-catalog.yaml
@@ -0,0 +1,27 @@
+name: Catalog
+
+on:
+ pull_request:
+ branches:
+ push:
+ branches:
+
+concurrency:
+ group: ${{ github.workflow }}-${{ github.ref }}
+ cancel-in-progress: true
+
+jobs:
+ validate:
+ runs-on: ubuntu-latest
+ defaults:
+ run:
+ shell: bash -l {0}
+ steps:
+ - uses: actions/checkout@v4
+ - uses: actions/setup-python@v5
+ with:
+ python-version: '3.10'
+ - name: validate feedstock entry
+ uses: leap-stc/data-catalog-actions/leap-catalog@main
+ with:
+ single-feedstock: "./feedstock/catalog.yaml"
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..0f6eb81
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,163 @@
+# Byte-compiled / optimized / DLL files
+__pycache__/
+*.py[cod]
+*$py.class
+
+# C extensions
+*.so
+
+# Distribution / packaging
+.Python
+build/
+develop-eggs/
+dist/
+downloads/
+eggs/
+.eggs/
+lib/
+lib64/
+parts/
+sdist/
+var/
+wheels/
+share/python-wheels/
+*.egg-info/
+.installed.cfg
+*.egg
+MANIFEST
+
+# PyInstaller
+# Usually these files are written by a python script from a template
+# before PyInstaller builds the exe, so as to inject date/other infos into it.
+*.manifest
+*.spec
+
+# Installer logs
+pip-log.txt
+pip-delete-this-directory.txt
+
+# Unit test / coverage reports
+htmlcov/
+.tox/
+.nox/
+.coverage
+.coverage.*
+.cache
+nosetests.xml
+coverage.xml
+*.cover
+*.py,cover
+.hypothesis/
+.pytest_cache/
+cover/
+
+# Translations
+*.mo
+*.pot
+
+# Django stuff:
+*.log
+local_settings.py
+db.sqlite3
+db.sqlite3-journal
+
+# Flask stuff:
+instance/
+.webassets-cache
+
+# Scrapy stuff:
+.scrapy
+
+# Sphinx documentation
+docs/_build/
+
+# PyBuilder
+.pybuilder/
+target/
+
+# Jupyter Notebook
+.ipynb_checkpoints
+
+# IPython
+profile_default/
+ipython_config.py
+
+# pyenv
+# For a library or package, you might want to ignore these files since the code is
+# intended to run in multiple environments; otherwise, check them in:
+# .python-version
+
+# pipenv
+# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
+# However, in case of collaboration, if having platform-specific dependencies or dependencies
+# having no cross-platform support, pipenv may install dependencies that don't work, or not
+# install all needed dependencies.
+#Pipfile.lock
+
+# poetry
+# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
+# This is especially recommended for binary packages to ensure reproducibility, and is more
+# commonly ignored for libraries.
+# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
+#poetry.lock
+
+# pdm
+# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
+#pdm.lock
+# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
+# in version control.
+# https://pdm.fming.dev/#use-with-ide
+.pdm.toml
+
+# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
+__pypackages__/
+
+# Celery stuff
+celerybeat-schedule
+celerybeat.pid
+
+# SageMath parsed files
+*.sage.py
+
+# Environments
+.env
+.venv
+env/
+venv/
+ENV/
+env.bak/
+venv.bak/
+
+# Spyder project settings
+.spyderproject
+.spyproject
+
+# Rope project settings
+.ropeproject
+
+# mkdocs documentation
+/site
+
+# mypy
+.mypy_cache/
+.dmypy.json
+dmypy.json
+
+# Pyre type checker
+.pyre/
+
+# pytype static type analyzer
+.pytype/
+
+# Cython debug symbols
+cython_debug/
+
+# PyCharm
+# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
+# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
+# and can be added to the global gitignore or merged into this file. For a more nuclear
+# option (not recommended) you can uncomment the following to ignore the entire idea folder.
+#.idea/
+
+
+proto_feedstock/
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
new file mode 100644
index 0000000..dcbafe5
--- /dev/null
+++ b/.pre-commit-config.yaml
@@ -0,0 +1,22 @@
+ci:
+ autoupdate_schedule: quarterly
+ autofix_prs: true
+
+repos:
+ - repo: https://github.com/pre-commit/pre-commit-hooks
+ rev: v4.5.0
+ hooks:
+ - id: check-added-large-files
+ - id: check-toml
+ - id: trailing-whitespace
+ - id: end-of-file-fixer
+ - id: check-yaml
+ - id: debug-statements
+ - repo: https://github.com/astral-sh/ruff-pre-commit
+ rev: v0.3.5
+ hooks:
+ # Run the linter.
+ - id: ruff
+ args: [ --fix ]
+ # Run the formatter.
+ - id: ruff-format
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..261eeb9
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,201 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..ee03f09
--- /dev/null
+++ b/README.md
@@ -0,0 +1,89 @@
+# LEAP Template Feedstock
+This repository serves as template/documentation/testing ground for Leap-Pangeo Data Library Feedstocks.
+
+## Setup
+### Use this template
+- Click on the button on the top left to use this repository as a template for your new feedstock
+
+
+>[!IMPORTANT]
+> - Make the repo public
+> - Make sure to create the repo under the `leap-stc` github organization, not your personal account!
+> - Name your feedstock according to your data `_feedstock`.
+>
+> If you made a mistake here it is not a huge problem. All these settings can be changed after you created the repo.
+
+- Now you can locally check out the repository.
+
+> [!NOTE]
+> The instructions below are specific for testing recipes locally but downloading and producing data on GCS cloud buckets. If you are running the recipes locally you have to minimally modify some of the steps as noted below.
+
+### Build and test your recipe locally on the LEAP-Pangeo Jupyterhub
+
+- Edit the `feedstock/recipe.py` to build your pangeo-forge recipe. If you are new to pangeo-forge, [the docs](https://pangeo-forge.readthedocs.io/en/latest/composition/index.html#overview) are a great starting point
+- Make sure to also edit the other files in the `/feedstock/` directory. More info on feedstock structure can be found [here](https://pangeo-forge.readthedocs.io/en/latest/deployment/feedstocks.html#meta-yaml)
+- 🚨 You should not have to modify any of the files outside the `feedstock` folder (and this README)! If you run into a situation where you think changes are needed, please open an issue and tag @leap-stc/data-and-compute.
+
+### Test your recipe locally
+Before we run your recipe on LEAPs Dataflow runner you should test your recipe locally.
+
+You can do that on the LEAP-Pangeo Jupyterhub or your own computer.
+
+1. Set up an environment with mamba or conda:
+```shell
+mamba create -n runner0102 python=3.11 -y
+conda activate runner0102
+pip install pangeo-forge-runner==0.10.2 --no-cache-dir
+```
+
+2. You can now use [pangeo-forge-runner](https://github.com/pangeo-forge/pangeo-forge-runner) from the root directory of a checked out version of this repository in the shell
+
+```shell
+pangeo-forge-runner bake \
+ --repo=./ \
+ --Bake.recipe_id=\
+ -f configs/config_local_hub.py
+```
+>[!NOTE]
+> Make sure to replace the `'recipe_id'` with the one defined in your `feedstock/meta.yaml` file.
+>
+>If you created multiple recipes you have to run a call like above for each one.
+
+> To run this fully local (e.g. on your laptop) you have to replace `config_local_hub.py` with `config_local.py`.
+>
+> ⚠️ This will save the cache and output to a subfolder of the location you are executing this from.. Make sure do delete them once you are done with testing.
+
+3. Check the output! If something looks off edit your recipe.
+
+>[!TIP]
+>The above command will by default 'prune' the recipe, meaning it will only use two of the input files you provided to avoid creating too large output.
+>Keep that in mind when you check the output for correctness.
+
+Once you are happy with the output it is time to commit your work to git, push to github and get this recipe set up for ingestion using [Google Dataflow](https://cloud.google.com/dataflow?hl=en)
+
+### Activate the linting CI and clean up your repo
+[Pre-Commit](https://pre-commit.com) linting is already pre-configured in this repository. To run the checks locally simply do:
+```shell
+pip install pre-commit
+pre-commit install
+pre-commit run --all-files
+```
+Then create a new branch and add those fixes (and others that were not able to auto-fix). From now on pre-commit will run checks after every commit.
+
+Alternatively (or additionally) you can use the [pre-commit CI Github App](https://results.pre-commit.ci/) to run these checks as part of every PR.
+To proceed with this step you will need assistance a memeber of the [LEAP Data and Computation Team](https://leap-stc.github.io/support.html#data-and-computation-team). Please open an issue on this repository and tag `@leap-stc/data-and-compute` and ask for this repository to be added to the pre-commit.ci app.
+
+### Deploy your recipe to LEAPs Google Dataflow
+
+>[!WARNING]
+>To proceed with this step you will need to have certain repository secrets set up. For security reasons this should be done by a memeber of the [LEAP Data and Computation Team](https://leap-stc.github.io/support.html#data-and-computation-team). Please open an issue on this repository and tag `@leap-stc/data-and-compute` to get assistance.
+
+- To deploy a recipe to Google Dataflow you have to trigger the "Deploy Recipes to Google Dataflow" with a single `recipe_id` as input.
+
+- Once your recipe is run from a github workflow we assume that it is deployed to Google Dataflow and activate the final [copy stage](https://github.com/leap-stc/LEAP_template_feedstock/blob/55ee23ce0bc90f764d18bc34c58adccb5b38fc89/feedstock/recipe.py#L63). This happens automatically, but you have to make sure to edit the `'feedstock/catalog.yaml'` `url` entries for each `recipe_id`. This location will be the 'final' location of the data, and this is what gets passed to the the catalog in the next step!
+
+>[!NOTE]
+>By default the `'prune'` option is set to true. To build the final dataset you need to change that value [here](https://github.com/leap-stc/LEAP_template_feedstock/blob/55ee23ce0bc90f764d18bc34c58adccb5b38fc89/configs/config_dataflow.py#L7). **Particularly for large datasets make sure that you have finalized the entries in `'feedstock/catalog.yaml'`**, since the full build of the dataset can be slow and expensive - you want to avoid doing that again 😁
+
+### Add your dataset to the LEAP-Pangeo Catalog
+Now that your awesome dataset is available as an ARCO zarr store, you should make sure that everyone else at LEAP can check this dataset out easily.
diff --git a/configs/config_dataflow.py b/configs/config_dataflow.py
new file mode 100644
index 0000000..8817f77
--- /dev/null
+++ b/configs/config_dataflow.py
@@ -0,0 +1,20 @@
+# This assumes that runner is called from a github action
+# where these environment variables are set.
+import os
+repo_path = os.environ['GITHUB_REPOSITORY']
+FEEDSTOCK_NAME = repo_path.split('/')[-1]
+
+c.Bake.prune = 1
+c.Bake.bakery_class = "pangeo_forge_runner.bakery.dataflow.DataflowBakery"
+c.DataflowBakery.use_dataflow_prime = True
+c.DataflowBakery.max_workers = 50
+c.DataflowBakery.use_public_ips = True
+c.DataflowBakery.service_account_email = (
+ "leap-community-bakery@leap-pangeo.iam.gserviceaccount.com"
+)
+c.DataflowBakery.project_id = "leap-pangeo"
+c.DataflowBakery.temp_gcs_location = f"gs://leap-scratch/data-library/feedstocks/temp/{FEEDSTOCK_NAME}"
+c.TargetStorage.fsspec_class = "gcsfs.GCSFileSystem"
+c.InputCacheStorage.fsspec_class = "gcsfs.GCSFileSystem"
+c.TargetStorage.root_path = f"gs://leap-scratch/data-library/feedstocks/output/{FEEDSTOCK_NAME}/{{job_name}}"
+c.InputCacheStorage.root_path = f"gs://leap-scratch/data-library/feedstocks/cache"
diff --git a/configs/config_local.py b/configs/config_local.py
new file mode 100644
index 0000000..bdbd752
--- /dev/null
+++ b/configs/config_local.py
@@ -0,0 +1,7 @@
+c.Bake.prune = 1
+c.Bake.bakery_class = 'pangeo_forge_runner.bakery.local.LocalDirectBakery'
+BUCKET_PREFIX = "./pangeo-forge-runner-output"
+c.TargetStorage.fsspec_class = "fsspec.implementations.local.LocalFileSystem"
+c.InputCacheStorage.fsspec_class = "fsspec.implementations.local.LocalFileSystem"
+c.TargetStorage.root_path = f"{BUCKET_PREFIX}/output/{{job_name}}"
+c.InputCacheStorage.root_path = f"{BUCKET_PREFIX}/cache/"
diff --git a/configs/config_local_hub.py b/configs/config_local_hub.py
new file mode 100644
index 0000000..122c211
--- /dev/null
+++ b/configs/config_local_hub.py
@@ -0,0 +1,23 @@
+# This logic only works locally on the LEAP-Pangeo hub (or similar Jupyterhubs)
+import os
+import subprocess
+user = os.environ['JUPYTERHUB_USER']
+
+#TODO: factor this out into an importable function and import here and in config_local.py
+try:
+ # Run the git command to get the top-level directory path
+ repo_path = subprocess.check_output(['git', 'rev-parse', '--show-toplevel'], text=True).strip()
+ # Use os.path.basename to get the repository name from the path
+ repo_name = os.path.basename(repo_path)
+except subprocess.CalledProcessError as e:
+ raise
+
+BUCKET_PREFIX = f"gs://leap-scratch/{user}/{repo_name}"
+print(f"{BUCKET_PREFIX=}")
+
+c.Bake.prune = 1
+c.Bake.bakery_class = "pangeo_forge_runner.bakery.local.LocalDirectBakery"
+c.TargetStorage.fsspec_class = "gcsfs.GCSFileSystem"
+c.InputCacheStorage.fsspec_class = "gcsfs.GCSFileSystem"
+c.TargetStorage.root_path = f"{BUCKET_PREFIX}/output/{{job_name}}"
+c.InputCacheStorage.root_path = f"{BUCKET_PREFIX}/cache/"
diff --git a/feedstock/catalog.yaml b/feedstock/catalog.yaml
new file mode 100644
index 0000000..8a7d348
--- /dev/null
+++ b/feedstock/catalog.yaml
@@ -0,0 +1,16 @@
+# All the information important to cataloging.
+"ncviewjs:meta_yaml_url": "https://github.com/leap-stc/proto_feedstock/blob/main/feedstock/meta.yaml"
+tags:
+ - my-custom-tag
+ - zarr
+stores:
+ - id: "small"
+ name: "The cool small Proto Dataset"
+ url: "gs://leap-scratch/data-library/feedstocks/proto_feedstock/small.zarr"
+ "ncviewjs:rechunking":
+ - path: "gs://some-bucket/small.zarr"
+ use_case: "multiscales"
+
+ - id: "large"
+ name: "The even cooler large Proto Dataset" # no pyramids
+ url: "gs://leap-scratch/data-library/feedstocks/proto_feedstock/large.zarr"
diff --git a/feedstock/meta.yaml b/feedstock/meta.yaml
new file mode 100644
index 0000000..7ad7da5
--- /dev/null
+++ b/feedstock/meta.yaml
@@ -0,0 +1,20 @@
+title: "LEAP Data Library Prototype"
+description: >
+ A prototype test for the LEAP Data Library refactor
+recipes:
+ - id: "small"
+ object: "recipe:small"
+ - id: "large"
+ object: "recipe:large"
+provenance:
+ providers:
+ - name: "Julius"
+ description: "Just a guy testing some recipes. Nothing to see here."
+ roles:
+ - producer
+ - licensor
+ license: "Just a Test"
+maintainers:
+ - name: "Julius Busecke"
+ orcid: "0000-0001-8571-865X"
+ github: jbusecke
diff --git a/feedstock/recipe.py b/feedstock/recipe.py
new file mode 100644
index 0000000..5937212
--- /dev/null
+++ b/feedstock/recipe.py
@@ -0,0 +1,79 @@
+"""
+A synthetic prototype recipe
+"""
+
+import os
+import apache_beam as beam
+from leap_data_management_utils.data_management_transforms import (
+ Copy,
+ InjectAttrs,
+ get_catalog_store_urls,
+)
+from pangeo_forge_recipes.patterns import pattern_from_file_sequence
+from pangeo_forge_recipes.transforms import (
+ OpenURLWithFSSpec,
+ OpenWithXarray,
+ StoreToZarr,
+ ConsolidateMetadata,
+ ConsolidateDimensionCoordinates,
+)
+
+# parse the catalog store locations (this is where the data is copied to after successful write (and maybe testing)
+catalog_store_urls = get_catalog_store_urls("feedstock/catalog.yaml")
+
+# if not run in a github workflow, assume local testing and deactivate the copy stage by setting all urls to False (see https://github.com/leap-stc/leap-data-management-utils/blob/b5762a17cbfc9b5036e1cd78d62c4e6a50c9691a/leap_data_management_utils/data_management_transforms.py#L121-L145)
+if os.getenv("GITHUB_ACTIONS") == "true":
+ print("Running inside GitHub Actions.")
+else:
+ print("Running locally. Deactivating final copy stage.")
+ catalog_store_urls = {k: False for k in catalog_store_urls.keys()}
+
+print("Final output locations")
+print(f"{catalog_store_urls=}")
+
+## Monthly version
+input_urls_a = [
+ "gs://cmip6/pgf-debugging/hanging_bug/file_a.nc",
+ "gs://cmip6/pgf-debugging/hanging_bug/file_b.nc",
+]
+input_urls_b = [
+ "gs://cmip6/pgf-debugging/hanging_bug/file_a_huge.nc",
+ "gs://cmip6/pgf-debugging/hanging_bug/file_b_huge.nc",
+]
+
+pattern_a = pattern_from_file_sequence(input_urls_a, concat_dim="time")
+pattern_b = pattern_from_file_sequence(input_urls_b, concat_dim="time")
+
+
+# small recipe
+small = (
+ beam.Create(pattern_a.items())
+ | OpenURLWithFSSpec()
+ | OpenWithXarray()
+ | StoreToZarr(
+ store_name="small.zarr",
+ # FIXME: This is brittle. it needs to be named exactly like in meta.yaml...
+ # Can we inject this in the same way as the root?
+ # Maybe its better to find another way and avoid injections entirely...
+ combine_dims=pattern_a.combine_dim_keys,
+ )
+ | InjectAttrs()
+ | ConsolidateDimensionCoordinates()
+ | ConsolidateMetadata()
+ | Copy(target=catalog_store_urls["small"])
+)
+
+# larger recipe
+large = (
+ beam.Create(pattern_b.items())
+ | OpenURLWithFSSpec()
+ | OpenWithXarray()
+ | StoreToZarr(
+ store_name="large.zarr",
+ combine_dims=pattern_b.combine_dim_keys,
+ )
+ | InjectAttrs()
+ | ConsolidateDimensionCoordinates()
+ | ConsolidateMetadata()
+ | Copy(target=catalog_store_urls["large"])
+)
diff --git a/feedstock/requirements.txt b/feedstock/requirements.txt
new file mode 100644
index 0000000..0232dbe
--- /dev/null
+++ b/feedstock/requirements.txt
@@ -0,0 +1,4 @@
+pangeo-forge-recipes==0.10.7
+apache-beam[gcp]
+gcsfs
+leap-data-management-utils==0.0.12
diff --git a/pyproject.toml b/pyproject.toml
new file mode 100644
index 0000000..0e11040
--- /dev/null
+++ b/pyproject.toml
@@ -0,0 +1,5 @@
+[tool.ruff]
+# Exclude a variety of commonly ignored directories.
+exclude = [
+ 'configs' # to avoid raising "F821 Undefined name `c`" in each of the configs
+]