Skip to content

Commit

Permalink
Ignore URI dependencies in Conda envs when generating image hash (#786)
Browse files Browse the repository at this point in the history
Signed-off-by: munishchouhan <hrma017@gmail.com>
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
Co-authored-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
  • Loading branch information
munishchouhan and pditommaso authored Jan 27, 2025
1 parent 8a2e420 commit c097c8a
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/groovy/io/seqera/wave/util/ContainerHelper.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,9 @@ class ContainerHelper {
//strip `pip:` prefix
if( it.startsWith('pip:') && it.length()>4 && it[4]!=':')
it = it.substring(4)
// ignore http based dependencies
if( it.startsWith('https://') || it.startsWith('http://'))
continue
// strip channel prefix
final int p=it.indexOf('::')
if( p!=-1 )
Expand Down
32 changes: 32 additions & 0 deletions src/test/groovy/io/seqera/wave/util/ContainerHelperTest.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,27 @@ class ContainerHelperTest extends Specification {
- pandas==2.2.2
- numpy=1.0
'''.stripIndent(true)
@Shared def GIT1 = '''\
channels:
- bioconda
- conda-forge
dependencies:
- pip
- pip:
- "https://github.com/seqeralabs/seqera-kit/archive/dev.zip"
'''.stripIndent(true)
@Shared def GIT2 = '''\
channels:
- bioconda
- conda-forge
dependencies:
- bwa
- pip
- pip:
- "https://github.com/seqeralabs/seqera-kit/archive/dev.zip"
- "https://github.com/seqeralabs/seqera-kit/archive/dev2.zip"
- "https://github.com/seqeralabs/seqera-kit/archive/dev3.zip"
'''.stripIndent(true)

@Unroll
def 'should make request target with name strategy' () {
Expand Down Expand Up @@ -546,6 +567,16 @@ class ContainerHelperTest extends Specification {
'DOCKER' | 'foo.com/build' | '123' | PIP2 | 'tagPrefix' | 'foo.com/build:pip_pandas-2.2.2_numpy-1.0--123'
'DOCKER' | 'foo.com/build' | '123' | PIP2 | 'imageSuffix' | 'foo.com/build/pip_pandas_numpy:123'
'DOCKER' | 'foo.com/build' | '123' | PIP2 | 'none' | 'foo.com/build:123'
and:
'DOCKER' | 'foo.com/build' | '123' | GIT1 | null | 'foo.com/build:pip--123'
'DOCKER' | 'foo.com/build' | '123' | GIT1 | 'tagPrefix' | 'foo.com/build:pip--123'
'DOCKER' | 'foo.com/build' | '123' | GIT1 | 'imageSuffix' | 'foo.com/build/pip:123'
'DOCKER' | 'foo.com/build' | '123' | GIT1 | 'none' | 'foo.com/build:123'
and:
'DOCKER' | 'foo.com/build' | '123' | GIT2 | null | 'foo.com/build:bwa_pip--123'
'DOCKER' | 'foo.com/build' | '123' | GIT2 | 'tagPrefix' | 'foo.com/build:bwa_pip--123'
'DOCKER' | 'foo.com/build' | '123' | GIT2 | 'imageSuffix' | 'foo.com/build/bwa_pip:123'
'DOCKER' | 'foo.com/build' | '123' | GIT2 | 'none' | 'foo.com/build:123'

}

Expand All @@ -571,4 +602,5 @@ class ContainerHelperTest extends Specification {
thrown(BadRequestException)

}

}

0 comments on commit c097c8a

Please sign in to comment.