Skip to content

Commit 7a73a17

Browse files
authored
Merge pull request #145 from FNNDSC/multi-arch-conda
Add build for ppc64le
2 parents 1d43e83 + 12716d5 commit 7a73a17

File tree

6 files changed

+2884
-21
lines changed

6 files changed

+2884
-21
lines changed

.dockerignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ __pycache__/
33

44
.dockerignore
55
Dockerfile
6+
prod.Dockerfile
67
.travis.yml
78
.gitignore
89
.github
@@ -11,6 +12,6 @@ LICENSE
1112
CHRIS_REMOTE_FS
1213
swift_storage
1314

14-
dist/
1515
.pixi/
16+
conda-specs/
1617

.github/workflows/ci.yml

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,22 @@ jobs:
3939
build:
4040
needs: [test-pfcon, test-cube]
4141
runs-on: ubuntu-24.04
42+
env:
43+
PIXI_COLOR: always
4244
steps:
43-
- uses: actions/checkout@v4
45+
- name: Checkout
46+
uses: actions/checkout@v4
47+
- name: Install micromamba
48+
uses: mamba-org/setup-micromamba@v2
49+
with:
50+
cache-downloads: true
4451
- name: Install pixi
45-
id: install-pixi
46-
if: startsWith(github.ref, 'refs/tags/v')
4752
uses: prefix-dev/[email protected]
4853
with:
4954
pixi-version: v0.38.0
5055
run-install: false
5156
- name: Set version
52-
if: steps.install-pixi.outcome == 'success'
57+
if: startsWith(github.ref, 'refs/tags/v')
5358
run: |
5459
ref_name='${{ github.ref_name }}'
5560
version_number="${ref_name:1}"
@@ -67,6 +72,23 @@ jobs:
6772
type=pep440,pattern={{version}}
6873
type=pep440,pattern={{major}}.{{minor}}
6974
type=raw,value=latest,enable={{is_default_branch}}
75+
76+
# pixi and micromamba don't have ppc64le images available, so to build
77+
# images for ppc64le, we create conda environments using micromamba
78+
# which are then copied into the container images. This also happens
79+
# to be more efficient than running a package manager during docker
80+
# build using QEMU.
81+
- name: Export conda-explicit-spec
82+
run: pixi project export conda-explicit-spec --frozen --ignore-pypi-errors conda-specs
83+
- name: Create env for linux/amd64
84+
run: micromamba create --platform linux-64 --relocate-prefix /opt/conda-env -f conda-specs/prod_linux-64_conda_spec.txt -p ./envs/linux/amd64
85+
- name: Create env for linux/arm64
86+
run: micromamba create --platform linux-aarch64 --relocate-prefix /opt/conda-env -f conda-specs/prod_linux-aarch64_conda_spec.txt -p ./envs/linux/arm64
87+
- name: Create env for linux/ppc64le
88+
run: micromamba create --platform linux-ppc64le --relocate-prefix /opt/conda-env -f conda-specs/prod_linux-ppc64le_conda_spec.txt -p ./envs/linux/ppc64le
89+
- name: Build wheel
90+
run: pixi run build
91+
7092
- uses: docker/setup-qemu-action@v3
7193
- uses: docker/setup-buildx-action@v3
7294
- name: Login to DockerHub
@@ -84,15 +106,13 @@ jobs:
84106
registry: ghcr.io
85107
username: ${{ github.repository_owner }}
86108
password: ${{ secrets.GITHUB_TOKEN }}
87-
88109
- name: Build and push
89110
uses: docker/build-push-action@v6
90111
with:
91-
build-args: ENVIRONMENT=prod
92112
push: ${{ steps.login-dockerhub.outcome == 'success' && steps.login-ghcr.outcome == 'success' }}
93113
context: .
94-
file: ./Dockerfile
95-
platforms: linux/amd64,linux/arm64
114+
file: ./prod.Dockerfile
115+
platforms: linux/amd64,linux/arm64,linux/ppc64le
96116
tags: ${{ steps.meta.outputs.tags }}
97117
labels: ${{ steps.meta.outputs.labels }}
98118
cache-from: type=gha

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,8 @@ swift_storage/
2121
# pixi environments
2222
.pixi
2323
*.egg-info
24+
25+
# build
26+
conda-specs/
27+
envs/
28+

0 commit comments

Comments
 (0)