Download the scripts into an empty directory and run
# Sets up a ./data file with input and output directories.
sh ./setup_data.sh
# Runs container workflow from end to end.
docker compose up
""" | |
Fills in implied directory blobs for GCS bucket mounted with GCSfuse without using the --implied-dir option. | |
If you tell it to look in `mygcsbucket` for prefix `path/to/files/to/read/in/gcsfuse/`. It will | |
ensure implied dirs nested in gs://mygcsbucket/path/to/files/to/read/in/gcsfuse/ get covered. | |
It can handle 10 - 100k directories in under 30 minutes if you run it from Cloud Shell. | |
""" | |
import logging | |
from pathlib import Path |
#!/usr/bin/env bash | |
# Parse GCP logging to print sample JSON list of container images used in the | |
# past 60 days in a GKE singleuser-server Jupyterhub deployment. | |
# Be sure to set PROJECT_ID and have jq installed. | |
set -e | |
PROJECT_ID="gcpprojectid" |
""" | |
Trigger a Zenodo DOI for past Github Releases on a public repo. | |
Modified from @medley56 https://github.com/zenodo/zenodo/issues/1463#issuecomment-1468932469 on 2023-08-16. | |
""" | |
import requests | |
# Fill these in... |
def lon360to180(lon): | |
return (lon + 180.0) % 360.0 - 180.0 | |
# The inverse going from -180 - 180 to 0 - 360 is | |
def lon180to360(lon): | |
return lon % 360.0 |
# Example CF-convention attrs/metadata | |
{'Conventions': 'CF-1.7 CMIP-6.2', | |
'activity_id': 'CMIP', | |
'branch_method': 'standard', | |
'branch_time_in_child': 0.0, | |
'branch_time_in_parent': 0.0, | |
'cmor_version': '3.4.0', | |
'creation_date': '2019-11-09T02:07:38Z', | |
'data_specs_version': '01.00.30', | |
'experiment': 'all-forcing simulation of the recent past', |
grep '"size":' ${CONDA_PREFIX}/conda-meta/*.json | sort -k3rn | sed 's/.*conda-meta\///g' | column -t |
apiVersion: argoproj.io/v1alpha1 | |
kind: Workflow | |
metadata: | |
generateName: papermill-test- | |
spec: | |
entrypoint: main | |
templates: | |
- name: main | |
inputs: |
import xarray as xr | |
tmin_url = "~/Downloads/tmin-20220208/annual.zarr" | |
tmax_url = "~/Downloads/tmax-20220208/annual.zarr" | |
tmean_url = "~/Downloads/tmean-20220208/annual.zarr" | |
out_url = "gs://fakebucketname/prism-ca-20220208.zarr" | |
tmin = xr.open_zarr(tmin_url).drop("crs") | |
tmax = xr.open_zarr(tmax_url).drop("crs") |
apiVersion: argoproj.io/v1alpha1 | |
kind: Workflow | |
metadata: | |
generateName: dask-internal-process-demo- | |
spec: | |
entrypoint: dask | |
activeDeadlineSeconds: 1800 # Safety first, kids! | |
templates: | |
- name: dask | |
script: |