CALC-58: Added support for Bamboo Specs.#14
Conversation
|
Hi @dkayiwa, could we merge this? |
|
What failures do you get for the other Java versions? |
|
This master branch was updated a few days ago. I missed this. Let me update this PR accordingly. |
|
Hi @dkayiwa, I think this might have slipped through the cracks. Could we go ahead and get it merged? |
bamboo-specs/bamboo.yml
Outdated
|
|
||
| export IMAGE="maven:3.9.9-amazoncorretto-8" | ||
|
|
||
| docker pull ${IMAGE} |
There was a problem hiding this comment.
By the way, do we need to explicitly pull? Shouldn't run automatically do that?
There was a problem hiding this comment.
By the way, do we need to explicitly pull?
No, just for explicitly's sake. It's not harmful but I could remove it.
There was a problem hiding this comment.
I like reviewing a smaller number of lines :)
There was a problem hiding this comment.
Should be a lighter review now with the latest commit... :-)
| scripts: | ||
| - |- | ||
| #!/bin/bash -eu | ||
|
|
There was a problem hiding this comment.
Are these two lines in between?
There was a problem hiding this comment.
I see one line in between, line 57.
bamboo-specs/bamboo.yml
Outdated
|
|
||
| set -x | ||
|
|
||
| export IMAGE="maven:3.9.9-amazoncorretto-8" |
There was a problem hiding this comment.
Do we still need the above line?
There was a problem hiding this comment.
Yep, it’s just to make it easier for others to find the right variable when making changes.
There was a problem hiding this comment.
I am not sold to variables for one time usages. I usually defer to the times when such need actually arises. I am a fun of reviewing and maintaining less code 😊
There was a problem hiding this comment.
I guess, it comes down to balancing between less code and clarity, especially when it involves variables that might change later. Personally, I’d prefer more explicit and readable lines over fewer, less clear ones. I'm happy to change in favour of fewer lines though as I think this may not be the best example.
There was a problem hiding this comment.
When you say might change, many times this never happens. That is how we end up with lots of things in our code bases that are never used. But a developer thought that this might be of use in the future. I do not see us reducing the clarity of this code by using maven:3.9.9-amazoncorretto-8, unless we want to use it to teach others the meaning of the parameters for the docker run command. 😊
There was a problem hiding this comment.
I like this... Thanks for clarifying @dkayiwa.
bamboo-specs/bamboo.yml
Outdated
|
|
||
| export IMAGE=${bamboo.build.docker.image.id} | ||
|
|
||
| docker pull ${IMAGE} |
There was a problem hiding this comment.
Yes, to ensure we’re using the latest of the provided image if not pulled yet.
There was a problem hiding this comment.
Wouldn't the docker run automatically do that?
There was a problem hiding this comment.
At-times no especially if the image available in the local cache exists even when not the latest.
There was a problem hiding this comment.
Aren't we using a specific image version?
There was a problem hiding this comment.
The one provided at that build stage varies and so is not specific. It does have a default though.
There was a problem hiding this comment.
If you provided this to the docker run command ${bamboo.build.docker.image.id}, will it run a different one from ${IMAGE} ?
There was a problem hiding this comment.
Should now be amended below.
|
|
||
| set -x | ||
|
|
||
| docker pull ${bamboo.build.docker.image.id} |
There was a problem hiding this comment.
Yes, for the reason I had share in the previous review. Basically to ensure that the image version passed in is always the latest, otherwise cached older variants could be used.
There was a problem hiding this comment.
Doesn't ${bamboo.build.docker.image.id} point to a specific id?
There was a problem hiding this comment.
Yes, but there's provision to override that version which is the reason for ensuring safe override.
There was a problem hiding this comment.
Do you mean that if you run docker, without an explicit pull, it will not pull the exact version contained in ${bamboo.build.docker.image.id}?
There was a problem hiding this comment.
This depends on whether the image was cached. Cached images can become stale, and Docker won’t always pull the latest version if the image already exists on the machine.
There was a problem hiding this comment.
Isn't that the same behaviour for the docker pull command? Will docker pull again an image which already exists?
There was a problem hiding this comment.
No. With docker run if a local cache exists, docker won't bother pulling an updated version which is why there's need for explicitly execute docker pull.
|
|
||
| set -x | ||
|
|
||
| docker pull ${bamboo.build.docker.image.id} |
There was a problem hiding this comment.
Yes, for the reason I had share in the previous review. Basically to ensure that the image version passed in is always the latest, otherwise cached older variants could be used.
There was a problem hiding this comment.
Docker images are immutable. So if you are using a specific version ${bamboo.build.docker.image.id}, how can it be modified and stay as the same version.
There was a problem hiding this comment.
Let's consider using maven:3.9.9-amazoncorretto-21. It could be any compatible variant, as that version may come in different flavors depending on the specific minor Java 21 updates included (e.g. 21.0.1, ..., 21.0.8 e.t.c). So if an older variant cache is present, the newer one is not pulled automatically by docker run.
There was a problem hiding this comment.
Can you point me to the documentation where you are reading this from?
There was a problem hiding this comment.
... if a new version of the image being used is available, it doesn't get downloaded before the jobs run. This can cause jobs to fail if new features have been added to the image and are required for the new workflow to succeed.
Cause
Bamboo uses a cached image on the build agent. If Docker finds the tag locally, it won't check the remote registry for an updated version of the same tag.
There was a problem hiding this comment.
Can i look at some of the values pointed at by {bamboo.build.docker.image.id} for the previous runs?
There was a problem hiding this comment.
An example is maven:3.9.9-amazoncorretto-21, the default as seen on line 191;
It could be any other builder image tag. (Some other possible values)
This PR adds Bamboo Specs involving JDK 21 and 24 since those are the only ones have successful builds.
https://openmrs.atlassian.net/browse/CALC-58