Skip to content

Commit

Permalink
Update containerfile and wheels workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
alecandido committed Sep 20, 2022
1 parent c8a3511 commit 6ed0323
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 17 deletions.
18 changes: 17 additions & 1 deletion .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,28 @@ jobs:
container:
image: docker://ghcr.io/n3pdf/maturin:0.2.1
steps:
- name: Set Path
run: |
echo "PATH=${HOME}/local/bin:${HOME}/.cargo/bin:${PATH}" >> $GITHUB_ENV
- name: Clone repository
run: |
cd ${HOME}
# clone pineappl code
git clone https://github.com/N3PDF/pineappl.git
- name: Compile and Publish CLI wheels
working-directory: /home/pineappl
env:
HOME: /home/pineappl
run: |
cd ${HOME}/pineappl/pineappl_cli
maturin publish --skip-existing --username __token__ --password ${{ secrets.PYPI_TOKEN }} -F fktable --no-sdist
- name: Compile and Publish wheels
working-directory: /home/pineappl
env:
HOME: /home/pineappl
run: |
~/maturin publish --skip-existing --username __token__ --password ${{ secrets.PYPI_TOKEN }} --interpreter 3.7 3.8 3.9 3.10 pypy3.7
cd ${HOME}/pineappl/pineappl_py
maturin publish --skip-existing --username __token__ --password ${{ secrets.PYPI_TOKEN }} --interpreter 3.7 3.8 3.9 3.10 3.11 pypy3.7 pypy3.8 pypy 3.9
deploy-other:
strategy:
Expand Down
19 changes: 11 additions & 8 deletions pineappl_py/package/Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,20 @@ FROM quay.io/pypa/manylinux2014_x86_64

ARG MATURIN_TAR='maturin-x86_64-unknown-linux-musl.tar.gz'
ARG MATURIN_TAG='v0.13.0-beta.9'
ARG LHAPDF_URL='https://lhapdf.hepforge.org/downloads/?f='
ARG LHAPDF_TAG='LHAPDF-6.5.3'

# install c compiler
# and create a dedicated user
RUN /bin/bash -c "yum install gcc -y; \
useradd -m pineappl;\
su - pineappl"

USER pineappl
ARG USER=pineappl
USER ${USER}
ENV PATH=/home/${USER}/local/bin:/home/${USER}/.cargo/bin:${PATH}
ENV PKG_CONFIG_PATH=/home/${USER}/local/lib/pkgconfig:PKG_CONFIG_PATH
ENV LD_LIBRARY_PATH=/home/${USER}/local/lib:LD_LIBRARY_PATH

# install dependencies
# - rust
Expand All @@ -18,10 +24,7 @@ RUN /bin/bash -c "cd ${HOME}; \
mkdir -p local/bin; \
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y; \
curl --remote-name -L https://github.com/PyO3/maturin/releases/download/${MATURIN_TAG}/${MATURIN_TAR}; \
tar -xvzf ${MATURIN_TAR} --directory=local/bin/"

COPY maturin /home/pineappl

ENTRYPOINT ["/home/pineappl/maturin"]
# To minimize the size of the wheel use '--strip'
CMD ["build --release --interpreter 3.7 3.8 3.9 3.10 pypy3.7"]
tar -xvzf ${MATURIN_TAR} --directory=local/bin/; \
curl -L ${LHAPDF_URL}${LHAPDF_TAG}.tar.gz > LHAPDF.tar.gz; \
tar xvzf LHAPDF.tar.gz; \
cd ${LHAPDF_TAG}; ./configure --disable-python --prefix=${HOME}/local; make && make install"
8 changes: 0 additions & 8 deletions pineappl_py/package/maturin

This file was deleted.

0 comments on commit 6ed0323

Please sign in to comment.