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

astro migration #212

Merged
merged 83 commits into from
Mar 17, 2024
Merged
Show file tree
Hide file tree
Changes from 63 commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
695e05c
Modular book product table SQL
Dec 13, 2023
ee768be
Fix bp table creation
Dec 14, 2023
304d3ca
Most exports modularised
Dec 14, 2023
b9547e8
First pass modular SQL
Dec 18, 2023
a0462bf
Unmatched metrics removal
Dec 19, 2023
2edfc31
Fix Jstor country struct sql
Dec 21, 2023
4717b15
Dynamic schema generation for book product
Dec 21, 2023
53958d0
Spring cleaning
Dec 21, 2023
98a8d07
Split up master schema
Dec 21, 2023
5faebb3
SQL templating fixes
Dec 21, 2023
eb2a33d
Modular export tables and renames
keegansmith21 Jan 11, 2024
f04e905
sql rename
Jan 15, 2024
59c0425
schema renames
Jan 15, 2024
7fc4e32
Renaming cleanup
keegansmith21 Jan 15, 2024
d68f1b1
Naming convention update
Jan 16, 2024
0a9439c
Bug fixes
keegansmith21 Jan 16, 2024
148e9cc
Added task grouping. Made formatting consistent
keegansmith21 Jan 16, 2024
4e3c423
Tests fixed
keegansmith21 Jan 17, 2024
e763bf6
removed unused files
keegansmith21 Jan 18, 2024
528b14b
Change export views to table copies
keegansmith21 Jan 18, 2024
f464dbc
Revert project id
Jan 23, 2024
5449d63
fulcrum taskflow
Jan 24, 2024
4ac2726
update
Jan 24, 2024
e1804ce
Updated more telescopes
Feb 1, 2024
05c5c0d
Nae fixes
Feb 5, 2024
773c3f0
Moved files
Feb 6, 2024
d4baa38
add dockerfile and deploy script
Feb 7, 2024
703d45c
move to pyproject.toml
Feb 7, 2024
c8932ba
moved files
Feb 7, 2024
a51cf06
added pyproject.toml
Feb 7, 2024
8694f2c
moved files
Feb 7, 2024
ef22e38
gitignore update
Feb 7, 2024
9d96d4d
add build dir to gitignore
Feb 7, 2024
7c3d381
File moving
keegansmith21 Feb 7, 2024
c16aa70
Astro init
keegansmith21 Feb 7, 2024
79f4826
.egg file removal
Feb 8, 2024
b600b7c
remove flaoting dosctring
Feb 8, 2024
b5948ae
taskflow port for onix wf
Feb 8, 2024
036eb8f
Add default retry on task fail
keegansmith21 Feb 12, 2024
e8dff68
Move all files to dags folder
keegansmith21 Feb 12, 2024
cf7764b
tests part 1
keegansmith21 Feb 13, 2024
4419a85
gb and fulcrum tests working
Feb 13, 2024
bfde958
tests partially done
Feb 14, 2024
48280fb
jstor tests
keegansmith21 Feb 14, 2024
a8bbe4b
Added hardcoded user agent header
Feb 14, 2024
92e5c03
Test updates
Feb 14, 2024
9217fe5
ucl discovery tests
Feb 15, 2024
3120b54
Onix WF test update
Feb 16, 2024
2a86945
Remove ununsed files
Feb 16, 2024
1d055c3
Bigquery operations use correct project id
keegansmith21 Feb 19, 2024
65f0952
Deprecated GA3
keegansmith21 Feb 20, 2024
6c41770
Refactor for obs plat update
keegansmith21 Feb 20, 2024
0a7420c
API reference removal and test updates
keegansmith21 Feb 21, 2024
e1f2af0
Fix for obs-plat refactor
keegansmith21 Feb 22, 2024
a48a984
CLI test update
keegansmith21 Feb 22, 2024
47b4f1d
File cleanup
keegansmith21 Feb 22, 2024
0d122fc
Utility test updates
keegansmith21 Feb 22, 2024
4d62a84
Import cleanup
keegansmith21 Feb 22, 2024
690fdfa
actions deploy test
keegansmith21 Feb 26, 2024
dbd7caa
add .astro dir
keegansmith21 Feb 26, 2024
eac42ec
observatory platfrom branch update
keegansmith21 Feb 26, 2024
f93aaea
On release deploy to astro
keegansmith21 Feb 26, 2024
61c554e
Updated task sensors
keegansmith21 Feb 28, 2024
4ce15eb
Moved and fixed tests
Mar 5, 2024
e107930
Dockerfile and requirements update
keegansmith21 Mar 6, 2024
f17bc4e
Updated imports to exclude dag. prefix
keegansmith21 Mar 6, 2024
20998e9
CI updates
keegansmith21 Mar 12, 2024
1862589
Address comments
keegansmith21 Mar 12, 2024
d6a421d
Dynamic tasks for multiple releases
keegansmith21 Mar 12, 2024
994fdbb
Tests fixes pt 1
keegansmith21 Mar 13, 2024
65d032f
Remove GA3
keegansmith21 Mar 13, 2024
4f6ba11
Test fixes
keegansmith21 Mar 13, 2024
d01df1b
pythonpath update
keegansmith21 Mar 13, 2024
f2ef8b5
pythonpath update
keegansmith21 Mar 13, 2024
36892dc
pythonpath update
keegansmith21 Mar 13, 2024
ed9b32f
pythonpath update
keegansmith21 Mar 13, 2024
0529910
Test client update
keegansmith21 Mar 13, 2024
8301971
Test updates - dataset API fix
keegansmith21 Mar 13, 2024
fe611af
Sensor and schedule updates
keegansmith21 Mar 14, 2024
dad112a
test fixes for schedule update
keegansmith21 Mar 14, 2024
cc41d71
More default run options for all dags
keegansmith21 Mar 14, 2024
26c628b
Revert exception
keegansmith21 Mar 14, 2024
18c8f0e
Update DAG settings
jdddog Mar 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .astro/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
project:
name: oaebu-workflows
21 changes: 21 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Astronomer CI - Deploy code

