Skip to content

Making wheel#66

Open
shimwell wants to merge 129 commits intodevelopfrom
making-wheel
Open

Making wheel#66
shimwell wants to merge 129 commits intodevelopfrom
making-wheel

Conversation

@shimwell
Copy link
Owner

@shimwell shimwell commented Feb 3, 2025

No description provided.

@shimwell
Copy link
Owner Author

shimwell commented Feb 5, 2025

python package wheel can be built and tested on this PR using these commands from this branch

# build manylinux image
docker build -t openmc -f tools/ci/manylinux.dockerfile .
docker build --no-cache --build-arg Python_ABI=cp310-cp310 --build-arg=OPENMC_USE_DAGMC=ON -t openmc_wheel:python3.10 -f tools/ci/manylinux.dockerfile .
docker build --no-cache --build-arg Python_ABI=cp311-cp311 --build-arg=OPENMC_USE_DAGMC=ON -t openmc_wheel:python3.11 -f tools/ci/manylinux.dockerfile .
docker build --no-cache --build-arg Python_ABI=cp312-cp312 --build-arg=OPENMC_USE_DAGMC=ON -t openmc_wheel:python3.12 -f tools/ci/manylinux.dockerfile .

copy out the wheels
Create a container from the built image
Copy the wheel files from the container to the wheelhouse folder on host machine
Remove the container
Create a container from the built image
Copy the wheel files from the container to the wheelhouse folder on host machine
Remove the container

mkdir wheelhouse
docker create --name openmc_wheel_container_3.10 openmc_wheel:python3.10
docker cp openmc_wheel_container_3.10:/root/openmc/dist/. wheelhouse
docker rm openmc_wheel_container_3.10

docker create --name openmc_wheel_container_3.11 openmc_wheel:python3.11
docker cp openmc_wheel_container_3.11:/root/openmc/dist/. wheelhouse
docker rm openmc_wheel_container_3.11

docker create --name openmc_wheel_container_3.12 openmc_wheel:python3.12
docker cp openmc_wheel_container_3.12:/root/openmc/dist/. wheelhouse
docker rm openmc_wheel_container_3.12

docker image for testing resulting wheel called wheeltest.Dockerfile

FROM ubuntu:24.04
ARG python_version=3.12
ENV python_version_no_dot=${python_version//./}
RUN apt update -y && apt upgrade -y && \
    apt install -y software-properties-common && \
    add-apt-repository ppa:deadsnakes/ppa && \
    apt update -y && \
    apt install -y python${python_version} python${python_version}-venv python3-pip
RUN apt install libhdf5-dev -y
RUN python${python_version} -m venv openmc_venv
ENV PATH=/openmc_venv/bin:$PATH
COPY wheelhouse/openmc-0.15.1.dev0-cp${python_version_no_dot}-cp${python_version_no_dot}-manylinux_2_28_x86_64.whl .
RUN python${python_version} -m pip install openmc-0.15.1.dev0-cp${python_version_no_dot}-cp${python_version_no_dot}-manylinux_2_28_x86_64.whl
RUN python${python_version} -c "import openmc.lib"

### testing with generic model
COPY minimal_test.py .
COPY small_dagmc_file.h5m .
COPY cross_sections.xml .
COPY Li.h5 .
COPY Li7.h5 .
COPY small_um.vtk .
RUN apt install libxrender1 -y
RUN python${python_version} minimal_test.py

build the testing dockerfile

docker build -f wheeltest.Dockerfile --build-arg python_version=3.10 .
docker build -f wheeltest.Dockerfile --build-arg python_version=3.11 .
docker build -f wheeltest.Dockerfile --build-arg python_version=3.12 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants