Skip to content

Commit

Permalink
Merge branch 'ci/update-dependencies' of github.com:SINTEF/dlite into…
Browse files Browse the repository at this point in the history
… ci/update-dependencies
  • Loading branch information
jesper-friis committed Sep 4, 2024
2 parents 6366e34 + 2e960ca commit 3cd780b
Show file tree
Hide file tree
Showing 10 changed files with 112 additions and 43 deletions.
35 changes: 29 additions & 6 deletions .github/docker/Dockerfile-manylinux.template
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ FROM quay.io/pypa/manylinux{{ TYPE }}_{{ ARCH }}:latest

ARG PY_MINORS="8 9 10 11 12"

COPY requirements_full.txt requirements_dev.txt /tmp/

{{ EXTRA_PRE }}

# Enable rpmfusion for additional packages
Expand All @@ -46,26 +48,47 @@ RUN \
https://mirrors.rpmfusion.org/free/el/rpmfusion-free-release-$(rpm --eval %{centos_ver}).noarch.rpm \
https://mirrors.rpmfusion.org/nonfree/el/rpmfusion-nonfree-release-$(rpm --eval %{centos_ver}).noarch.rpm && \
yum install -y \
swig \
redland-devel \
rasqal-devel \
swig \
libcurl-devel \
libxslt-devel \
libxml2-devel && \
libxml2-devel \
libffi-devel && \
# hdf5-devel is needed for building the hdf5 plugin
yum install -y hdf5-devel || true && \
# Unpack static libraries
# It's necessary to be in /opt/_internal because the internal libraries
# exist here.
cd /opt/_internal && \
tar -Jxvf static-libs-for-embedding-only.tar.xz && \
# Filter out challenging packages from requirements
sed \
-e '/mongomock/d' \
-i /tmp/requirements_dev.txt && \
sed \
-e '/pandas/d' \
-e '/pyarrow/d' \
-e '/tables/d' \
-e '/openpyxl/d' \
-e '/jinja2/d' \
-e '/pydantic/d' \
-e '/fortran-language-server/d' \
-e '/matplotlib/d' \
-e '/scikit-image/d' \
-e '/ncempy/d' \
-e '/h5py/d' \
-i /tmp/requirements_full.txt && \
# Install required Python packages
mkdir -p /ci/pip_cache && \
for minor in ${PY_MINORS}; do \
python3.${minor} -m pip install -U pip && \
python3.${minor} -m pip install -U setuptools wheel && \
python3.${minor} -m pip install -U --cache-dir /ci/pip_cache \
cmake oldest-supported-numpy; \
python3.${minor} -m pip install --cache-dir=/ci/pip_cache -U pip && \
python3.${minor} -m pip install --cache-dir=/ci/pip_cache \
-U setuptools wheel && \
python3.${minor} -m pip install --cache-dir=/ci/pip_cache \
oldest-supported-numpy \
-r /tmp/requirements_dev.txt \
-r /tmp/requirements_full.txt; \
done && \
rm -rf /ci/pip_cache

Expand Down
21 changes: 16 additions & 5 deletions .github/docker/Dockerfile-manylinux_x_y.template
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#
# cd dlite # cd to DLite root directory
# docker build -t dlite-manylinux \
# -f .github/docker/Dockerfile-manylinux_2_24_x86_64 .
# -f .github/docker/dockerfiles/Dockerfile-manylinux_2_24_x86_64 .
#
# Run (for debugging):
#
Expand All @@ -39,6 +39,8 @@ ARG PY_MINORS="8 9 10 11 12"

{{ EXTRA_PRE }}

COPY requirements_full.txt requirements_dev.txt /tmp/

# Enable rpmfusion for additional packages
RUN \
dnf update -y && \
Expand All @@ -58,13 +60,22 @@ RUN \
# exist here.
cd /opt/_internal && \
tar -Jxvf static-libs-for-embedding-only.tar.xz && \
# Filter out challenging packages from requirements_full.txt
#sed \
# -e '/pyarrow/d' \
# -e '/tables/d' \
# -e '/scikit-image/d' \
# -i /tmp/requirements_full.txt && \
# Install required Python packages
mkdir -p /ci/pip_cache && \
for minor in ${PY_MINORS}; do \
python3.${minor} -m pip install -U pip && \
python3.${minor} -m pip install -U setuptools wheel && \
python3.${minor} -m pip install -U --cache-dir /ci/pip_cache \
cmake oldest-supported-numpy; \
python3.${minor} -m pip install --cache-dir=/ci/pip_cache -U pip && \
python3.${minor} -m pip install --cache-dir=/ci/pip_cache \
-U setuptools wheel && \
python3.${minor} -m pip install --cache-dir=/ci/pip_cache \
oldest-supported-numpy \
-r /tmp/requirements_dev.txt \
-r /tmp/requirements_full.txt; \
done && \
rm -rf /ci/pip_cache

Expand Down
51 changes: 35 additions & 16 deletions .github/docker/Dockerfile-musllinux.template
Original file line number Diff line number Diff line change
Expand Up @@ -34,33 +34,52 @@ FROM quay.io/pypa/musllinux{{ TYPE }}_{{ ARCH }}:latest

ARG PY_MINORS="8 9 10 11 12"

COPY requirements_full.txt requirements_dev.txt /tmp/

{{ EXTRA_PRE }}

# Do not use distutils distributed with setuptools
# This is due to base changes in the distutils API, removing msvccompiler,
# which is necessary for building the numpy wheel.
ENV SETUPTOOLS_USE_DISTUTILS="stdlib"

RUN apk add -u \
redland \
rasqal \
hdf5-dev \
openssl-dev \
swig && \
RUN \
apk add -u \
redland-dev \
rasqal-dev \
hdf5-dev \
openssl-dev \
openblas-dev \
swig && \
# Unpack static libraries
# It's necessary to be in /opt/_internal because the internal libraries
# exist here.
cd /opt/_internal && \
tar -Jxvf static-libs-for-embedding-only.tar.xz && \
# Filter minor versions
minors=$( for n in $PY_MINORS; do \
if [ $(uname -m) == "i686" -o $n -lt 12 ]; then echo $n; fi; \
done ) && \
echo "*** Minors: $minors" && \
# Filter out challenging packages from requirements_full.txt
sed \
-e '/pandas/d' \
-e '/pyarrow/d' \
-e '/tables/d' \
-e '/jinja2/d' \
-e '/pydantic/d' \
-e '/matplotlib/d' \
-e '/scikit-image/d' \
-e '/ncempy/d' \
-e '/h5py/d' \
-i /tmp/requirements_full.txt && \
#-e 's/^pydantic.*/pydantic<2/' \
# Install required Python packages
mkdir -p /ci/pip_cache && \
for minor in ${minors}; do \
python3.${minor} -m pip install -U pip && \
python3.${minor} -m pip install -U setuptools wheel; \
python3.${minor} -m pip install -U --cache-dir /ci/pip_cache \
oldest-supported-numpy; \
for minor in ${PY_MINORS}; do \
python3.${minor} -m pip install --cache-dir=/ci/pip_cache -U pip && \
python3.${minor} -m pip install --cache-dir=/ci/pip_cache \
-U setuptools wheel && \
python3.${minor} -m pip install --cache-dir=/ci/pip_cache \
oldest-supported-numpy \
-r /tmp/requirements_dev.txt \
-r /tmp/requirements_full.txt; \
done && \
rm -rf /ci/pip_cache

{{ EXTRA_POST }}
2 changes: 1 addition & 1 deletion .github/docker/gen_dockerfile.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
# Write Dockerfile for given system to stdout.
#
# Usage:
Expand Down
4 changes: 4 additions & 0 deletions .github/docker/run_cibuildwheel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
# and SYSTEM_TYPE is the specific linux system type, e.g., 2010 or 2014 for manylinux
# and _1_1 or _1_2 for musllinux
# More information: https://cibuildwheel.readthedocs.io/en/stable/options/#build-skip
#
# Example:
#
# run_cibuildwheel.sh cp38-musllinux_x86_64 _1_1
set -eu