on:
push:
tags:
- 'v*'
branches:
- main
keegansmith21 marked this conversation as resolved.
Show resolved Hide resolved

env:
## Set API Token as an environment variable
ASTRO_API_TOKEN: ${{ secrets.ASTRO_API_TOKEN }}

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Deploy to Astro
uses: astronomer/deploy-action@v0.4
with:
deployment-id: ${{ secrets.ASTRO_DEPLOYMENT_ID }}
6 changes: 3 additions & 3 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ jobs:
cd ..
keegansmith21 marked this conversation as resolved.
Show resolved Hide resolved
git clone https://github.com/The-Academic-Observatory/observatory-platform.git
cd observatory-platform
pip install -e observatory-api --constraint https://raw.githubusercontent.com/apache/airflow/constraints-2.6.3/constraints-no-providers-${{ matrix.python-version }}.txt
keegansmith21 marked this conversation as resolved.
Show resolved Hide resolved
pip install -e observatory-platform --constraint https://raw.githubusercontent.com/apache/airflow/constraints-2.6.3/constraints-no-providers-${{ matrix.python-version }}.txt
pip install -e observatory-api --constraint https://raw.githubusercontent.com/apache/airflow/constraints-2.7.3/constraints-no-providers-${{ matrix.python-version }}.txt
pip install -e observatory-platform --constraint https://raw.githubusercontent.com/apache/airflow/constraints-2.7.3/constraints-no-providers-${{ matrix.python-version }}.txt
cd ..

cd oaebu-workflows
pip install -e .[tests] --constraint https://raw.githubusercontent.com/apache/airflow/constraints-2.6.3/constraints-no-providers-${{ matrix.python-version }}.txt
pip install -r requirements.txt --constraint https://raw.githubusercontent.com/apache/airflow/constraints-2.7.3/constraints-no-providers-${{ matrix.python-version }}.txt

# Required for testing ONIX Telescope
- name: Set up JDK 11
Expand Down
15 changes: 5 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,26 +1,21 @@
.idea
venv
*.egg-info
dist
.vscode
docs/_build
config.yaml
*.pkrvars.hcl
*.tfvars
*.tfstate
*.tfstate.*
.terraform.tfstate.lock.info
.terraform/**
.coverage
coverage.xml
config_terraform.yaml
*.pyc
AUTHORS
ChangeLog
.eggs/
.DS_Store
/oaebu_workflows/workflows/oapen_cloud_function.zip
docs/schemas
*.Rhistory
.env
__pycache__
/oaebu-workflows/build

# Astronomer
/tests/
airflow_settings.yaml
29 changes: 29 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
FROM quay.io/astronomer/astro-runtime:9.10.0

# The following describes what various dependencies are used for. Some dependencies are specified in packages.txt
# and some are installed in this Dockerfile if not available in apt by default.
#
# KubernetesPodOperator:
# * google-cloud-cli and google-cloud-cli-gke-gcloud-auth-plugin.
# * apt-transport-https, ca-certificates, gnupg, curl, sudo are installed as dependencies the above packages
# OpenAlex: google-cloud-cli
# Crossref Metadata: pigz
# Open Citations: unzip
# ORCID: s5cmd
keegansmith21 marked this conversation as resolved.
Show resolved Hide resolved

# Install custom dependencies for DAGs that are not available via apt by default
USER root

# To connect to GKE with KubernetesPodOperator install google-cloud-cli and google-cloud-cli-gke-gcloud-auth-plugin
RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.asc] https://packages.cloud.google.com/apt cloud-sdk main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
RUN curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | tee /usr/share/keyrings/cloud.google.asc
RUN apt-get update && apt-get install -y google-cloud-cli google-cloud-cli-gke-gcloud-auth-plugin
keegansmith21 marked this conversation as resolved.
Show resolved Hide resolved

# Install git
RUN apt-get install git -y

USER astro

# Install Observatory Platform
RUN git clone --branch feature/astro-refactor https://github.com/The-Academic-Observatory/observatory-platform.git
RUN pip install -e ./observatory-platform/ --constraint https://raw.githubusercontent.com/apache/airflow/constraints-2.7.3/constraints-no-providers-3.10.txt
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions dags/load_dags.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from observatory_platform.airflow.workflow import load_dags_from_config

load_dags_from_config()
File renamed without changes.
10 changes: 8 additions & 2 deletions oaebu_workflows/config.py → dags/oaebu_workflows/config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2020-2023 Curtin University
# Copyright 2020-2024 Curtin University
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -17,7 +17,7 @@
import os
from typing import Optional

from observatory.platform.config import module_file_path
from observatory_platform.config import module_file_path


def test_fixtures_folder(workflow_module: Optional[str] = None) -> str:
Expand Down Expand Up @@ -71,3 +71,9 @@ def construct_module_path(*parts: str) -> str:
raise FileNotFoundError(f"construct_module_path: directory {file_path} does not exist!")

return file_path


def oaebu_user_agent_header() -> dict:
return {
"User-Agent": "oaebu-workflows v1.0.0 (+https://github.com/The-Academic-Observatory/oaebu-workflows; mailto:agent@observatory.academy) "
}
Loading
Loading