-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Migrate airbyte-bootloader to Micronaut #21073
Conversation
207aaf9
to
9b05e22
Compare
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.
Exciting to see a bootloader on micronaut, we're getting there!
I don't know if you tested the integration with cloud, but looking at some changes on the bootloader constructor, we may run into some issues.
.env
Outdated
@@ -39,6 +39,10 @@ BASIC_AUTH_PASSWORD=password | |||
BASIC_AUTH_PROXY_TIMEOUT=600 | |||
|
|||
### DATABASE ### | |||
# Airbyte Bootloader environment variables | |||
BOOTLOADER_MIGRATION_BASELINE_VERSION=0.29.0.001 | |||
RUN_DATABASE_MIGRATION_ON_STARTUP=true |
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.
Any cases where we do not want to run migrations?
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.
@gosusnp Don't know. This env var exists for some reason, so I suspect it was added for a particular case. We can obviously remove this in the future if we deem that it is not needed.
implementation libs.temporal.sdk | ||
implementation libs.flyway.core | ||
testAnnotationProcessor platform(libs.micronaut.bom) | ||
testAnnotationProcessor libs.bundles.micronaut.test.annotation.processor |
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.
Out of curiosity, what happened to libs.flyway.core
?
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.
It got moved up in this block to ensure that we get the correct version.
airbyte-bootloader/src/main/java/io/airbyte/bootloader/Bootloader.java
Outdated
Show resolved
Hide resolved
airbyte-bootloader/src/main/java/io/airbyte/bootloader/Bootloader.java
Outdated
Show resolved
Hide resolved
airbyte-bootloader/src/main/java/io/airbyte/bootloader/Bootloader.java
Outdated
Show resolved
Hide resolved
airbyte-bootloader/src/test/java/io/airbyte/bootloader/ProtocolVersionCheckerTest.java
Outdated
Show resolved
Hide resolved
airbyte-bootloader/src/main/java/io/airbyte/bootloader/Bootloader.java
Outdated
Show resolved
Hide resolved
87a9106
to
947d82b
Compare
@davinchia The PR has been updated with the changes that we discussed earlier:
|
connection-test-query: SELECT 1 | ||
connection-timeout: 30000 | ||
idle-timeout: 600000 | ||
initialization-fail-timeout: -1 # Disable fail fast checking to avoid issues due to other pods not being started in time |
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.
+1 for the comment
@@ -18,6 +18,15 @@ | |||
@SuppressWarnings("PMD.MissingOverride") | |||
public interface SecretPersistence extends ReadOnlySecretPersistence { | |||
|
|||
/** | |||
* Performs any initialization prior to utilization of the persistence object. This exists to make |
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.
+1
|
||
implementation 'commons-cli:commons-cli:1.4' |
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.
huh, didn't realise this wasn't already in a deps.toml.
} | ||
|
||
// TODO will be called automatically by the dependency injection framework on object creation | ||
@PostConstruct |
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.
Curious, what does this do?
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.
@davinchia This tells the DI framework to run this method after all required singletons used by this singleton are created. It's basically a hook to run some additional init logic. See https://docs.oracle.com/javaee/7/api/javax/annotation/PostConstruct.html for more details.
@@ -33,6 +34,8 @@ public class SecretPersistenceBeanFactory { | |||
pattern = "(?i)^(?!google_secret_manager).*") | |||
@Requires(property = "airbyte.secret.persistence", | |||
pattern = "(?i)^(?!vault).*") | |||
@Requires(property = "airbyte.secret.persistence", | |||
pattern = "(?i)^(?!aws_secret_manager).*") |
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.
oh my first time seeing this, what does the pattern do here?
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.
If the value does NOT equal the string (case insensitive).
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.
@davinchia I should add that once this is merged, I plan on doing a second pass to clean this up/consolidate this so that we don't have this in multiple places.
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.
sounds good. just from a reader pov, it's not immediately clear why we need the inverse match here.
@@ -24,14 +24,10 @@ services: | |||
container_name: airbyte-bootloader | |||
environment: | |||
- AIRBYTE_VERSION=${VERSION} | |||
- CONFIG_DATABASE_PASSWORD=${CONFIG_DATABASE_PASSWORD:-} |
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.
why are we removing these?
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.
They are no longer used. We reference the DATABASE_X
env vars only. We could reintroduce the separate ones if necessary.
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.
ah. if these are no longer used, we should also remove them from the EnvConfigs file.
although, maybe a good idea to wait on that since we haven't yet figured out how we want to track all configuration information globally. i.e. a master list of configuration that our micronaut application yamls accept.
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.
no need to action now. thinking out loud with you
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.
@davinchia Agreed. Once everything is converted to Micronaut, there will be a pass to remove EnvConfigs entirely and clean up the environment variables.
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.
and I hope consolidate into one master list for reference :)
|
||
Exceptions.toRuntime(() -> { | ||
@Override | ||
public void initialize() throws SQLException { |
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.
I understand your previous comment on the test set up now
setCurrentProtocolRangeRange(V0_0_0, V2_0_0); | ||
setTargetProtocolRangeRange(V0_0_0, V2_0_0); | ||
final ProtocolVersionChecker protocolVersionChecker = |
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.
I appreciate you cleaning up the tests as you go
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.
Nice work!
I appreciate the detailed write up, the comments and the minor clean ups here and there.
* Migrate airbyte-bootloader to Micronaut * PR feedback * More PR feedback * Rename variable for clarity * Add properties to support cloud * Formatting * Use default values for env vars * Re-organization to support cloud overrides * Disable conditional logging * More singleton cleanup * test: try CI without fluentbit * Revert "test: try CI without fluentbit" This reverts commit 8fa0f74. * test: enable SSH on EC2 runner * Revert "test: enable SSH on EC2 runner" This reverts commit e4867aa. * Avoid early database connection on startup * Fix compile issues from refactor * Formatting Co-authored-by: perangel <perangel@gmail.com>
What
How
Recommended reading order
Application.java
Bootloader.java
application.yml
build.gradle
ProtocolVersionChecker.java
ApplyDefinitionsHelper.java
RemoteDefinitionsProvider.java
PostLoadExecutor.java
DefaultPostLoadExecutor.java
SecretPersistence.java
LocalTestingSecretPersistence.java
SecretMigrator.java
docker-compose.yml
.env/.env.dev
Tests
N.B.:
This is a preview PR. I still need to integrate this into airbyte-cloud to verify everything works. Once I have done that, this PR will be moved from a draft to ready for review. However, I don't expect it to change very much, so feel free to do a first pass review.