Skip to content

Commit

Permalink
wpi
Browse files Browse the repository at this point in the history
  • Loading branch information
norlandrhagen committed Sep 11, 2024
1 parent 1892716 commit 5c95d51
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 36 deletions.
26 changes: 10 additions & 16 deletions .github/workflows/deploy_recipe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,35 +16,29 @@ jobs:
runs-on: ubuntu-latest
steps:


- name: Checkout Repo
- uses: actions/checkout@v4

- name: Setup python
- uses: actions/setup-python@v5
with:
python-version: '3.12'

- name: "Authenticate to Google Cloud"
id: "auth"
uses: "google-github-actions/auth@v2"
with:
credentials_json: "${{ secrets.LEAP_BAKERY_SERVICE_ACCOUNT }}"

- uses: actions/setup-python@v5
with:
python-version: '3.12'

- name: "Install deps"
run: |
python -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install apache-beam[gcp] xarray_beam xarray kerchunk fastparquet pyarrow gcsfs google-cloud
python -m pip install -e .
echo "$VIRTUAL_ENV/bin" >> $GITHUB_PATH
echo "VIRTUAL_ENV=$VIRTUAL_ENV" >> $GITHUB_ENV
python -m pip install -e .[test]
python -m pip install apache-beam[gcp]
# - name: Get service account for beam
# id: get-account
# run: |
# echo "SA_EMAIL=$(gcloud config get-value account)" >> $GITHUB_OUTPUT
# echo $SA_EMAIL
# echo $GITHUB_OUTPUT

- name : "Deploy Beam pipeline"
run: |
Expand Down
22 changes: 22 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
[build-system]
requires = ["setuptools>=45", "setuptools_scm[toml]>=6.2"]

[project]
name = "xbeam-virtualizarr"

dynamic = ["version"]

requires-python = ">=3.9"

dependencies = [
'apache-beam[gcp]',
'xarray_beam',
'xarray',
'kerchunk',
'fastparquet',
'pyarrow',
'gcsfs',
'google-cloud']



[tool.ruff]
# Exclude a variety of commonly ignored directories.
exclude = [
Expand Down
17 changes: 0 additions & 17 deletions setup.py

This file was deleted.

5 changes: 2 additions & 3 deletions xbeam_virtualizarr/recipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,9 @@ def run(argv=None, save_main_session=True):

combined_ds = xr.open_dataset(reference_path, engine="kerchunk", chunks={})
# subset the reference zarr
source_dataset = combined_ds.isel(day=slice(0, 1000))[
source_dataset = combined_ds.isel(day=slice(0, 32))[
["air_temperature"]
] # ~ 6.5 gb

] # ~ 3.2 gb
source_chunks = dict(source_dataset.sizes)
target_chunks = {"day": 16, "lat": 585, "lon": 1386} # ~ full map 100MB chunks
template = xbeam.make_template(source_dataset)
Expand Down

0 comments on commit 5c95d51

Please sign in to comment.