|
9 | 9 | import boto3 |
10 | 10 | # import botocore.vendored.requests.packages.urllib3 as urllib3 |
11 | 11 |
|
| 12 | +from python_on_whales import docker as docker_whale |
12 | 13 |
|
13 | 14 | from biocontainersci.utils import send_github_pr_comment, send_status, BiocontainersCIException |
14 | 15 | from biocontainersci.biotools import Biotools |
@@ -213,6 +214,38 @@ def singularity(self, f): |
213 | 214 | def workdir(self): |
214 | 215 | return os.environ.get('GITHUB_WORKSPACE', os.getcwd()) |
215 | 216 |
|
| 217 | + def build_manifest(self, f): |
| 218 | + # We want to override the amd manifest with amd + arm |
| 219 | + # Start with dockerhub |
| 220 | + hub_manifest = None |
| 221 | + local_manifest = None |
| 222 | + |
| 223 | + if self.config['dockerhub']['username']: |
| 224 | + # Might need to login here |
| 225 | + hub_manifest = docker_whale.manifest.create( |
| 226 | + self.dockerhub_name(f), |
| 227 | + [self.dockerhub_name(f), self.dockerhub_name(f, is_arm=True)], |
| 228 | + amend=True |
| 229 | + ) |
| 230 | + |
| 231 | + # Now, local hub: |
| 232 | + if self.local_name(f): |
| 233 | + local_manifest = docker_whale.manifest.create( |
| 234 | + self.local_name(f), |
| 235 | + [self.local_name(f), self.local_name(f, is_arm=True)], |
| 236 | + amend=True |
| 237 | + ) |
| 238 | + |
| 239 | + if hub_manifest: |
| 240 | + docker_whale.manifest.push(hub_manifest) |
| 241 | + if local_manifest: |
| 242 | + docker_whale.manifest.push(local_manifest) |
| 243 | + |
| 244 | + if hub_manifest: |
| 245 | + docker_whale.manifest.remove(hub_manifest) |
| 246 | + if local_manifest: |
| 247 | + docker_whale.manifest.remove(local_manifest) |
| 248 | + |
216 | 249 | ''' |
217 | 250 | Execute minimal CI workflow for arm build |
218 | 251 | * build container |
|
0 commit comments