-
-
Notifications
You must be signed in to change notification settings - Fork 365
feat: deprecate embedded postgres ahead of v4 #3610
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
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
d4c86e7
feat: add slim Docker image variant without embedded postgres
dkrizan 448a8be
chore: build slim release image without registry cache
dkrizan 9e5051f
ci: add slim docker smoke test job
dkrizan 52ecf79
ci: use jq to parse actuator health status in slim smoke test
dkrizan 2fe6cfe
Update .github/workflows/test.yml
dkrizan c5f9e42
feat: warn on startup that embedded postgres is deprecated
dkrizan 548c544
chore: keep the slim image internal and name v4 in the deprecation wa…
dkrizan ca5498b
docs: mark EMBEDDED postgres autostart mode as deprecated
dkrizan b289936
docs: point the postgres deprecation notices at the migration guide
dkrizan 9ef40c2
ci: smoke test the slim image against postgres 17
dkrizan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
.../main/kotlin/io/tolgee/commandLineRunners/EmbeddedPostgresDeprecationCommandLineRunner.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| package io.tolgee.commandLineRunners | ||
|
|
||
| import io.tolgee.configuration.tolgee.PostgresAutostartProperties | ||
| import io.tolgee.configuration.tolgee.PostgresAutostartProperties.PostgresAutostartMode | ||
| import org.slf4j.LoggerFactory | ||
| import org.springframework.boot.CommandLineRunner | ||
| import org.springframework.stereotype.Component | ||
|
|
||
| @Component | ||
| class EmbeddedPostgresDeprecationCommandLineRunner( | ||
| private val postgresAutostartProperties: PostgresAutostartProperties, | ||
| ) : CommandLineRunner { | ||
| private val logger = LoggerFactory.getLogger(this::class.java) | ||
|
|
||
| override fun run(vararg args: String) { | ||
| if (!postgresAutostartProperties.enabled || postgresAutostartProperties.mode != PostgresAutostartMode.EMBEDDED) { | ||
| return | ||
| } | ||
|
|
||
| logger.warn( | ||
| "The embedded PostgreSQL bundled in the tolgee/tolgee image is deprecated and will be removed in Tolgee v4. " + | ||
| "Migrate to an external database before upgrading. " + | ||
| "See https://docs.tolgee.io/platform/self_hosting/running_with_docker" + | ||
| "#migrate-from-the-bundled-database", | ||
| ) | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| FROM eclipse-temurin:21-jre-alpine | ||
|
dkrizan marked this conversation as resolved.
|
||
|
|
||
| RUN apk --no-cache add bash | ||
|
dkrizan marked this conversation as resolved.
|
||
|
|
||
| ############# | ||
| ### Tolgee # | ||
| ############# | ||
|
|
||
| # Expose application port | ||
| EXPOSE 8080 | ||
|
|
||
| # Define persistent volume for data storage | ||
| VOLUME /data | ||
|
|
||
| # Environment variables for configuration | ||
| # Postgres autostart is disabled — the slim image doesn't bundle the postgres | ||
| # server, so it must be run against an external database. | ||
| ENV HEALTHCHECK_PORT=8080 \ | ||
| spring_profiles_active=docker \ | ||
| TOLGEE_POSTGRES_AUTOSTART_ENABLED=false | ||
|
|
||
| # Copy necessary application files | ||
| COPY BOOT-INF/lib /app/lib | ||
| COPY META-INF /app/META-INF | ||
| COPY BOOT-INF/classes /app | ||
| COPY --chmod=755 cmd.sh /app | ||
|
|
||
| # Download OpenTelemetry Java agent for distributed tracing | ||
| # When OTEL_JAVAAGENT_ENABLED=true, cmd.sh will use this agent | ||
| # See: docs/observability/ | ||
| # Version is passed from gradle.properties via --build-arg (see gradle/docker.gradle) | ||
| ARG OTEL_AGENT_VERSION | ||
| RUN test -n "$OTEL_AGENT_VERSION" || (echo "OTEL_AGENT_VERSION build arg is required" && exit 1) | ||
| RUN wget -O /app/opentelemetry-javaagent.jar \ | ||
| "https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v${OTEL_AGENT_VERSION}/opentelemetry-javaagent.jar" | ||
|
|
||
| ################# | ||
| ### Let's go ## | ||
| ################# | ||
|
|
||
| # Define the startup command | ||
| ENTRYPOINT ["/app/cmd.sh"] | ||
|
|
||
|
|
||
| # Health check to ensure the app is up and running | ||
| HEALTHCHECK --interval=10s --timeout=3s --retries=20 \ | ||
| CMD wget --spider -q "http://127.0.0.1:$HEALTHCHECK_PORT/actuator/health" || exit 1 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.