if [[ $# -eq 0 ]]; then
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/container_builds_weekly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ jobs:
if: env.BUILD_NEW_IMAGE == 'true'
run: |
mkdir -p docker_build_wheel
sh .github/docker/gen_dockerfile.sh ${{ matrix.system }} ${{ matrix.type }} ${{ matrix.arch }} \
bash .github/docker/gen_dockerfile.sh ${{ matrix.system }} ${{ matrix.type }} ${{ matrix.arch }} \
> docker_build_wheel/Dockerfile-${{ matrix.system }}${{ matrix.type }}_${{ matrix.arch }}
- name: Login to GitHub Container Registry
Expand Down
1 change: 1 addition & 0 deletions bindings/python/tests/test_dataset1_save.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import dlite
from dlite.testutils import raises, importskip
importskip("tripper")
importskip("rdflib")

from tripper import DCTERMS, MAP, OWL, RDF, RDFS, XSD, Triplestore
from tripper.utils import en
Expand Down
1 change: 1 addition & 0 deletions bindings/python/tests/test_dataset2_load.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import dlite
from dlite.testutils import raises, importskip
importskip("tripper")
importskip("rdflib")

from tripper import MAP, Triplestore

Expand Down
30 changes: 20 additions & 10 deletions doc/user_guide/concepts.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,17 +93,27 @@ As a user, you will almost always deal with only entities or data
instances, but the hierarchy gives DLite a strong and theoretically
well-defined schema.

The actual data or *Data instances* are instances of the *Entity* that
describes them.
An *instance* in DLite is a formal representation of a dataset. It is
called an instance, because it is an instance of a data model (or
*metadata* using the DLite terminology).
This is similar to instances of classes in object oriented programming.

In DLite we often say that an instance is described by its metadata (aka data model).
The DLite metadata are themselves formalised and described by their meta-metadata.
Hence, metadata are instances, too.

At the lowest level of abstraction we have the actual data or *data
instances*.
Metadata that describe *data instances* are (for historical reasons
and compatibility with SOFT) called *entities*.
*Entities* are instances of the *EntitySchema*.
The *EntitySchema* is
an instance of the *BasicMetadataSchema* and an instance of itself
(meaning that it can be used to describe itself).
Hence, in DLite **everything is an instance**.
This has a practical implication that the API for instances can be applied
to all metadata as well.
Since the BasicMetadataSchema can describe itself, no more abstraction
levels are needed, making the DLite metadata schema complete and well-defined.
The *EntitySchema* is an instance of the *BasicMetadataSchema*, which is an
instance of itself (meaning that it can be used to describe itself).
Hence, in DLite **everything is an instance**. This has a practical
implication that the API for instances can be applied to all metadata
as well. Since the BasicMetadataSchema can describe itself, no more
abstraction levels are needed, making the DLite metadata schema
complete and well-defined.

From Figure 2, one can also see that *[collections]* are simply
instances of the *CollectionEntity*.
Expand Down
8 changes: 4 additions & 4 deletions requirements_full.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ typing_extensions>=4.1,<5
fortran-language-server>=1.12.0,<1.13

# For TEM demo
matplotlib>=3,<4
scikit-image>=0.19,<1
ncempy>=1.10,<2
h5py>=3.9,<4
##matplotlib>=3,<4
##scikit-image>=0.19,<1
##ncempy>=1.10,<2
##h5py>=3.9,<4
#oteapi-dlite>=0.1.5,<1
#git+https://github.com/EMMC-ASBL/oteapi-dlite.git@fa1b820383eb54a1c37f32f7b8ac9406b556dace#egg=oteapi_dlite
#otelib>=0.3.2,<1
Expand Down

0 comments on commit 3cd780b

Please sign in to comment.