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

feat: landsat example #50

Merged
merged 1 commit into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions example/landsat/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Landsat Example

Here is an example specifying to use an s3 bucket

```bash
snakemake --jobs 1 --executor googlebatch --googlebatch-region us-central1 --googlebatch-project llnl-flux --default-storage-provider gcs --default-storage-prefix gcs://change-me --storage-gcs-project llnl-flux
```
45 changes: 45 additions & 0 deletions example/landsat/Snakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import os

storage:
provider="gcs",
max_requests_per_second= None

rule all:
input:
"landsat-data.txt.bz2",
"testdir"

rule copy:
input:
storage.gcs("gcs://gcp-public-data-landsat/LC08/01/001/003/LC08_L1GT_001003_20170430_20170501_01_RT/LC08_L1GT_001003_20170430_20170501_01_RT_MTL.txt"),
output:
"landsat-data.txt"
resources:
mem_mb=100
run:
# we could test volume size like this but it is currently unclear what f1-micro instances provide as boot disk size
#stats = os.statvfs('.')
#volume_gib = stats.f_bsize * stats.f_blocks / 1.074e9
#assert volume_gib > 90
shell("cp {input} {output}")

rule pack:
input:
"landsat-data.txt"
output:
"landsat-data.txt.bz2"
conda:
"env.yml"
log:
"logs/pack.log"
shell:
"bzip2 -c {input} > {output}; echo successful > {log}"


rule directory:
output:
directory("testdir")
log:
"logs/directory.log"
shell:
"mkdir -p {output}; touch {output}/test.txt"
1 change: 1 addition & 0 deletions example/landsat/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"message": "hahaha"}
4 changes: 4 additions & 0 deletions example/landsat/env.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
channels:
- conda-forge
dependencies:
- bzip2