-
Notifications
You must be signed in to change notification settings - Fork 0
105 lines (91 loc) · 3.28 KB
/
run_climate_obs.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# This job is not currently working, it runs successfully up to the point where it
# tries to run the actual script. Also the installation of office has not been
# confirmed to work. Leaving it in the repo in case we circle back to take a closer
# look at the idea of running xl macros as gha. Currently thinking this isn't a great
# pattern
#
name: Runs the climate observations XL
on:
# debugging while working on this action
push:
branches:
- "feat-15-xl-ingestion"
# cron schedules are in UTC
# this job should run at 7.15 am pst, which translates to 2.15 pm. UTC which
# is the timezone that gha uses.
# schedule:
# - cron: '15 14 * * *'
workflow_dispatch:
repository_dispatch:
types: prep-xl
jobs:
prep-xl:
defaults:
run:
shell: bash
name: 'Download and Process Automated Snow Pillow Data'
runs-on: windows-latest
environment: PROD
env:
OBJ_STORE_BUCKET: ${{ secrets.OBJ_STORE_BUCKET }}
OBJ_STORE_SECRET: ${{ secrets.OBJ_STORE_SECRET }}
OBJ_STORE_USER: ${{ secrets.OBJ_STORE_USER }}
OBJ_STORE_HOST: ${{ vars.OBJ_STORE_HOST }}
ASP_ENV_DATA_DIR: ./data/asp_env
ASP_PREPD_DATA_DIR: ./data/asp_prepd
ASP_OSTORE_RAW_DATA_DIR: ASP/raw
ASP_OSTORE_PREPD_DATA_DIR: ASP/prepd
steps:
- uses: actions/checkout@v3
id: checkout
with:
fetch-depth: 0
- name: Install Rclone
id: install_rclone
run: choco install rclone
- name: pull ostore data
id: pull_ostore_data
shell: cmd
run: |
:: calculate the path for where the input ss will be located
mkdir data
set current_dir=%cd%
set MODEL_DIR=%current_dir%\data
:: setup the rclone config file
echo off
echo [nrsobjstore] > rclone.config
echo type = s3 >> rclone.config
echo provider = Minio >> rclone.config
echo env_auth = false >> rclone.config
echo access_key_id = %OBJ_STORE_USER% >> rclone.config
echo secret_access_key = %OBJ_STORE_SECRET% >> rclone.config
echo region = us-east-1 >> rclone.config
echo endpoint = https://nrs.objectstore.gov.bc.ca:443 >> rclone.config
echo on
:: get the current year for the folder name
set RCLONE_CONFIG=%current_dir%\rclone.config
set current_year=%Date:~0,4%
echo current year is %current_year%
:: pull the rclone data from ostore
rclone.exe copy ^
nrsobjstore:rfcdata\\models\\data\\climate_obs ^
%current_dir%\data ^
# - name: Install Office
# run: choco install office365business --version=16731.20354 --params "'/exclude:Access Groove Lync OneDrive OneNote Outlook Publisher /updates:FALSE /eula:TRUE'"
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- id: install_dependencies
name: install python dependencies
shell: bash
run: |
pip install --upgrade pip
pip install -r scripts/python/requirements.txt
pip install -r scripts/python/requirements-win32-xl.txt
- id: run_asp_data_pipe
name: download and process asp data
shell: bash
env:
DATESTR: ${{ github.event.client_payload.idem_key }}
run: |
python scripts/python/main_win32_climateobs_prep.py