-
Notifications
You must be signed in to change notification settings - Fork 0
README for WorkerApplication #130
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,97 @@ | ||
| # WorkerApplication Configuration and HK2 Bindings | ||
|
|
||
| This document inventories all configurations used in WorkerApplication. | ||
|
|
||
|
|
||
| ## Configuration overview | ||
|
|
||
| 1. bucketName | ||
| - Type and name: Context: bucket. ENV: PUBLISH_S3_BUCKET | ||
| - What it does: Defines the S3 bucket used for export. | ||
| - Quarkus suggestion: Map to `@ConfigProperty` in `application.properties`. | ||
|
|
||
| 2. cloudId | ||
| - Type and name: Context: cloudId. ENV: CLOUDID | ||
| - What it does: Identifies the AWS worker instance. If not set, AWS worker will not start. | ||
| - Quarkus suggestion: Map to `@ConfigProperty`. | ||
|
|
||
| 3. aws.accessKeyId | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Drop both accessKeyId and secretKey. We will rely entirely on DefaultAwsRegionProviderChain. This is possible because in CMS 5.3 cloud setup we no longer need separate API keys for multi-worker installations. |
||
| - Type and name: Context: aws.accessKeyId. | ||
| - What id does: AWS access key used for authentication. | ||
| - Quarkus suggestion: Map to `quarkus.amazon.credentials.type` or `@ConfigProperty`. | ||
|
|
||
| 4. aws.secretKey | ||
| - Type and name: Context: aws.secretKey. | ||
| - What it does: AWS secret key is used for authentication. | ||
| - Quarkus suggestion: Map to `quarkus.amazon.credentials.type` or `@ConfigProperty`. | ||
|
|
||
| 5. AWS Region | ||
| - Type and name: ENV (AWS default region configuration) | ||
| - What it does: Determines which AWS region is used. And default fallback is eu-west-1. | ||
| - Quarkus suggestion: Use `quarkus.amazon.region` or `@ConfigProperty`. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, will see which is needed depending on how the S3 / SFN clients are injected. We can remove the default if it simplifies the implementation. Important: |
||
|
|
||
| 6. PUBLISH_S3_ACCELERATED | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should remain an ENV (same name) |
||
| - Type and name: ENV: PUBLISH_S3_ACCELERATED | ||
| - What it does: Enables S3 transfer acceleration. | ||
| - Quarkus suggestion: Map to `@ConfigProperty`. | ||
|
|
||
| 7. PUBLISH_FS_PATH | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should remain an ENV (same name) |
||
| - Type and name: ENV: PUBLISH_FS_PATH | ||
| - What is does: Defines local filesystem export path. If set, export uses local file system instead of S3. | ||
| - Quarkus suggestion: Map to `@ConfigProperty`. | ||
|
|
||
| 8. APTAPPLICATION | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. APTAPPLICATION must remain an ENV because it is used by Arbortext as well. |
||
| - Type and name: ENV: APTAPPLICATION | ||
| - What it does: Defines application path prefix used by PublishJobService. | ||
| - Quarkus suggestion: Map to `@ConfigProperty`. | ||
|
|
||
|
|
||
| ## HK2 Bindings Overview | ||
|
|
||
| 1. WorkerStatusReport | ||
| - Class / Type: WorkerStatusReport | ||
| - Purpose: Used to report worker status inside the application | ||
| - Quarkus suggestion: Replace with `@Singleton` CDI bean. | ||
|
|
||
| 2. region | ||
| - Class / Type: Region. | ||
| - Purpose: Represents the AWS region used by AWS clients. | ||
| - Quarkus suggestion: Inject via `@ConfigProperty` or `@Singleton`. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure, depends on how clients are injected. Might be better with @produces |
||
|
|
||
| 3. bucketName | ||
| - Class / Type: String (named binding) | ||
| - Purpose: Holds the configured S3 bucket name. Injected by name in HK2. | ||
| - Quarkus suggestion: Use `@ConfigProperty` with `@Named`. | ||
|
|
||
| 4. exportProviders (Important – Multiple Implementations). | ||
| - Class / Type: Map<String, CmsExportProvider>. | ||
| - Purpose: Contains multiple export provider implementations. | ||
| - "fs" --> CmsExportProviderFsSingle (local file export). | ||
| - "s3" --> CmsExportProviderAwsSingle (S3 export). | ||
| - Quarkus suggestion: Inject as a singleton bean with `@Produces`. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, produce the whole Map which means we (hopefully) don't have to modify the code using this Map. |
||
|
|
||
| 5. SfnClient | ||
| - Class / Type: SfnClient. | ||
| - Purpose: AWS Step Functions client | ||
| - Quarkus suggestion: Replace with `@Singleton` or Quarkus AWS SDK client injection. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
| 6. ObjectReader / ObjectWriter | ||
| - Class / Type: Jackson | ||
| - Purpose: JSON serialization and deserialization. | ||
| - Quarkus suggestion: Inject via CDI or use `@Produces` beans. | ||
|
|
||
| 7. PublishServicePe | ||
| - Class / Type: PublishServicePe. | ||
| - Purpose: Backend publish service. | ||
| - Quarkus suggestion: Replace with `@Singleton` CDI bean. | ||
|
|
||
| 8. PublishJobService | ||
| - Class / Type: PublishJobService. | ||
| - Purpose: Orchestrates export and publish jobs. | ||
| - Quarkus suggestion: Replace with `@Singleton` CDI bean. | ||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Current logic:
context parameter overrides environment variable, enables multiple workers.
The context parameter should be refactored to @ConfigProperty. Let's drop the ENV support.