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

Inspire Matomo: visits per day DAG #40

Merged
merged 1 commit into from
Aug 16, 2024
Merged

Inspire Matomo: visits per day DAG #40

merged 1 commit into from
Aug 16, 2024

Conversation

ErnestaP
Copy link
Contributor

@ErnestaP ErnestaP commented Aug 8, 2024

No description provided.

parameters = get_parameters(
period=period, date=date, endpoint_key="visits_per_day"
)
token = os.environ.get("MATOMO_AUTH_TOKEN")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's better to use the airflow variables for this kind of things.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

left the comment regarding this below👇

README.md Outdated
@@ -70,6 +70,7 @@ airflow standalone
### 6. Start Postgres with Docker Compose

If you're using Docker to manage your Postgres database, start the service.
IMPORTANT: Please add MATOMO_AUTH_TOKEN value in Docker compose file
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need that in Docker compose file? If we use airlfow we can just have a fixture as we do in https://github.com/inspirehep/backoffice/blob/main/workflows/scripts/variables/variables.json and the we can replace it on the airflow interface

Copy link
Contributor Author

@ErnestaP ErnestaP Aug 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the beginning of the project, we've been using environment variables to maintain consistency. I think that moving to Airflow variables was discussed a long time ago, but it was left as a "to improve later" feature 🤔

I agree that using Airflow variables is a great idea, just it will require a different approach to secrets management on Kubernetes. Airflow variables are stored in the Airflow metadata database, which means we would need to:

  1. Remove secrets from Kubernetes YAML files.
  2. Export them via the UI (Admin > Variables), OR set them directly from the command line, OR use a JSON file as done in the back office.

If we decide to implement this change, we should create a new task to migrate all secrets and variables to be managed through Airflow variables

@ErnestaP ErnestaP force-pushed the inspire-matomo branch 3 times, most recently from 1582d78 to 6d808f2 Compare August 15, 2024 15:20
@ErnestaP ErnestaP merged commit d40ccd8 into main Aug 16, 2024
1 check passed
@drjova drjova deleted the inspire-matomo branch November 5, 2024 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants