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

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open
Changes from 9 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
27 changes: 25 additions & 2 deletions src/main/groovy/io/seqera/wave/controller/ViewController.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,31 @@ class ViewController {
}
//add conda lock file when available
if( buildLogService && result.condaFile ) {
binding.build_conda_lock_data = buildLogService.fetchCondaLockString(result.buildId)
binding.build_conda_lock_url = "$serverUrl/v1alpha1/builds/${result.buildId}/condalock"
def condaLock = buildLogService.fetchCondaLockString(result.buildId)
def buildId = result.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 && condaLock.contains('cat environment.lock') ) {
condaLock = null //if there is no conda lock file, don't show the conda lock data
def builds = persistenceService.allBuilds(result.buildId.split('-')[1].split('_')[0])
for (def build : builds) {
if ( build.succeeded() ){
buildId = build.buildId
condaLock = buildLogService.fetchCondaLockString(build.buildId)
if ( !condaLock.contains('cat environment.lock') )
break
}
}
}

binding.build_conda_lock_data = condaLock
binding.build_conda_lock_url = "$serverUrl/v1alpha1/builds/${buildId}/condalock"
}
// result the main object
return binding
Expand Down