Skip to content
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

Fixed Conda lockfile rendering in build view #727

Merged
merged 16 commits into from
Dec 15, 2024
Merged
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,27 @@ class BuildLogServiceImpl implements BuildLogService {
if( !logs ) return
try {
String condaLock = extractCondaLockFile(logs)
if (condaLock){
if ( condaLock ){
log.debug "Storing conda lock for buildId: $buildId"

/* When a container image is cached, dockerfile does not get executed.
In that case condalock file will contain "cat environment.lock" because its not been executed.
So wave will check the previous builds of that container image
and render the condalock file from latest successful build
and replace with the current build's condalock file.
*/
if( condaLock.contains('cat environment.lock') ){
log.info "Container Image is already cached, uploading previously successful build's condalock file for buildId: $buildId"
def builds = persistenceService.allBuilds(buildId.split('-')[1].split('_')[0])
for (def build : builds) {
if ( build.succeeded() ){
def curCondaLock = fetchCondaLockString(build.buildId)
if( curCondaLock && !curCondaLock.contains('cat environment.lock') ){
condaLock = curCondaLock
}
}
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's isolate this logic into a separate method, so it can be tested independently

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

final uploadRequest = UploadRequest.fromBytes(condaLock.bytes, condaLockKey(buildId))
objectStorageOperations.upload(uploadRequest)
}
Expand Down
Loading