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

Refactor/schemaless consumer use path #265

Merged
merged 87 commits into from
Nov 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
1e19299
added schema path to kafka producer and producer tests
AlxEnashi Nov 3, 2023
5b937bf
Merge branch 'main' of github.com:alercebroker/pipeline into refactor…
AlxEnashi Nov 6, 2023
a4bf2a0
testing: fix testing producer schema
AlxEnashi Nov 6, 2023
3088839
chore: run black
AlxEnashi Nov 6, 2023
5374c9a
refactor: now apf kafka metrics use the file path for schema
AlxEnashi Nov 6, 2023
c55df6f
Merge branch 'refactor/moving_schemas' of github.com:alercebroker/pip…
AlxEnashi Nov 6, 2023
7bb58a6
refactor: correction steps pasing with new apf
AlxEnashi Nov 6, 2023
eff9ff9
Merge branch 'main' of github.com:alercebroker/pipeline into refactor…
AlxEnashi Nov 10, 2023
e93f0da
Added test for features, lc_classifications and early_classification
AlxEnashi Nov 10, 2023
17f9740
Merge branch 'main' of github.com:alercebroker/pipeline into refactor…
AlxEnashi Nov 13, 2023
c69c896
pass lightcurve integration tests
AlxEnashi Nov 13, 2023
960b9a8
passing magstats integration tests
AlxEnashi Nov 13, 2023
ba7309e
pasing prv candidates integration tests
AlxEnashi Nov 13, 2023
0dd1a28
modified s3 step settings weird error in tests
AlxEnashi Nov 13, 2023
632cf7f
not passing scribe test integration tests
AlxEnashi Nov 13, 2023
a6f4212
passing sorting hat step integration tests
AlxEnashi Nov 13, 2023
fd59d3f
made changes to settings and tests. integration test not passing, ins…
AlxEnashi Nov 13, 2023
17494a4
passing xmatch step integration tests
AlxEnashi Nov 13, 2023
5ed40ec
Merge branch 'main' into refactor/schemaless_consumer_use_path
Nov 13, 2023
f0e3657
refactor: simplify loading schema
Nov 13, 2023
251507e
fix: close file after loading
Nov 13, 2023
14aadc1
Merge branch 'main' of github.com:alercebroker/pipeline into refactor…
AlxEnashi Nov 13, 2023
8a60a9d
Merge branch 'refactor/schemaless_consumer_use_path' of github.com:al…
AlxEnashi Nov 13, 2023
92f3c8a
Merge pull request #266 from alercebroker/refactor/steps_integration_…
dirodriguezm Nov 13, 2023
9e7b13c
feat: add candid
Nov 13, 2023
3c1c7ca
tests: fix feature step schemaless
Nov 13, 2023
3f326a7
chore: fix black formatting
Nov 13, 2023
f65bfd8
tests: fix correction step integration tests
Nov 13, 2023
cae5520
fix: schema path
Nov 13, 2023
93b7918
tests: refactor to use schemas
Nov 13, 2023
d7bf224
fix: schema path
Nov 13, 2023
ecba927
chore: delete -x on pytest
Nov 13, 2023
f82f666
tests: fix unit test
Nov 13, 2023
a82adde
fix: schema path on settings
Nov 13, 2023
2f051d9
tests: fix tests that use schema
Nov 13, 2023
8e0c601
chore: remove unused import
Nov 13, 2023
503f955
fix: prv candidates with schema path
Nov 13, 2023
a870933
chore: delete print
Nov 14, 2023
60c6351
Merge remote-tracking branch 'origin/main' into refactor/schemaless_c…
Nov 14, 2023
d08ed59
tests: fix mock producer set_key_field
Nov 14, 2023
581f910
Merge branch 'main' of github.com:alercebroker/pipeline into refactor…
AlxEnashi Nov 14, 2023
d35154d
runned black
AlxEnashi Nov 14, 2023
f21e906
tests(lc_classification_step): fix unit tests with schema path
Nov 14, 2023
4b6d301
refactor(lc_classification_step): uses schema path
dirodriguezm Nov 14, 2023
32bb453
passing magstats tests and updated dockerfile
AlxEnashi Nov 14, 2023
9ec02e7
Merge branch 'refactor/schemaless_consumer_use_path' of github.com:al…
AlxEnashi Nov 14, 2023
0c5e5fa
updated settings and dockerfile lightcurve step
AlxEnashi Nov 14, 2023
94dfb0e
scribe integration not passing
AlxEnashi Nov 14, 2023
4496b79
feat: allow to use yaml file config
dirodriguezm Nov 14, 2023
661504e
feat: add step config as yaml values
dirodriguezm Nov 14, 2023
31307c5
Merge branch 'main' of github.com:alercebroker/pipeline into refactor…
AlxEnashi Nov 14, 2023
a9c77b7
merged main
AlxEnashi Nov 14, 2023
1d8a64f
restored branch chart version for lc classification
AlxEnashi Nov 14, 2023
b4cb2fb
fix typo in scribe settings and pop innecesary vairable
AlxEnashi Nov 15, 2023
ead122d
updated dockerfiles with the copi from builder and the copy of scribe…
AlxEnashi Nov 15, 2023
5b3e7f4
chore: black formatting
dirodriguezm Nov 15, 2023
503a4c5
ci: delete unused env variable
dirodriguezm Nov 15, 2023
6ed0641
chore: add typing
dirodriguezm Nov 15, 2023
c4d2a99
refactor: allow config from yaml file on chart values
dirodriguezm Nov 15, 2023
92266d2
refactor(prv_candidates_step): allow settings from yaml file
dirodriguezm Nov 15, 2023
e755b3e
refactor(lightcurve-step): allow to use yaml file as settings
dirodriguezm Nov 15, 2023
7a8fe9b
fix: restore environ after test
dirodriguezm Nov 15, 2023
dc5ef4c
chore: update lock
dirodriguezm Nov 15, 2023
09fc041
fix: sorting hat with yaml config file
dirodriguezm Nov 15, 2023
97b9bae
Merge remote-tracking branch 'origin/main' into refactor/schemaless_c…
dirodriguezm Nov 16, 2023
b5f035a
chore: delete unused import
dirodriguezm Nov 16, 2023
9a2cad1
fix: add missing enabled config
dirodriguezm Nov 16, 2023
798d84e
feat(correction_step): use yaml config file
dirodriguezm Nov 16, 2023
1bb59b2
fix(correction_step): load settings from yaml
dirodriguezm Nov 16, 2023
39c6482
fix(correction_step): add missing schema path
dirodriguezm Nov 16, 2023
b3852ac
feat(magstats-step): use step settings from yaml file
dirodriguezm Nov 16, 2023
7a82fa3
Merge remote-tracking branch 'origin/main' into refactor/schemaless_c…
dirodriguezm Nov 16, 2023
79ad100
fix(magstats-step): apf update
dirodriguezm Nov 16, 2023
f8734f9
feat(xmatch-step): use config from yaml file
dirodriguezm Nov 16, 2023
2a534b9
chore: sort imports
dirodriguezm Nov 16, 2023
4a06299
feat(feature-step): allow settings from yaml file
dirodriguezm Nov 16, 2023
374f95a
chore: add schema_path value
dirodriguezm Nov 16, 2023
8340d14
feat(metadata-step): use config from yaml
dirodriguezm Nov 17, 2023
d945dd3
chore: add default values
dirodriguezm Nov 17, 2023
a384007
chore: add metrics schema
dirodriguezm Nov 17, 2023
bf64e3d
feat(scribe): allow config from yaml
dirodriguezm Nov 17, 2023
96c94da
feat(metadata): allow config from yaml in chart
dirodriguezm Nov 17, 2023
518c9d4
feat(scribe): allow config from yaml in chart
dirodriguezm Nov 17, 2023
413d6a3
chore:add staging helm values
dirodriguezm Nov 17, 2023
cf07873
Merge remote-tracking branch 'origin/main' into refactor/schemaless_c…
dirodriguezm Nov 17, 2023
8bece78
Merge branch 'main' into refactor/schemaless_consumer_use_path
edipizarro Nov 22, 2023
47cd524
Merge branch 'main' into refactor/schemaless_consumer_use_path
edipizarro Nov 22, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/workflows/lc_classification_step.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ jobs:
TEST_MESSI_HEADER_QUANTILES_PATH: "${{ secrets.TEST_MESSI_HEADER_QUANTILES_PATH }}"
TEST_MESSI_FEATURE_QUANTILES_PATH: "${{ secrets.TEST_MESSI_FEATURE_QUANTILES_PATH }}"
TEST_TORETTO_MODEL_PATH: "${{ secrets.TEST_TORETTO_MODEL_PATH }}"
TEST_BARNEY_MODEL_PATH: "${{ secrets.TEST_BARNEY_MODEL_PATH }}"
TEST_MLP_MODEL_PATH: "${{ secrets.TEST_MLP_MODEL_PATH }}"
lc_classification_step_integration:
uses: ./.github/workflows/poetry-tests-template.yaml
Expand All @@ -47,7 +46,6 @@ jobs:
TEST_MESSI_HEADER_QUANTILES_PATH: "${{ secrets.TEST_MESSI_HEADER_QUANTILES_PATH }}"
TEST_MESSI_FEATURE_QUANTILES_PATH: "${{ secrets.TEST_MESSI_FEATURE_QUANTILES_PATH }}"
TEST_TORETTO_MODEL_PATH: "${{ secrets.TEST_TORETTO_MODEL_PATH }}"
TEST_BARNEY_MODEL_PATH: "${{ secrets.TEST_BARNEY_MODEL_PATH }}"
TEST_MLP_MODEL_PATH: "${{ secrets.TEST_MLP_MODEL_PATH }}"


