-
Notifications
You must be signed in to change notification settings - Fork 8
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
Fix issues with docker-compose #41
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
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 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 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 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,37 @@ | ||
package edu.wgu.osmt | ||
|
||
import org.slf4j.LoggerFactory | ||
import org.springframework.context.annotation.Profile | ||
import org.springframework.context.event.ContextRefreshedEvent | ||
import org.springframework.context.event.EventListener | ||
import org.springframework.core.env.AbstractEnvironment | ||
import org.springframework.core.env.EnumerablePropertySource | ||
import org.springframework.core.env.PropertySource | ||
import org.springframework.stereotype.Component | ||
import java.util.* | ||
import java.util.stream.StreamSupport | ||
|
||
|
||
@Component | ||
@Profile("dev") | ||
class PropertyLogger { | ||
@EventListener | ||
fun handleContextRefresh(event: ContextRefreshedEvent) { | ||
val env = event.applicationContext.environment | ||
LOGGER.info("====== Environment and configuration ======") | ||
LOGGER.info("Active profiles: {}", Arrays.toString(env.activeProfiles)) | ||
val sources = (env as AbstractEnvironment).propertySources | ||
StreamSupport.stream(sources.spliterator(), false) | ||
.filter { ps: PropertySource<*>? -> ps is EnumerablePropertySource<*> } | ||
.map { ps: PropertySource<*> -> (ps as EnumerablePropertySource<*>).propertyNames } | ||
.flatMap { array: Array<String>? -> Arrays.stream(array) } | ||
.distinct() | ||
.filter { prop: String -> !(prop.contains("credentials") || prop.contains("password")) } | ||
.forEach { prop: String? -> LOGGER.info("{}: {}", prop, env.getProperty(prop!!)) } | ||
LOGGER.info("===========================================") | ||
} | ||
|
||
companion object { | ||
private val LOGGER = LoggerFactory.getLogger(PropertyLogger::class.java) | ||
} | ||
} |
This file contains 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 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 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 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
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.
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 the Java version?
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.
We continue to pull in the latest OpenJDK 11. yum install is no longer able to find an openjdk package as the name is composed (using a specific version number, line 18, below).
For what it's worth, this isn't an automation issue or Docker networking. I built the image to that point and tried to yum install from the shell in a container. I see the package referenced online, but it's not available in this context.
We could possibly fix this by pointing to a different package repo?
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.
Are we able to bump the Java version to the latest package?
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 can look at that. I thought that's what we would get by just saying java-11-openjdk on line 17.
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.
@drey-bigney We were talking offline about pinning to a specific openjdk version. If we pin to specific versions of OS packages or software dependencies, then we absorb responsibility for doing security updates out-of-band from the build process. We trade security updates for the safety of known-good dependency trees. The world keeps turning, and things will drift... Better than pinning to a given version of OpenJDK, we should probably have a pipeline that runs all this and shows a build status badge.
I've added Issue #44 "Implement build badges for docker-compose". To me, this is a superior approach to pinning to a specific patch version of java-11-openjdk, and satisfies the open issues for this PR.
Re: omitting the integration tests from the Docker build, using a Maven profile was the cleanest, duct-tape-free self-documenting approach that I saw.
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.
@JohnKallies that makes sense. As long as we are sticking with the same major version of the JDK I doubt we'll see breaking changes and this'll free us from breaking the build system every time a minor JDK revision happens.
+1
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.
Interesting. I thought that patch management was a key responsibility of any project's maintainers... Therefore, pinning is implied by the responsibility to maintain. If you don't pin, you don't know what you're getting. "Trusting the source" has led to countless problems for my team, when they don't follow semver and break compatibility, or the fixes have breaking side-effects that didn't affect the mainline users. I think pinning is the safe approach.