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

Fixing issues with conda build #536

Merged
merged 5 commits into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
48 changes: 26 additions & 22 deletions .github/workflows/conda-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,18 @@ on:
branches: [ master ]
# Publish semver tags as releases.
tags: [ 'v*.*.*' ]

jobs:
conda-build-arm:
conda-build-arm64:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

# Setup for Multi-platform image
- name: Set up QEMU
Expand All @@ -27,7 +29,7 @@ jobs:
uses: docker/build-push-action@v4
with:
context: .
file: Dockerfile_arm_conda
file: scripts/Dockerfile_conda_build
platforms: linux/arm64
build-args: |
PYTHON_VERSION=${{ matrix.python-version }}
Expand All @@ -39,23 +41,25 @@ jobs:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

# Setup for Multi-platform image
- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Build and push Docker image arm64
uses: docker/build-push-action@v4
with:
python-version: ${{ matrix.python-version }}
- uses: s-weigand/setup-conda@v1
- run: |
export PYTHON_VERSION=${{ matrix.python-version }}
conda install conda-build anaconda-client
conda config --set anaconda_upload no
conda config --add channels conda-forge
export ANACONDA_API_TOKEN=${{ secrets.CONDA_TOKEN }}
PACKAGE_PATH=$(conda build . --python ${{ matrix.python-version }} --output)
conda build . --python ${{ matrix.python-version }}
if [ "${{ matrix.python-version }}" == "3.11" ]; then
anaconda -t $ANACONDA_API_TOKEN upload $PACKAGE_PATH --label main --label py3.11 --force
else
anaconda -t $ANACONDA_API_TOKEN upload $PACKAGE_PATH --label py${{ matrix.python-version }} --force
fi
context: .
file: scripts/Dockerfile_conda_build
platforms: linux/amd64
build-args: |
PYTHON_VERSION=${{ matrix.python-version }}
ANACONDA_API_TOKEN=${{ secrets.CONDA_TOKEN }}

12 changes: 9 additions & 3 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

# Setup for Multi-platform image
- name: Set up QEMU
Expand Down Expand Up @@ -125,7 +127,9 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

# Setup for Multi-platform image
- name: Set up QEMU
Expand Down Expand Up @@ -218,7 +222,9 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

# Setup for Multi-platform image
- name: Set up QEMU
Expand Down
33 changes: 0 additions & 33 deletions Dockerfile_arm_conda

This file was deleted.

27 changes: 27 additions & 0 deletions scripts/Dockerfile_conda_build
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FROM continuumio/miniconda3:latest
ADD . /mspass
ADD .git /mspass/.git
RUN mv /mspass /mspasspy_build && cd /mspasspy_build && git status

ARG PYTHON_VERSION
ARG TARGETARCH

ENV PATH /opt/conda/bin:$PATH
RUN apt-get update --fix-missing && \
apt-get install -y cmake wget bzip2 ca-certificates curl git && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

ARG ANACONDA_API_TOKEN

RUN cd /mspasspy_build \
&& conda install -y conda-build anaconda-client \
&& conda config --set anaconda_upload no \
&& conda config --add channels conda-forge \
&& export CONDA_BUILD_DEBUG=1 \
&& PACKAGE_PATH=$(conda build . --python ${PYTHON_VERSION} --output) \
&& conda build . --python ${PYTHON_VERSION} --debug \
&& if [ "$PYTHON_VERSION" == "3.11" ]; then \
anaconda -t $ANACONDA_API_TOKEN upload $PACKAGE_PATH --label main --label py${PYTHON_VERSION} --force ; \
else anaconda -t $ANACONDA_API_TOKEN upload $PACKAGE_PATH --label py${PYTHON_VERSION} --force ; fi

Loading