Expand Down
2 changes: 1 addition & 1 deletion charts/correction_step/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ appVersion: 6.2.1a102
description: Correction step chart
name: correction-step
type: application
version: 1.2.184
version: 2.0.0
20 changes: 4 additions & 16 deletions charts/correction_step/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,9 @@
---
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "correction-step.fullname" . }}
name: config-yaml
namespace: {{ .Values.namespace }}
data:
consumer-topics: {{ .Values.configmap.consumerTopics }}
consumer-server: {{ .Values.configmap.consumerServer }}
consumer-group-id: {{ .Values.configmap.consumerGroupId | default (printf "%s" (include "correction-step.fullname" .)) }}
scribe-server: {{ .Values.configmap.scribeServer }}
scribe-topic: {{ .Values.configmap.scribeTopic }}
producer-message-max-bytes: "{{ .Values.configmap.producerMessageMaxBytes }}"
producer-server: {{ .Values.configmap.producerServer }}
producer-topic: {{ .Values.configmap.producerTopic }}
pyroscope-server: {{ .Values.configmap.pyroscopeServer }}
metrics-server: {{ .Values.configmap.metricsServer }}
metrics-topic: {{ .Values.configmap.metricsTopic }}
consume-messages: "{{ .Values.configmap.consumeMessages }}"
logging-debug: "{{ .Values.configmap.loggingDebug }}"
consume-timeout: "{{ .Values.configmap.consumeTimeout }}"
use-profiling: "{{ .Values.configmap.useProfiling }}"
config.yaml: |
{{- toYaml .Values.configYaml | nindent 4 }}
146 changes: 16 additions & 130 deletions charts/correction_step/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,140 +29,26 @@ spec:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: metrics
containerPort: 8000
protocol: TCP
resources:
{{- toYaml .Values.resources | nindent 12 }}
env:
- name: CONSUMER_TOPICS
valueFrom:
configMapKeyRef:
name: {{ include "correction-step.fullname" . }}
key: consumer-topics
- name: CONSUMER_SERVER
valueFrom:
configMapKeyRef:
name: {{ include "correction-step.fullname" . }}
key: consumer-server
- name: CONSUMER_GROUP_ID
valueFrom:
configMapKeyRef:
name: {{ include "correction-step.fullname" . }}
key: consumer-group-id
- name: CONSUME_MESSAGES
valueFrom:
configMapKeyRef:
name: {{ include "correction-step.fullname" . }}
key: consume-messages
- name: CONSUME_TIMEOUT
valueFrom:
configMapKeyRef:
name: {{ include "correction-step.fullname" . }}
key: consume-timeout
- name: PRODUCER_SERVER
valueFrom:
configMapKeyRef:
name: {{ include "correction-step.fullname" . }}
key: producer-server
- name: PRODUCER_TOPIC
valueFrom:
configMapKeyRef:
name: {{ include "correction-step.fullname" . }}
key: producer-topic
- name: SCRIBE_SERVER
valueFrom:
configMapKeyRef:
name: {{ include "correction-step.fullname" . }}
key: scribe-server
- name: SCRIBE_TOPIC
valueFrom:
configMapKeyRef:
name: {{ include "correction-step.fullname" . }}
key: scribe-topic
- name: METRICS_SERVER
valueFrom:
configMapKeyRef:
name: {{ include "correction-step.fullname" . }}
key: metrics-server
- name: METRICS_TOPIC
valueFrom:
configMapKeyRef:
name: {{ include "correction-step.fullname" . }}
key: metrics-topic
- name: LOGGING_DEBUG
valueFrom:
configMapKeyRef:
name: {{ include "correction-step.fullname" . }}
key: logging-debug
- name: USE_PROFILING
valueFrom:
configMapKeyRef:
name: {{ include "correction-step.fullname" . }}
key: use-profiling
- name: PYROSCOPE_SERVER
valueFrom:
configMapKeyRef:
name: {{ include "correction-step.fullname" . }}
key: pyroscope-server
{{- if .Values.secrets.kafkaAuth.consumer.enabled }}
- name: CONSUMER_KAFKA_USERNAME
valueFrom:
secretKeyRef:
name: kafka-auth
key: consumer-username
- name: CONSUMER_KAFKA_PASSWORD
valueFrom:
secretKeyRef:
name: kafka-auth
key: consumer-password
{{- end }}
{{- if .Values.secrets.kafkaAuth.producer.enabled }}
- name: PRODUCER_KAFKA_USERNAME
valueFrom:
secretKeyRef:
name: kafka-auth
key: producer-username
- name: PRODUCER_KAFKA_PASSWORD
valueFrom:
secretKeyRef:
name: kafka-auth
key: producer-password
- name: PRODUCER_MESSAGE_MAX_BYTES
valueFrom:
configMapKeyRef:
name: {{ include "correction-step.fullname" . }}
key: producer-message-max-bytes
{{- end }}
{{- if .Values.secrets.kafkaAuth.scribe.enabled }}
- name: SCRIBE_KAFKA_USERNAME
valueFrom:
secretKeyRef:
name: kafka-auth
key: scribe-username
- name: SCRIBE_KAFKA_PASSWORD
valueFrom:
secretKeyRef:
name: kafka-auth
key: scribe-password
{{- end }}
{{- if .Values.secrets.kafkaAuth.metrics.enabled }}
- name: METRICS_KAFKA_USERNAME
valueFrom:
secretKeyRef:
name: kafka-auth
key: metrics-username
- name: METRICS_KAFKA_PASSWORD
valueFrom:
secretKeyRef:
name: kafka-auth
key: metrics-password
{{- end }}
{{- with .Values.extraEnvVariables }}
{{- tpl (toYaml .) $ | nindent 12 }}
{{- end}}
{{- toYaml .Values.envVariables | nindent 12 }}
{{- if .Values.configYaml.enabled }}
volumeMounts:
- name: config
mountPath: "/config"
readOnly: true
{{- end}}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.configYaml.enabled }}
volumes:
- name: config
configMap:
name: config-yaml
items:
- key: "config.yaml"
path: "config.yaml"
{{- end }}
15 changes: 0 additions & 15 deletions charts/correction_step/templates/secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,3 @@ metadata:
type: kubernetes.io/dockerconfigjson
data:
.dockerconfigjson: {{ template "imagePullSecret" . }}
---
apiVersion: v1
kind: Secret
metadata:
name: kafka-auth
namespace: {{ .Values.namespace }}
stringData:
consumer-username: "{{ .Values.secrets.kafkaAuth.consumer.username }}"
consumer-password: "{{ .Values.secrets.kafkaAuth.consumer.password }}"
producer-username: "{{ .Values.secrets.kafkaAuth.producer.username }}"
producer-password: "{{ .Values.secrets.kafkaAuth.producer.password }}"
scribe-username: "{{ .Values.secrets.kafkaAuth.scribe.username }}"
scribe-password: "{{ .Values.secrets.kafkaAuth.scribe.password }}"
metrics-username: "{{ .Values.secrets.kafkaAuth.metrics.username }}"
metrics-password: "{{ .Values.secrets.kafkaAuth.metrics.password }}"
96 changes: 56 additions & 40 deletions charts/correction_step/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ fullnameOverride: ""

