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

Data Hub: K8s: Reduce config duplication using yaml anchors #3065

Closed
wants to merge 1 commit into from

Conversation

de-code
Copy link
Contributor

@de-code de-code commented Oct 15, 2024

part of https://github.com/elifesciences/data-hub-issues/issues/1003

Reduce duplication in the config using yaml anchors.

@de-code de-code self-assigned this Oct 15, 2024
@de-code de-code requested a review from HazalCiplak October 15, 2024 15:05
Copy link
Contributor Author

@de-code de-code left a comment

Choose a reason for hiding this comment

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

This can be tested using the CLI in the Core DAGs PR:

python -m data_pipeline.kubernetes.cli.dump_config \
    --config-file=/path/to/elife-flux-cluster/kustomizations/apps/data-hub-configs/kubernetes-pipeline--stg.config.yaml \
    --deployment-env=staging \
    --data-pipeline-id=Web_API_elife_observer_api_publication_dates_Kubernetes
airflow:
  dagParameters:
    max_active_runs: 1
    schedule: 25 2 * * *
    tags:
    - Kubernetes
    - Web API
arguments:
- python
- -m
- data_pipeline.generic_web_api.cli
- --data-pipeline-id=elife_observer_api_publication_dates
dataPipelineId: Web_API_elife_observer_api_publication_dates_Kubernetes
env:
- name: DEPLOYMENT_ENV
  value: staging
- name: GOOGLE_APPLICATION_CREDENTIALS
  value: /dag_secret_files/gcloud/credentials.json
- name: AWS_CONFIG_FILE
  value: /dag_secret_files/aws/credentials
- name: WEB_API_CONFIG_FILE_PATH
  value: /dag_config_files/web-api-data-pipeline.config.yaml
image: docker.io/elifesciences/data-hub-core-dags_unstable:latest
imagePullPolicy: Always
resources:
  limits:
    cpu: 1000m
    memory: 600Mi
  requests:
    cpu: 100m
    memory: 500Mi
volumeMounts:
- mountPath: /dag_secret_files/gcloud/
  name: gcloud-secret-volume
  readOnly: true
- mountPath: /dag_secret_files/aws
  name: aws-secret-volume
  readOnly: true
- mountPath: /dag_config_files/
  name: data-hub-config-volume
  readOnly: true
volumes:
- name: aws-secret-volume
  secret:
    secretName: credentials
- name: gcloud-secret-volume
  secret:
    secretName: gcloud
- configMap:
    name: data-hub-configs
  name: data-hub-config-volume

Copy link
Contributor Author

@de-code de-code left a comment

Choose a reason for hiding this comment

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

One thing I didn't realise is that merge keys were removed in YAML 1.2, but are still supported by many libraries.

@de-code de-code requested a review from scottaubrey October 16, 2024 07:48
@de-code
Copy link
Contributor Author

de-code commented Oct 17, 2024

Closing this, as we seem to be in favour in implementing default config at the application level rather than using yaml anchors

@de-code de-code closed this Oct 17, 2024
@scottaubrey scottaubrey deleted the data-hub-k8s-reduce-config-duplication branch November 6, 2024 10:37
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.

1 participant