diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4e6179eca..6138a69fc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -86,6 +86,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GH_SEQERA_TOKEN }} - name: Delete build workspace + if: failure() run: | sudo rm -rf /home/runner/work/wave/wave/build-workspace diff --git a/VERSION b/VERSION index e59b644d6..6a126f402 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.7.5-A0 +1.7.5 diff --git a/changelog.txt b/changelog.txt index abba78a25..f6ad6e984 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,4 +1,7 @@ # Wave changelog +1.7.5 - 2 May 2024 +- Fix community repo naming normalisation [a9b12d76] + 1.7.4 - 30 Apr 2024 - Prevent use community registry w/o packages (2) [9eb11031] diff --git a/src/main/groovy/io/seqera/wave/configuration/BuildConfig.groovy b/src/main/groovy/io/seqera/wave/configuration/BuildConfig.groovy index a2b1ebea4..62ca17c05 100644 --- a/src/main/groovy/io/seqera/wave/configuration/BuildConfig.groovy +++ b/src/main/groovy/io/seqera/wave/configuration/BuildConfig.groovy @@ -78,6 +78,9 @@ class BuildConfig { @Value('${wave.build.compress-caching:true}') Boolean compressCaching = true + @Value('${wave.build.reserved-words:[]}') + Set reservedWords + @PostConstruct private void init() { log.debug("Builder config: " + diff --git a/src/main/groovy/io/seqera/wave/controller/ContainerController.groovy b/src/main/groovy/io/seqera/wave/controller/ContainerController.groovy index 78869288f..f9cbb14b9 100644 --- a/src/main/groovy/io/seqera/wave/controller/ContainerController.groovy +++ b/src/main/groovy/io/seqera/wave/controller/ContainerController.groovy @@ -260,6 +260,31 @@ class ContainerController { } } + protected String targetRepo(String repo, ImageNameStrategy strategy) { + assert repo, 'Missing default public repository setting' + // ignore everything that's not a public (community) repo + if( !buildConfig.defaultPublicRepository ) + return repo + if( !repo.startsWith(buildConfig.defaultPublicRepository)) + return repo + + // check if the repository does not ue any reserved word + final parts = repo.tokenize('/') + if( parts.size()>1 && buildConfig.reservedWords ) { + for( String it : parts[1..-1] ) { + if( buildConfig.reservedWords.contains(it) ) + throw new BadRequestException("Use of repository '$repo' is not allowed") + } + } + + // the repository is fully qualified use as it is + if( parts.size()>1 ) { + return repo + } + else + return repo + (!strategy || strategy==ImageNameStrategy.imageSuffix ? '/library' : '/library/build') + } + BuildRequest makeBuildRequest(SubmitContainerTokenRequest req, PlatformId identity, String ip) { if( !req.containerFile ) throw new BadRequestException("Missing dockerfile content") @@ -273,7 +298,9 @@ class ContainerController { final spackContent = spackFileFromRequest(req) final format = req.formatSingularity() ? SINGULARITY : DOCKER final platform = ContainerPlatform.of(req.containerPlatform) - final buildRepository = req.buildRepository ?: (req.freeze && buildConfig.defaultPublicRepository ? buildConfig.defaultPublicRepository : buildConfig.defaultBuildRepository) + final buildRepository = targetRepo( req.buildRepository ?: (req.freeze && buildConfig.defaultPublicRepository + ? buildConfig.defaultPublicRepository + : buildConfig.defaultBuildRepository), req.nameStrategy) final cacheRepository = req.cacheRepository ?: buildConfig.defaultCacheRepository final configJson = dockerAuthService.credentialsConfigJson(containerSpec, buildRepository, cacheRepository, identity) final containerConfig = req.freeze ? req.containerConfig : null @@ -281,7 +308,10 @@ class ContainerController { final scanId = scanEnabled && format==DOCKER ? LongRndKey.rndHex() : null final containerFile = spackContent ? prependBuilderTemplate(containerSpec,format) : containerSpec // use 'imageSuffix' strategy by default for public repo images - final nameStrategy = req.nameStrategy==null && buildRepository && buildConfig.defaultPublicRepository && buildRepository.startsWith(buildConfig.defaultPublicRepository) ? ImageNameStrategy.imageSuffix : null + final nameStrategy = req.nameStrategy==null + && buildRepository + && buildConfig.defaultPublicRepository + && buildRepository.startsWith(buildConfig.defaultPublicRepository) ? ImageNameStrategy.imageSuffix : null checkContainerSpec(containerSpec) diff --git a/src/main/groovy/io/seqera/wave/service/builder/ContainerBuildServiceImpl.groovy b/src/main/groovy/io/seqera/wave/service/builder/ContainerBuildServiceImpl.groovy index 655ed90ba..3f8369ca6 100644 --- a/src/main/groovy/io/seqera/wave/service/builder/ContainerBuildServiceImpl.groovy +++ b/src/main/groovy/io/seqera/wave/service/builder/ContainerBuildServiceImpl.groovy @@ -268,7 +268,10 @@ class ContainerBuildServiceImpl implements ContainerBuildService { final ret2 = buildStore.getBuild(request.targetImage) if( ret2 ) { log.info "== Hit build cache for request: $request" - return new BuildTrack(ret2.id, request.targetImage, true) + // note: mark as cached only if the build result is 'done' + // if the build is still in progress it should be marked as not cached + // so that the client will wait for the container completion + return new BuildTrack(ret2.id, request.targetImage, ret2.done()) } // invalid state throw new IllegalStateException("Unable to determine build status for '$request.targetImage'") diff --git a/src/main/groovy/io/seqera/wave/util/ContainerHelper.groovy b/src/main/groovy/io/seqera/wave/util/ContainerHelper.groovy index 7308d0f2d..0553c50ad 100644 --- a/src/main/groovy/io/seqera/wave/util/ContainerHelper.groovy +++ b/src/main/groovy/io/seqera/wave/util/ContainerHelper.groovy @@ -318,7 +318,7 @@ class ContainerHelper { throw new BadRequestException("Unsupported image naming strategy: '${nameStrategy}'") } - format==SINGULARITY ? "oras://${normaliseRepo(repo)}:${tag}" : "${normaliseRepo(repo)}:${tag}" + format==SINGULARITY ? "oras://${repo}:${tag}" : "${repo}:${tag}" } static protected String normalise0(String tag, int maxLength, String pattern) { @@ -357,20 +357,6 @@ class ContainerHelper { value ? normalise0(value.toLowerCase(), maxLength, /[^a-z0-9_.\-\/]/) : null } - static protected String normaliseRepo(String value) { - if( !value ) - return value - final parts = value.tokenize('/') - if( parts.size()>2 ) - return value - if( parts.size()==1 ) { - return parts[0] + '/library/build' - } - else { - return parts[0] + '/library/' + parts[1] - } - } - static String makeContainerId(String containerFile, String condaFile, String spackFile, ContainerPlatform platform, String repository, BuildContext buildContext) { final attrs = new LinkedHashMap(10) attrs.containerFile = containerFile diff --git a/src/main/resources/application-reserved-words.yml b/src/main/resources/application-reserved-words.yml new file mode 100644 index 000000000..f83b390f0 --- /dev/null +++ b/src/main/resources/application-reserved-words.yml @@ -0,0 +1,2164 @@ +wave: + build: + reserved-words : + - seqera + - seqera-labs + - seqeralabs + - seqera-io + - nextflow + - nextflow-io + - 2-girls-1-cup + - 2g1c + - _domainkey + - abbo + - abo + - abortion + - about + - about-us + - abuse + - access + - account + - accounts + - acrotomophilia + - ad + - add + - addict + - addicts + - admin + - administration + - administrator + - ads + - ads-txt + - adult + - advertise + - advertising + - aes128-ctr + - aes128-gcm + - aes192-ctr + - aes256-ctr + - aes256-gcm + - affiliate + - affiliates + - africa + - african + - ajax + - alabama-hot-pocket + - alaskan-pipeline + - alert + - alerts + - alla + - allah + - alligatorbait + - alpha + - amateur + - american + - amp + - anal + - analannie + - analsex + - analytics + - angie + - angry + - anilingus + - anus + - apeshit + - api + - app + - app-ads-txt + - apps + - arab + - arabs + - areola + - argie + - aroused + - arse + - arsehole + - asc + - asian + - ass + - assassin + - assassinate + - assassination + - assault + - assbagger + - assblaster + - assclown + - asscowboy + - asses + - assets + - assfuck + - assfucker + - asshat + - asshole + - assholes + - asshore + - assjockey + - asskiss + - asskisser + - assklown + - asslick + - asslicker + - asslover + - assman + - assmonkey + - assmunch + - assmuncher + - asspacker + - asspirate + - asspuppies + - assranger + - asswhore + - asswipe + - athletesfoot + - atom + - attack + - australian + - auth + - authentication + - authorize + - auto-erotic + - autoconfig + - autodiscover + - autoerotic + - avatar + - babe + - babeland + - babies + - baby-batter + - baby-juice + - backdoor + - backdoorman + - backseat + - backup + - badfuck + - ball-gag + - ball-gravy + - ball-kicking + - ball-licking + - ball-sack + - ball-sucking + - balllicker + - balls + - ballsack + - bangbros + - bangbus + - banging + - banner + - banners + - baptist + - bareback + - barely-legal + - barelylegal + - barenaked + - barf + - barface + - barfface + - bast + - bastard + - bastardo + - bastinado + - bazongas + - bazooms + - bbs + - bbw + - bdsm + - beaner + - beaners + - beast + - beastality + - beastial + - beastiality + - beat-off + - beatoff + - beatyourmeat + - beaver + - beaver-cleaver + - beaver-lips + - bestial + - bestiality + - beta + - bi + - bi-sexual + - biatch + - bible + - bicurious + - big-black + - big-breasts + - big-knockers + - big-tits + - bigass + - bigbastard + - bigbutt + - bigger + - billing + - billings + - bimbos + - birdlock + - bisexual + - bitch + - bitcher + - bitches + - bitchez + - bitchin + - bitching + - bitchslap + - bitchy + - biteme + - black + - black-cock + - blackman + - blackout + - blacks + - blind + - blog + - blogs + - blonde-action + - blonde-on-blonde-action + - blow + - blow-job + - blow-your-load + - blowjob + - blue-waffle + - blumpkin + - boang + - board + - bogan + - bohunk + - bollick + - bollock + - bollocks + - bomb + - bombers + - bombing + - bombs + - bomd + - bondage + - boner + - bong + - boob + - boobies + - boobs + - booby + - boody + - bookmark + - bookmarks + - boom + - boong + - boonga + - boonie + - booty + - booty-call + - bootycall + - bountybar + - bra + - brea5t + - breast + - breastjob + - breastlover + - breastman + - broadcasthost + - brothel + - brown-showers + - brunette-action + - build + - bugger + - buggered + - buggery + - bukkake + - bullcrap + - bulldike + - bulldyke + - bullet-vibe + - bullshit + - bumblefuck + - bumfuck + - bung-hole + - bunga + - bunghole + - buried + - burn + - business + - busty + - butchbabes + - butchdike + - butchdyke + - butt + - butt-bang + - butt-fuck + - butt-fucker + - butt-fuckers + - buttbang + - buttcheeks + - buttface + - buttfuck + - buttfucker + - buttfuckers + - butthead + - butthole + - buttman + - buttmunch + - buttmuncher + - buttpirate + - buttplug + - buttstain + - buy + - byatch + - cache + - cacker + - calendar + - camel-toe + - cameljockey + - cameltoe + - camgirl + - campaign + - camslut + - camwhore + - canadian + - cancer + - captcha + - careers + - carpet-muncher + - carpetmuncher + - carruth + - cart + - cas + - categories + - category + - catholic + - catholics + - cdn + - cemetery + - cgi + - cgi-bin + - chacha20-poly1305 + - change + - channel + - channels + - chart + - chat + - chav + - checkout + - cherrypopper + - chickslick + - children's + - chin + - chinaman + - chinamen + - chinese + - chink + - chinky + - choad + - chocolate-rosebuds + - chode + - christ + - christian + - church + - cialis + - cigarette + - cigs + - circlejerk + - clamdigger + - clamdiver + - clear + - cleveland-steamer + - client + - clit + - clitoris + - clogwog + - close + - cloud + - clover-clamps + - clusterfuck + - cms + - cocaine + - cock + - cockblock + - cockblocker + - cockcowboy + - cockfight + - cockhead + - cockknob + - cocklicker + - cocklover + - cocknob + - cockqueen + - cockrider + - cocks + - cocksman + - cocksmith + - cocksmoker + - cocksucer + - cocksuck + - cocksucked + - cocksucker + - cocksucking + - cocktail + - cocktease + - cocky + - cohee + - coitus + - color + - colored + - coloured + - com + - comment + - comments + - commie + - communist + - community + - compare + - compose + - condom + - config + - connect + - conservative + - conspiracy + - contact + - contest + - cookies + - coolie + - cooly + - coon + - coondog + - coons + - coprolagnia + - coprophilia + - copulate + - copy + - copyright + - cornhole + - corruption + - count + - cp + - cpanel + - cra5h + - crabs + - crack + - crack-whore + - crackpipe + - crackwhore + - crap + - crapola + - crapper + - crappy + - crash + - creampie + - creamy + - create + - crime + - crimes + - criminal + - criminals + - crossdomain-xml + - crotch + - crotchjockey + - crotchmonkey + - crotchrot + - css + - cum + - cumbubble + - cumfest + - cumjockey + - cumm + - cummer + - cumming + - cumquat + - cumqueen + - cumshot + - cumshots + - cunilingus + - cunillingus + - cunn + - cunnilingus + - cunntt + - cunt + - cunteyed + - cuntfuck + - cuntfucker + - cuntlick + - cuntlicker + - cuntlicking + - cuntsucker + - curve25519-sha256 + - customer + - customers + - customize + - cybersex + - cyberslimer + - dago + - dahmer + - dammit + - damn + - damnation + - damnit + - darkie + - darky + - dashboard + - date-rape + - daterape + - datnigga + - db + - dead + - deals + - deapthroat + - death + - debug + - deep-throat + - deepthroat + - defecate + - dego + - delete + - demon + - dendrophilia + - deposit + - desc + - desire + - destroy + - deth + - dev + - developer + - developers + - devil + - devilworshipper + - dick + - dickbrain + - dickforbrains + - dickhead + - dickless + - dicklick + - dicklicker + - dickman + - dickwad + - dickweed + - diddle + - die + - died + - dies + - diffie-hellman-group-exchange-sha256 + - diffie-hellman-group14-sha1 + - dike + - dildo + - dingleberries + - dingleberry + - dink + - dipshit + - dipstick + - dirty + - dirty-pillows + - dirty-sanchez + - disconnect + - discuss + - disease + - diseases + - disturbed + - dive + - dix + - dixiedike + - dixiedyke + - dns + - dns0 + - dns1 + - dns2 + - dns3 + - dns4 + - docs + - documentation + - dog-style + - doggie-style + - doggiestyle + - doggy-style + - doggystyle + - dolcett + - domain + - domination + - dominatrix + - dommes + - dong + - donkey-punch + - doo-doo + - doodoo + - doom + - dope + - double-dong + - double-penetration + - download + - downloads + - downvote + - dp-action + - draft + - dragqueen + - dragqween + - dripdick + - drop + - drug + - drunk + - drunken + - dry-hump + - dumb + - dumbass + - dumbbitch + - dumbfuck + - dvda + - dyefly + - dyke + - easyslut + - eat-my-ass + - eatballs + - eatme + - eatpussy + - ecchi + - ecdh-sha2-nistp256 + - ecdh-sha2-nistp384 + - ecdh-sha2-nistp521 + - ecstacy + - edit + - editor + - ejaculate + - ejaculated + - ejaculating + - ejaculation + - email + - enema + - enemy + - enterprise + - erect + - erection + - ero + - erotic + - erotism + - error + - errors + - escort + - ethiopian + - ethnic + - eunuch + - european + - event + - events + - evl + - example + - exception + - excrement + - execute + - executed + - execution + - executioner + - exit + - explore + - explosion + - export + - extensions + - facefucker + - faeces + - fag + - fagging + - faggot + - fagot + - failed + - failure + - fairies + - fairy + - faith + - false + - family + - fannyfucker + - faq + - faqs + - fart + - farted + - farting + - farty + - fastfuck + - fat + - fatah + - fatass + - fatfuck + - fatfucker + - fatso + - favicon-ico + - fckcum + - fear + - features + - fecal + - feces + - feed + - feedback + - feeds + - felatio + - felch + - felcher + - felching + - fellatio + - feltch + - feltcher + - feltching + - female-squirting + - femdom + - fetish + - figging + - fight + - file + - files + - filipina + - filipino + - filter + - fingerbang + - fingerfood + - fingerfuck + - fingerfucked + - fingerfucker + - fingerfuckers + - fingerfucking + - fingering + - fire + - firing + - fister + - fistfuck + - fistfucked + - fistfucker + - fistfucking + - fisting + - flange + - flasher + - flatulence + - floo + - flydie + - flydye + - fok + - follow + - follower + - followers + - following + - fondle + - fonts + - foot-fetish + - footaction + - footfuck + - footfucker + - footjob + - footlicker + - footstar + - fore + - foreskin + - forgot + - forgot-password + - forgotpassword + - form + - forms + - forni + - fornicate + - forum + - forums + - foursome + - fourtwenty + - fraud + - freakfuck + - freakyfucker + - freefuck + - friend + - friends + - frotting + - ftp + - fu + - fubar + - fuc + - fucck + - fuck + - fuck-buttons + - fucka + - fuckable + - fuckbag + - fuckbuddy + - fucked + - fuckedup + - fucker + - fuckers + - fuckface + - fuckfest + - fuckfreak + - fuckfriend + - fuckhead + - fuckher + - fuckin + - fuckina + - fucking + - fuckingbitch + - fuckinnuts + - fuckinright + - fuckit + - fuckknob + - fuckme + - fuckmehard + - fuckmonkey + - fuckoff + - fuckpig + - fucks + - fucktard + - fucktards + - fuckwhore + - fuckyou + - fudge-packer + - fudgepacker + - fugly + - fuk + - fuks + - funeral + - funfuck + - fungus + - futanari + - fuuck + - g-spot + - gang-bang + - gangbang + - gangbanged + - gangbanger + - gangsta + - gatorbait + - gay + - gay-sex + - gaymuthafuckinwhore + - gaysex + - geez + - geezer + - geni + - genital + - genitals + - german + - get + - getiton + - giant-cock + - gin + - ginzo + - gipp + - girl-on + - girl-on-top + - girls + - girls-gone-wild + - git + - givehead + - glazeddonut + - go + - goatcx + - goatse + - gob + - god + - god-damn + - godammit + - goddamit + - goddammit + - goddamn + - goddamned + - goddamnes + - goddamnit + - goddamnmuthafucker + - gokkun + - golden-shower + - goldenshower + - gonorrehea + - gonzagas + - goo-girl + - goodpoop + - gook + - goregasm + - gotohell + - goy + - goyim + - graphql + - greaseball + - gringo + - groe + - grope + - gross + - grostulation + - group + - group-sex + - groups + - gubba + - guest + - guidelines + - guides + - gummer + - gun + - guro + - gyp + - gypo + - gypp + - gyppie + - gyppo + - gyppy + - hamas + - hand-job + - handjob + - hapa + - hard-core + - hardcore + - harder + - hardon + - harem + - head + - header + - headfuck + - headlights + - hebe + - heeb + - hell + - help + - henhouse + - hentai + - heroin + - herpes + - heterosexual + - hide + - hijack + - hijacker + - hijacking + - hillbillies + - hindoo + - hiscock + - hitler + - hitlerism + - hitlerist + - hiv + - hmac-sha + - hmac-sha1 + - hmac-sha1-etm + - hmac-sha2-256 + - hmac-sha2-256-etm + - hmac-sha2-512 + - hmac-sha2-512-etm + - ho + - hobo + - hodgie + - hoes + - hole + - holestuffer + - home + - homicide + - homo + - homobangers + - homoerotic + - homosexual + - honger + - honk + - honkers + - honkey + - honky + - hook + - hooker + - hookers + - hooters + - hore + - hork + - horn + - horney + - horniest + - horny + - horseshit + - hosejob + - hoser + - host + - hostage + - hosting + - hostmaster + - hot-carl + - hot-chick + - hotdamn + - hotpussy + - hottotrot + - how-to-kill + - how-to-murder + - htaccess + - htpasswd + - http + - httpd + - https + - huge-fat + - humans-txt + - hummer + - humping + - husky + - hussy + - hustler + - hymen + - hymie + - iblowu + - icons + - idiot + - ikey + - illegal + - images + - imap + - img + - import + - incest + - index + - info + - insert + - insest + - intercourse + - interracial + - intheass + - inthebuff + - investors + - invitations + - invite + - invites + - invoice + - is + - isatap + - israel + - israel's + - israeli + - issues + - it + - italiano + - itch + - jack-off + - jackass + - jackoff + - jackshit + - jacktheripper + - jade + - jail-bait + - jailbait + - jap + - japanese + - japcrap + - jebus + - jeez + - jelly-donut + - jerk-off + - jerkoff + - jesus + - jesuschrist + - jew + - jewish + - jiga + - jigaboo + - jigg + - jigga + - jiggabo + - jiggaboo + - jigger + - jiggerboo + - jiggy + - jihad + - jijjiboo + - jimfish + - jism + - jiz + - jizim + - jizjuice + - jizm + - jizz + - jizzim + - jizzum + - jobs + - join + - joint + - js + - json + - juggalo + - juggs + - jugs + - junglebunny + - kaffer + - kaffir + - kaffre + - kafir + - kanake + - keybase-txt + - kid + - kigger + - kike + - kill + - killed + - killer + - killing + - kills + - kinbaku + - kink + - kinkster + - kinky + - kissass + - kkk + - knife + - knobbing + - knockers + - kock + - kondum + - koon + - kotex + - krap + - krappy + - kraut + - kum + - kumbubble + - kumbullbe + - kummer + - kumming + - kumquat + - kums + - kunilingus + - kunnilingus + - kunt + - ky + - kyke + - lactate + - laid + - lapdance + - latin + - learn + - leather-restraint + - leather-straight-jacket + - legal + - lemon-party + - lesbain + - lesbayn + - lesbian + - lesbin + - lesbo + - lez + - lezbe + - lezbefriends + - lezbo + - lezz + - lezzo + - liberal + - libido + - library + - license + - licensing + - licker + - lickme + - lies + - like + - limey + - limit + - limpdick + - limy + - lingerie + - liquor + - live + - livesex + - load + - loadedgun + - local + - localdomain + - localhost + - lock + - login + - logout + - lolita + - looser + - loser + - lost-password + - lotion + - lovebone + - lovegoo + - lovegun + - lovejuice + - lovemaking + - lovemuscle + - lovepistol + - loverocket + - lowlife + - lsd + - lubejob + - lucifer + - luckycammeltoe + - lugan + - lynch + - m + - macaca + - mad + - mafia + - magicwand + - mail + - mail0 + - mail1 + - mail2 + - mail3 + - mail4 + - mail5 + - mail6 + - mail7 + - mail8 + - mail9 + - mailer-daemon + - mailerdaemon + - make-me-come + - male-squirting + - mams + - manhater + - manpaste + - map + - marijuana + - marketing + - marketplace + - mastabate + - mastabater + - master + - masterbate + - masterblaster + - mastrabator + - masturbate + - masturbating + - masturbation + - mattressprincess + - me + - meatbeatter + - meatrack + - media + - member + - members + - menage-a-trois + - message + - messages + - meth + - metrics + - mexican + - mgger + - mggor + - mickeyfinn + - mideast + - milf + - minority + - mis + - missionary-position + - mobile + - mockey + - mockie + - mocky + - moderator + - modify + - mofo + - moky + - moles + - molest + - molestation + - molester + - molestor + - moneyshot + - mong + - mooncricket + - more + - mormon + - moron + - moslem + - mosshead + - mothafuck + - mothafucka + - mothafuckaz + - mothafucked + - mothafucker + - mothafuckin + - mothafucking + - mothafuckings + - motherfuck + - motherfucked + - motherfucker + - motherfuckin + - motherfucking + - motherfuckings + - motherlovebone + - mound-of-venus + - mr-hands + - muff + - muff-diver + - muffdive + - muffdiver + - muffdiving + - muffindiver + - mufflikcer + - mulatto + - muncher + - munt + - murder + - murderer + - muslim + - mx + - mx1 + - my + - naked + - nambla + - narcotic + - nasty + - nastybitch + - nastyho + - nastyslut + - nastywhore + - nawashi + - nazi + - necro + - negro + - negro's + - negroes + - negroid + - neonazi + - net + - network + - new + - news + - newsletter + - newsletters + - next + - nextflow + - nig + - nig-nog + - niger + - nigerian + - nigerians + - nigg + - nigga + - niggah + - niggaracci + - niggard + - niggard's + - niggarded + - niggarding + - niggardliness + - niggardliness's + - niggardly + - niggards + - niggaz + - nigger + - nigger's + - niggerhead + - niggerhole + - niggers + - niggle + - niggled + - niggles + - niggling + - nigglings + - niggor + - niggur + - niglet + - nignog + - nigr + - nigra + - nigre + - nil + - nimphomania + - nip + - nipple + - nipplering + - nipples + - nittit + - nlgger + - nlggor + - no-reply + - nobody + - noc + - nofuckingway + - none + - nook + - nookey + - nookie + - noonan + - nooner + - noreply + - notification + - notifications + - ns + - ns0 + - ns1 + - ns2 + - ns3 + - ns4 + - ns5 + - ns6 + - ns7 + - ns8 + - ns9 + - nsfw + - nsfw-images + - nude + - nudger + - nudity + - nuke + - null + - nutfucker + - nutten + - nymph + - nympho + - nymphomania + - oauth + - oauth2 + - octopussy + - offer + - offers + - omorashi + - one-cup-two-girls + - one-guy-one-jar + - online + - ontherag + - openid + - oral + - order + - orders + - orga + - orgasim + - orgasm + - orgies + - orgy + - osama + - overview + - owa + - owner + - paedophile + - page + - pages + - paki + - palesimian + - palestinian + - pansies + - pansy + - panti + - panties + - panty + - partners + - passwd + - password + - pay + - payment + - payments + - payo + - paypal + - pearlnecklace + - peck + - pecker + - peckerwood + - pedobear + - pedophile + - pee + - pee-pee + - peehole + - peepshow + - peepshpw + - pegging + - pendy + - penetration + - peni5 + - penile + - penis + - penises + - penthouse + - period + - perv + - phone-sex + - phonesex + - photo + - photos + - phuk + - phuked + - phuking + - phukked + - phukking + - phungky + - phuq + - pi55 + - picaninny + - piccaninny + - pickaninny + - piece-of-shit + - piker + - pikey + - piky + - pimp + - pimped + - pimper + - pimpjuic + - pimpjuice + - pimpsimp + - pindick + - piss + - piss-pig + - pissed + - pisser + - pisses + - pisshead + - pissin + - pissing + - pissoff + - pisspig + - pistol + - pixel + - pixie + - pixy + - plans + - playboy + - playgirl + - pleasure-chest + - plugins + - pocha + - pocho + - pocketpool + - pohm + - polack + - pole-smoker + - policies + - policy + - pom + - pommie + - pommy + - ponyplay + - poo + - poof + - poon + - poontang + - poop + - poop-chute + - poopchute + - pooper + - pooperscooper + - pooping + - poorwhitetrash + - pop + - pop3 + - popimp + - popular + - porchmonkey + - porn + - pornflick + - pornking + - porno + - pornography + - pornprincess + - portal + - portfolio + - post + - postfix + - postmaster + - pot + - poverty + - poweruser + - preferences + - premature + - premium + - press + - previous + - pric + - pricing + - prick + - prickhead + - primetime + - prince-albert-piercing + - print + - privacy + - privacy-policy + - private + - prod + - product + - production + - profile + - profiles + - project + - projects + - promo + - propaganda + - pros + - prostitute + - protestant + - pthc + - pu55i + - pu55y + - pube + - pubes + - pubic + - pubiclice + - public + - pud + - pudboy + - pudd + - puddboy + - puke + - punany + - puntang + - purchase + - purinapricness + - puss + - pussie + - pussies + - pussy + - pussycat + - pussyeater + - pussyfucker + - pussylicker + - pussylips + - pussylover + - pussypounder + - pusy + - put + - quashie + - queaf + - queef + - queer + - quickie + - quim + - quota + - ra8s + - rabbi + - racial + - racist + - radical + - radicals + - raghead + - raging-boner + - randy + - rape + - raped + - raper + - raping + - rapist + - rearend + - rearentry + - rectum + - redirect + - redlight + - redneck + - reduce + - reefer + - reestie + - refugee + - refund + - refunds + - register + - registration + - reject + - remains + - remove + - rentafuck + - replies + - reply + - report + - republican + - request + - request-password + - rere + - reset + - reset-password + - response + - retard + - retarded + - return + - returns + - reverse-cowgirl + - review + - reviews + - ribbed + - rigger + - rimjob + - rimming + - roach + - robber + - robots-txt + - root + - rootuser + - rosy-palm + - rosy-palm-and-her-5-sisters + - roundeye + - rsa-sha2-2 + - rsa-sha2-512 + - rss + - rules + - rump + - russki + - russkie + - rusty-trombone + - s&m + - sadis + - sadism + - sadom + - sales + - samckdaddy + - sandm + - sandnigger + - santorum + - satan + - save + - scag + - scallywag + - scat + - schlong + - scissoring + - screw + - screwyou + - script + - scrotum + - scum + - sdk + - search + - secure + - security + - select + - semen + - seppo + - seqera + - servant + - services + - session + - sessions + - settings + - setup + - sex + - sexcam + - sexed + - sexfarm + - sexhound + - sexhouse + - sexing + - sexkitten + - sexo + - sexpot + - sexslave + - sextogo + - sextoy + - sextoys + - sexual + - sexuality + - sexually + - sexwhore + - sexy + - sexy-slim + - sexymoma + - shag + - shaggin + - shagging + - share + - shat + - shav + - shaved-beaver + - shaved-pussy + - shawtypimp + - sheeney + - shemale + - shhit + - shibari + - shift + - shinola + - shit + - shitblimp + - shitcan + - shitdick + - shite + - shiteater + - shited + - shitface + - shitfaced + - shitfit + - shitforbrains + - shitfuck + - shitfucker + - shitfull + - shithapens + - shithappens + - shithead + - shithouse + - shiting + - shitlist + - shitola + - shitoutofluck + - shits + - shitstain + - shitted + - shitter + - shitting + - shitty + - shoot + - shooting + - shop + - shortfuck + - shota + - showtime + - shrimping + - sick + - signin + - signup + - sissy + - site + - sitemap + - sites + - sixsixsix + - sixtynine + - sixtyniner + - skank + - skankbitch + - skankfuck + - skankwhore + - skanky + - skankybitch + - skankywhore + - skeet + - skinflute + - skum + - skumbag + - slant + - slanteye + - slapper + - slaughter + - slav + - slave + - slavedriver + - sleezebag + - sleezeball + - slideitin + - slime + - slimeball + - slimebucket + - slopehead + - slopey + - slopy + - slut + - sluts + - slutt + - slutting + - slutty + - slutwear + - slutwhore + - smack + - smackthemonkey + - smtp + - smut + - snatch + - snatchpatch + - snigger + - snigger's + - sniggered + - sniggering + - sniggers + - sniper + - snot + - snowback + - snowballing + - snownigger + - sob + - sodom + - sodomise + - sodomite + - sodomize + - sodomy + - sonofabitch + - sonofbitch + - sooty + - sort + - sos + - source + - soviet + - spaghettibender + - spaghettinigger + - spank + - spankthemonkey + - spastic + - sperm + - spermacide + - spermbag + - spermhearder + - spermherder + - spic + - spick + - spig + - spigotty + - spik + - spit + - spitter + - splittail + - splooge + - splooge-moose + - spooge + - spread-legs + - spreadeagle + - spunk + - spunky + - sql + - squaw + - ssh + - ssh-rsa + - ssl + - ssladmin + - ssladministrator + - sslwebmaster + - stage + - stagg + - staging + - stat + - static + - statistics + - stats + - status + - stiffy + - store + - strap-on + - strapon + - strappado + - stringer + - strip-club + - stripclub + - stroke + - stroking + - stupid + - stupidfuck + - stupidfucker + - style + - style-doggy + - styles + - stylesheet + - stylesheets + - subdomain + - subscribe + - suck + - suckdick + - sucker + - suckme + - suckmyass + - suckmydick + - suckmytit + - suckoff + - sucks + - sudo + - suicide + - suicide-girls + - sultry-women + - super + - superuser + - support + - survey + - swallow + - swallower + - swalow + - swastika + - sweetness + - swinger + - sync + - syphilis + - sysadmin + - system + - tablet + - taboo + - taff + - tag + - tags + - tainted-love + - tampon + - tang + - tantra + - tarbaby + - tard + - taste-my + - tea-bagging + - team + - teat + - telnet + - terms + - terms-of-use + - terror + - terrorist + - test + - teste + - testicle + - testicles + - testimonials + - theme + - themes + - thicklips + - thirdeye + - thirdleg + - threesome + - threeway + - throating + - thumbzilla + - tied-up + - tight-white + - timbernigger + - tinkle + - tit + - titbitnipply + - titfuck + - titfucker + - titfuckin + - titjob + - titlicker + - titlover + - tits + - tittie + - titties + - titty + - tnt + - today + - toilet + - tongethruster + - tongue + - tongue-in-a + - tonguethrust + - tonguetramp + - tools + - topic + - topics + - topless + - tortur + - torture + - tosser + - tour + - towelhead + - tower + - trailertrash + - training + - tramp + - trannie + - tranny + - transexual + - translate + - translations + - transsexual + - transvestite + - trending + - trial + - tribadism + - triplex + - trisexual + - trojan + - trots + - true + - tub-girl + - tubgirl + - tuckahoe + - tunneloflove + - turd + - turnon + - tushy + - twat + - twink + - twinkie + - two-girls-one-cup + - twobitwhore + - uck + - uk + - umac-128 + - umac-128-etm + - umac-64 + - umac-64-etm + - undefined + - undressing + - unfollow + - unfuckable + - unlike + - unsubscribe + - update + - upgrade + - upskirt + - uptheass + - upthebutt + - urethra-play + - urinary + - urinate + - urine + - urophilia + - usama + - usenet + - user + - username + - users + - uterus + - uucp + - vagina + - vaginal + - var + - vatican + - venus-mound + - verify + - viagra + - vibr + - vibrater + - vibrator + - video + - vietcong + - view + - violence + - violet-wand + - virgin + - virginbreaker + - void + - vomit + - vorarephilia + - vote + - voyeur + - voyeurweb + - voyuer + - vpn + - vulva + - wab + - wank + - wanker + - wanking + - waysted + - weapon + - webmail + - webmaster + - website + - weenie + - weewee + - welcher + - welfare + - well-known + - wet-dream + - wetb + - wetback + - wetspot + - whacker + - whash + - whigger + - whiskey + - whiskeydick + - whiskydick + - whit + - white-power + - whitenigger + - whites + - whitetrash + - whitey + - whiz + - whop + - whore + - whorefucker + - whorehouse + - widget + - widgets + - wigger + - wiki + - willie + - williewanker + - willy + - wn + - wog + - women's + - wop + - worldsex + - wpad + - wrapping-men + - wrinkled-starfish + - write + - wtf + - wuss + - wuzzie + - www + - www-data + - www1 + - www2 + - www3 + - www4 + - xtc + - xx + - xxx + - yankee + - yaoi + - yellow-showers + - yellowman + - yiffy + - you + - yourname + - yourusername + - zigabo + - zipperhead + - zlib + - zoophilia diff --git a/src/test/groovy/io/seqera/wave/controller/ContainerControllerTest.groovy b/src/test/groovy/io/seqera/wave/controller/ContainerControllerTest.groovy index e6fe2fe50..17d2baf39 100644 --- a/src/test/groovy/io/seqera/wave/controller/ContainerControllerTest.groovy +++ b/src/test/groovy/io/seqera/wave/controller/ContainerControllerTest.groovy @@ -19,6 +19,7 @@ package io.seqera.wave.controller import spock.lang.Specification +import spock.lang.Unroll import java.time.Instant import java.time.temporal.ChronoUnit @@ -31,6 +32,7 @@ import io.micronaut.http.client.annotation.Client import io.micronaut.http.server.util.HttpClientAddressResolver import io.micronaut.test.extensions.spock.annotation.MicronautTest import io.seqera.wave.api.ContainerConfig +import io.seqera.wave.api.ImageNameStrategy import io.seqera.wave.api.PackagesSpec import io.seqera.wave.api.SubmitContainerTokenRequest import io.seqera.wave.api.SubmitContainerTokenResponse @@ -193,7 +195,7 @@ class ContainerControllerTest extends Specification { and: data.containerFile == DOCKER data.identity.userId == 100 - data.containerImage == 'wave/library/build:be9ee6ac1eeff4b5' + data.containerImage == 'wave/build:be9ee6ac1eeff4b5' data.containerConfig == cfg data.platform.toString() == 'linux/arm64' } @@ -222,7 +224,7 @@ class ContainerControllerTest extends Specification { and: data.containerFile == DOCKER data.identity.userId == 100 - data.containerImage == 'wave/library/build:be9ee6ac1eeff4b5' + data.containerImage == 'wave/build:be9ee6ac1eeff4b5' data.containerConfig == cfg data.platform.toString() == 'linux/arm64' } @@ -238,7 +240,7 @@ class ContainerControllerTest extends Specification { then: build.containerId =~ /7efaa2ed59c58a16/ build.containerFile == 'FROM foo' - build.targetImage == 'wave/library/build:7efaa2ed59c58a16' + build.targetImage == 'wave/build:7efaa2ed59c58a16' build.platform == ContainerPlatform.of('amd64') when: @@ -247,7 +249,7 @@ class ContainerControllerTest extends Specification { then: build.containerId =~ /7efaa2ed59c58a16/ build.containerFile == 'FROM foo' - build.targetImage == 'wave/library/build:7efaa2ed59c58a16' + build.targetImage == 'wave/build:7efaa2ed59c58a16' build.platform == ContainerPlatform.of('amd64') // using 'arm' platform changes the id @@ -257,7 +259,7 @@ class ContainerControllerTest extends Specification { then: build.containerId =~ /be9ee6ac1eeff4b5/ build.containerFile == 'FROM foo' - build.targetImage == 'wave/library/build:be9ee6ac1eeff4b5' + build.targetImage == 'wave/build:be9ee6ac1eeff4b5' build.platform == ContainerPlatform.of('arm64') when: @@ -267,7 +269,7 @@ class ContainerControllerTest extends Specification { build.containerId =~ /c6dac2e544419f71/ build.containerFile == 'FROM foo' build.condaFile == 'some::conda-recipe' - build.targetImage == 'wave/library/build:c6dac2e544419f71' + build.targetImage == 'wave/build:c6dac2e544419f71' build.platform == ContainerPlatform.of('arm64') when: @@ -279,7 +281,7 @@ class ContainerControllerTest extends Specification { build.containerFile.startsWith('# Builder image\n') build.condaFile == null build.spackFile == 'some::spack-recipe' - build.targetImage == 'wave/library/build:b7d730d274d1e057' + build.targetImage == 'wave/build:b7d730d274d1e057' build.platform == ContainerPlatform.of('arm64') } @@ -557,4 +559,67 @@ class ContainerControllerTest extends Specification { e.message == "Attribute `packages` is not allowed" } + @Unroll + def 'should normalise community repo' () { + given: + def config = new BuildConfig(defaultPublicRepository: PUBLIC, reservedWords: ['build','library'] as Set) + def controller = new ContainerController(buildConfig: config) + expect: + controller.targetRepo(REPO, STRATEGY) == EXPECTED + + where: + REPO | STRATEGY | PUBLIC | EXPECTED + 'foo.com/alpha' | null | 'foo.com' | 'foo.com/alpha' + 'foo.com/alpha' | ImageNameStrategy.imageSuffix | 'foo.com' | 'foo.com/alpha' + 'foo.com/alpha' | ImageNameStrategy.tagPrefix | 'foo.com' | 'foo.com/alpha' + and: + 'foo.com/alpha/beta'| null | 'foo.com' | 'foo.com/alpha/beta' + 'foo.com/alpha/beta'| ImageNameStrategy.imageSuffix | 'foo.com' | 'foo.com/alpha/beta' + 'foo.com/alpha/beta'| ImageNameStrategy.tagPrefix | 'foo.com' | 'foo.com/alpha/beta' + and: + 'foo.com' | null | 'foo.com' | 'foo.com/library' + 'foo.com' | ImageNameStrategy.imageSuffix | 'foo.com' | 'foo.com/library' + 'foo.com' | ImageNameStrategy.tagPrefix | 'foo.com' | 'foo.com/library/build' + and: + 'foo.com' | null | null | 'foo.com' + 'foo.com/alpha' | null | null | 'foo.com/alpha' + 'foo.com/alpha' | ImageNameStrategy.imageSuffix | null | 'foo.com/alpha' + 'foo.com/alpha' | ImageNameStrategy.tagPrefix | null | 'foo.com/alpha' + 'foo.com/a/b/c' | null | 'this.com' | 'foo.com/a/b/c' + + } + + def 'should not allow reserved words' () { + given: + def config = new BuildConfig(defaultPublicRepository: 'foo.com', reservedWords: ['build','library'] as Set) + def controller = new ContainerController(buildConfig: config) + + when: + controller.targetRepo('foo.com/library', null) + then: + def e = thrown(BadRequestException) + e.message == "Use of repository 'foo.com/library' is not allowed" + + when: + controller.targetRepo('foo.com/build', null) + then: + e = thrown(BadRequestException) + e.message == "Use of repository 'foo.com/build' is not allowed" + + when: + controller.targetRepo('foo.com/bar/build', null) + then: + e = thrown(BadRequestException) + e.message == "Use of repository 'foo.com/bar/build' is not allowed" + + when: + controller.targetRepo('foo.com/ok', null) + then: + noExceptionThrown() + + when: + controller.targetRepo('bar.com/build', null) + then: + noExceptionThrown() + } } diff --git a/src/test/groovy/io/seqera/wave/service/builder/BuildRequestTest.groovy b/src/test/groovy/io/seqera/wave/service/builder/BuildRequestTest.groovy index 5d769f254..bee4d8468 100644 --- a/src/test/groovy/io/seqera/wave/service/builder/BuildRequestTest.groovy +++ b/src/test/groovy/io/seqera/wave/service/builder/BuildRequestTest.groovy @@ -75,7 +75,7 @@ class BuildRequestTest extends Specification { then: req.containerId == '181ec22b26ae6d04' - req.targetImage == "docker.io/library/wave:${req.containerId}" + req.targetImage == "docker.io/wave:${req.containerId}" req.containerFile == CONTENT req.identity == USER req.configJson == '{"config":"json"}' @@ -122,7 +122,7 @@ class BuildRequestTest extends Specification { ) then: req.containerId == '8026e3a63b5c863f' - req.targetImage == 'docker.io/library/wave:samtools-1.0--8026e3a63b5c863f' + req.targetImage == 'docker.io/wave:samtools-1.0--8026e3a63b5c863f' req.condaFile == CONDA_RECIPE req.spackFile == null and: @@ -157,7 +157,7 @@ class BuildRequestTest extends Specification { ) then: req.containerId == '8726782b1d9bb8fb' - req.targetImage == 'docker.io/library/wave:bwa-0.7.15--8726782b1d9bb8fb' + req.targetImage == 'docker.io/wave:bwa-0.7.15--8726782b1d9bb8fb' req.spackFile == SPACK_RECIPE req.condaFile == null and: @@ -201,7 +201,7 @@ class BuildRequestTest extends Specification { ) then: req.containerId == 'd78ba9cb01188668' - req.targetImage == "oras://docker.io/library/wave:${req.containerId}" + req.targetImage == "oras://docker.io/wave:${req.containerId}" req.containerFile == CONTENT req.identity == USER req.configJson == '{"config":"json"}' diff --git a/src/test/groovy/io/seqera/wave/util/ContainerHelperTest.groovy b/src/test/groovy/io/seqera/wave/util/ContainerHelperTest.groovy index 688282094..a9d3746d6 100644 --- a/src/test/groovy/io/seqera/wave/util/ContainerHelperTest.groovy +++ b/src/test/groovy/io/seqera/wave/util/ContainerHelperTest.groovy @@ -545,21 +545,6 @@ class ContainerHelperTest extends Specification { '._-xyz._-' | 'xyz' } - @Unroll - def 'should normalise repo' () { - expect: - ContainerHelper.normaliseRepo(REPO) == EXPECTED - where: - REPO | EXPECTED - null | null - 'docker.io/a/b' | 'docker.io/a/b' - 'docker.io/a/b/c' | 'docker.io/a/b/c' - 'docker.io/foo' | 'docker.io/library/foo' - 'docker.io/foo/' | 'docker.io/library/foo' - 'docker.io' | 'docker.io/library/build' - 'docker.io/' | 'docker.io/library/build' - } - def 'should make request target' () { expect: ContainerHelper.makeTargetImage(BuildFormat.DOCKER, 'quay.io/org/name', '12345', null, null, null) @@ -621,51 +606,42 @@ class ContainerHelperTest extends Specification { where: FORMAT | REPO | ID | CONDA | SPACK | STRATEGY | EXPECTED - 'DOCKER' | 'foo.com/a/b' | '123' | null | null | null | 'foo.com/a/b:123' - 'DOCKER' | 'foo.com/a/b' | '123' | null | null | 'none' | 'foo.com/a/b:123' - 'DOCKER' | 'foo.com/a/b' | '123' | null | null | 'tagPrefix' | 'foo.com/a/b:123' - 'DOCKER' | 'foo.com/a/b' | '123' | null | null | 'imageSuffix' | 'foo.com/a/b:123' - 'DOCKER' | 'foo.com' | '123' | null | null | 'imageSuffix' | 'foo.com/library/build:123' + 'DOCKER' | 'foo.com/build' | '123' | null | null | null | 'foo.com/build:123' + 'DOCKER' | 'foo.com/build' | '123' | null | null | 'none' | 'foo.com/build:123' + 'DOCKER' | 'foo.com/build' | '123' | null | null | 'tagPrefix' | 'foo.com/build:123' + 'DOCKER' | 'foo.com/build' | '123' | null | null | 'imageSuffix' | 'foo.com/build:123' and: - 'SINGULARITY' | 'foo.com/a/b' | '123' | null | null | null | 'oras://foo.com/a/b:123' - 'SINGULARITY' | 'foo.com/a/b' | '123' | null | null | 'none' | 'oras://foo.com/a/b:123' - 'SINGULARITY' | 'foo.com/a/b' | '123' | null | null | 'tagPrefix' | 'oras://foo.com/a/b:123' - 'SINGULARITY' | 'foo.com/a/b' | '123' | null | null | 'imageSuffix' | 'oras://foo.com/a/b:123' - 'SINGULARITY' | 'foo.com' | '123' | null | null | 'imageSuffix' | 'oras://foo.com/library/build:123' + 'SINGULARITY' | 'foo.com/build' | '123' | null | null | null | 'oras://foo.com/build:123' + 'SINGULARITY' | 'foo.com/build' | '123' | null | null | 'none' | 'oras://foo.com/build:123' + 'SINGULARITY' | 'foo.com/build' | '123' | null | null | 'tagPrefix' | 'oras://foo.com/build:123' + 'SINGULARITY' | 'foo.com/build' | '123' | null | null | 'imageSuffix' | 'oras://foo.com/build:123' and: - 'DOCKER' | 'foo.com/a/b' | '123' | CONDA1| null | null | 'foo.com/a/b:samtools-1.0--123' - 'DOCKER' | 'foo.com/a/b' | '123' | CONDA1| null | 'none' | 'foo.com/a/b:123' - 'DOCKER' | 'foo.com/a/b' | '123' | CONDA1| null | 'tagPrefix' | 'foo.com/a/b:samtools-1.0--123' - 'DOCKER' | 'foo.com/a/b' | '123' | CONDA1| null | 'imageSuffix' | 'foo.com/a/b/samtools:1.0--123' - 'DOCKER' | 'foo.com' | '123' | CONDA1| null | 'imageSuffix' | 'foo.com/library/samtools:1.0--123' - 'DOCKER' | 'foo.com/library' | '123' | CONDA1| null | 'imageSuffix' | 'foo.com/library/samtools:1.0--123' + 'DOCKER' | 'foo.com/build' | '123' | CONDA1| null | null | 'foo.com/build:samtools-1.0--123' + 'DOCKER' | 'foo.com/build' | '123' | CONDA1| null | 'none' | 'foo.com/build:123' + 'DOCKER' | 'foo.com/build' | '123' | CONDA1| null | 'tagPrefix' | 'foo.com/build:samtools-1.0--123' 'DOCKER' | 'foo.com/build' | '123' | CONDA1| null | 'imageSuffix' | 'foo.com/build/samtools:1.0--123' - and: - 'SINGULARITY' | 'foo.com/a/b' | '123' | CONDA1| null | null | 'oras://foo.com/a/b:samtools-1.0--123' - 'SINGULARITY' | 'foo.com/a/b' | '123' | CONDA1| null | 'none' | 'oras://foo.com/a/b:123' - 'SINGULARITY' | 'foo.com/a/b' | '123' | CONDA1| null | 'tagPrefix' | 'oras://foo.com/a/b:samtools-1.0--123' - 'SINGULARITY' | 'foo.com/a/b' | '123' | CONDA1| null | 'imageSuffix' | 'oras://foo.com/a/b/samtools:1.0--123' - 'SINGULARITY' | 'foo.com/library' | '123' | CONDA1| null | 'imageSuffix' | 'oras://foo.com/library/samtools:1.0--123' + 'SINGULARITY' | 'foo.com/build' | '123' | CONDA1| null | null | 'oras://foo.com/build:samtools-1.0--123' + 'SINGULARITY' | 'foo.com/build' | '123' | CONDA1| null | 'none' | 'oras://foo.com/build:123' + 'SINGULARITY' | 'foo.com/build' | '123' | CONDA1| null | 'tagPrefix' | 'oras://foo.com/build:samtools-1.0--123' 'SINGULARITY' | 'foo.com/build' | '123' | CONDA1| null | 'imageSuffix' | 'oras://foo.com/build/samtools:1.0--123' - and: - 'DOCKER' | 'foo.com/a/b' | '123' | CONDA2| null | null | 'foo.com/a/b:samtools-1.0_bamtools-2.0_multiqc-1.15--123' - 'DOCKER' | 'foo.com/a/b' | '123' | CONDA2| null | 'none' | 'foo.com/a/b:123' - 'DOCKER' | 'foo.com/a/b' | '123' | CONDA2| null | 'tagPrefix' | 'foo.com/a/b:samtools-1.0_bamtools-2.0_multiqc-1.15--123' - 'DOCKER' | 'foo.com/a/b' | '123' | CONDA2| null | 'imageSuffix' | 'foo.com/a/b/samtools_bamtools_multiqc:123' + 'DOCKER' | 'foo.com/build' | '123' | CONDA2| null | null | 'foo.com/build:samtools-1.0_bamtools-2.0_multiqc-1.15--123' + 'DOCKER' | 'foo.com/build' | '123' | CONDA2| null | 'none' | 'foo.com/build:123' + 'DOCKER' | 'foo.com/build' | '123' | CONDA2| null | 'tagPrefix' | 'foo.com/build:samtools-1.0_bamtools-2.0_multiqc-1.15--123' + 'DOCKER' | 'foo.com/build' | '123' | CONDA2| null | 'imageSuffix' | 'foo.com/build/samtools_bamtools_multiqc:123' and: - 'DOCKER' | 'foo.com/a/b' | '123' | null | SPACK1| null | 'foo.com/a/b:bwa-0.7.15--123' - 'DOCKER' | 'foo.com/a/b' | '123' | null | SPACK1| 'none' | 'foo.com/a/b:123' - 'DOCKER' | 'foo.com/a/b' | '123' | null | SPACK1| 'tagPrefix' | 'foo.com/a/b:bwa-0.7.15--123' - 'DOCKER' | 'foo.com/a/b' | '123' | null | SPACK1| 'imageSuffix' | 'foo.com/a/b/bwa:0.7.15--123' + 'DOCKER' | 'foo.com/build' | '123' | null | SPACK1| null | 'foo.com/build:bwa-0.7.15--123' + 'DOCKER' | 'foo.com/build' | '123' | null | SPACK1| 'none' | 'foo.com/build:123' + 'DOCKER' | 'foo.com/build' | '123' | null | SPACK1| 'tagPrefix' | 'foo.com/build:bwa-0.7.15--123' + 'DOCKER' | 'foo.com/build' | '123' | null | SPACK1| 'imageSuffix' | 'foo.com/build/bwa:0.7.15--123' and: - 'DOCKER' | 'foo.com/a/b' | '123' | null | SPACK2| null | 'foo.com/a/b:bwa-0.7.15_salmon-1.1.1--123' - 'DOCKER' | 'foo.com/a/b' | '123' | null | SPACK2| 'none' | 'foo.com/a/b:123' - 'DOCKER' | 'foo.com/a/b' | '123' | null | SPACK2| 'tagPrefix' | 'foo.com/a/b:bwa-0.7.15_salmon-1.1.1--123' - 'DOCKER' | 'foo.com/a/b' | '123' | null | SPACK2| 'imageSuffix' | 'foo.com/a/b/bwa_salmon:123' + 'DOCKER' | 'foo.com/build' | '123' | null | SPACK2| null | 'foo.com/build:bwa-0.7.15_salmon-1.1.1--123' + 'DOCKER' | 'foo.com/build' | '123' | null | SPACK2| 'none' | 'foo.com/build:123' + 'DOCKER' | 'foo.com/build' | '123' | null | SPACK2| 'tagPrefix' | 'foo.com/build:bwa-0.7.15_salmon-1.1.1--123' + 'DOCKER' | 'foo.com/build' | '123' | null | SPACK2| 'imageSuffix' | 'foo.com/build/bwa_salmon:123' } def 'should validate containerfile' () {