podAnnotations: {}

service:
type: ClusterIP
port: 8000

resources:
requests:
memory: 600M
Expand All @@ -45,50 +41,70 @@ affinity:
## Override this value with the NodeGroup tag accordingly
values: []

configmap:
consumerTopics: ""
consumerServer: ""
consumerGroupId: ""
loggingDebug: ""
producerServer: ""
producerTopic: ""
producerMessageMaxBytes: ""
pyroscopeServer: "http://pyroscope.pyroscope:4040"
scribeServer: ""
scribeTopic: ""
metricsServer: ""
metricsTopic: ""
consumeMessages: "500"
consumeTimeout: "0"
useProfiling: ""

secrets:
kafkaAuth:
consumer:
enabled: false
username: ""
password: ""
producer:
enabled: false
username: ""
password: ""
scribe:
enabled: false
username: ""
password: ""
metrics:
enabled: false
username: ""
password: ""

imageCredentials:
registry: ""
username: ""
password: ""
email: ""

extraEnvVariables:
- name: CONFIG_FROM_YAML
value: "yes"
## - name: METRICS_SOURCE
## value: {{ .Release.Name }}
## - name: METRICS_SURVEY
## value: ATLAS

configYaml:
enabled: true
CONSUMER_CONFIG:
CLASS: "apf.consumers.KafkaConsumer"
PARAMS:
bootstrap.servers: ""
group.id: "correction-step"
auto.offset.reset: "beginning"
enable.partition.eof: false
security.protocol: "SASL_SSL"
sasl.mechanisms: "SCRAM-SHA-512"
sasl.username: ""
sasl.password: ""
TOPICS: ["lightcurve"]
consume.messages: 100
consume.timeout: 10
METRICS_CONFIG:
CLASS: "apf.metrics.KafkaMetricsProducer"
EXTRA_METRICS:
- key: aid
- key: candid
PARAMS:
PARAMS:
bootstrap.servers: ""
security.protocol: "SASL_SSL"
sasl.mechanisms: "SCRAM-SHA-512"
sasl.username: ""
sasl.password: ""
TOPIC: "metrics"
SCHEMA_PATH: "/schemas/correction_step/metrics.json"
PRODUCER_CONFIG:
CLASS: "apf.producers.KafkaProducer"
PARAMS:
bootstrap.servers: ""
security.protocol: "SASL_SSL"
sasl.mechanisms: "SCRAM-SHA-512"
sasl.username: ""
sasl.password: ""
TOPIC: "correction"
SCHEMA_PATH: "/schemas/correction_step/output.avsc"
SCRIBE_PRODUCER_CONFIG:
CLASS: "apf.producers.KafkaProducer"
PARAMS:
bootstrap.servers: ""
message.max.bytes: 6291456
security.protocol: "SASL_SSL"
sasl.mechanisms: "SCRAM-SHA-512"
sasl.username: ""
sasl.password: ""
SCHEMA_PATH: "/schemas/scribe_step/scribe.avsc"
LOGGING_DEBUG: false
FEATURE_FLAGS:
PROMETHEUS: false
2 changes: 1 addition & 1 deletion charts/feature_step/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ appVersion: 6.2.1a102
description: Step for feature calculation
name: feature-step
type: application
version: 1.4.182
version: 2.0.0
16 changes: 4 additions & 12 deletions charts/feature_step/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
---
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "feature-step.fullname" . }}
name: config-yaml
namespace: {{ .Values.namespace }}
data:
consumer-topics: {{ .Values.configmap.consumerTopics }}
group-id: {{ .Values.configmap.groupId | default (printf "%s" (include "feature-step.fullname" .)) }}
internal-server: {{ .Values.configmap.internalServer }}
metrics-topic: {{ .Values.configmap.metricsTopic }}
producer-message-max-bytes: "{{ .Values.configmap.producerMessageMaxBytes }}"
producer-topic: {{ .Values.configmap.producerTopic }}
consume-timeout: "{{ .Values.configmap.consumeTimeout }}"
consume-messages: "{{ .Values.configmap.consumeMessages }}"
feature-extractor: "{{ .Values.configmap.featureExtractor }}"
logging-debug: "{{ .Values.configmap.loggingDebug }}"
scribe-topic: "{{ .Values.configmap.scribeTopic }}"
config.yaml: |
{{- toYaml .Values.configYaml | nindent 4 }}
Loading
Loading