diff --git a/Dockerfile b/Dockerfile index cf7ba28..b53e98f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,24 +1,28 @@ # This Dockerfile initiates a working environment that can be used to run deploy script -# After -FROM rockylinux:8 +FROM python:3.11-bookworm -RUN dnf -y groupinstall "Development Tools" -RUN dnf -y install which -RUN dnf -y install python3.11 -RUN dnf -y install gcc-gfortran -RUN dnf -y install git +RUN apt-get update && apt-get install -y --no-install-recommends \ + autoconf \ + automake \ + build-essential \ + cmake \ + gfortran \ + git \ + libhdf5-dev \ + openssh-client \ + && rm -rf /var/lib/apt/lists/* -RUN python3.11 -m venv /tmp/deploy_env +RUN python3 -m venv /tmp/deploy_env ENV PATH="/tmp/deploy_env/bin:$PATH" ENV VIRTUAL_ENV="/tmp/deploy_env" +ENV UV_PROJECT_ENVIRONMENT="/tmp/deploy_env" WORKDIR /work COPY ./src ./src -COPY ./poetry.lock ./poetry.lock +COPY ./uv.lock ./uv.lock COPY ./pyproject.toml ./pyproject.toml -COPY ./config.yaml ./config.yaml # Poetry requires readme to exist RUN touch ./README.md @@ -27,7 +31,7 @@ RUN ssh-keyscan github.com >> /root/.ssh/known_hosts RUN chmod 0700 /root/.ssh RUN pip install --upgrade pip -RUN pip install poetry -RUN poetry install +RUN pip install uv +RUN uv sync ENTRYPOINT ["/bin/bash","-c", "source /tmp/deploy_env/bin/activate; bash"] diff --git a/examples/full/phast.config.yaml b/examples/full/phast.config.yaml new file mode 100644 index 0000000..bad7c0e --- /dev/null +++ b/examples/full/phast.config.yaml @@ -0,0 +1,35 @@ +main-package: phast +entrypoint: bin/phast + +packages: + - name: boost + version: 1.89.0 + src: + type: git + url: https://github.com/boostorg/boost.git + ref: 1bed2b0712b2119f20d66c5053def9173c8462a5 + + build: | + git submodule update --init --recursive + export BOOST_ROOT="$out" + mkdir build && cd build + cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$out" + make install + + - name: phast + version: 3.8.6 + depends: [ boost ] + src: + type: git + url: https://github.com/equinor/phast_usgs + ref: a37cd5f224302fa88a1c903f73d4490b5f4a235c + + build: | + autoreconf -fi + ./configure \ + --with-boost="$boost" \ + CPPFLAGS="-I/usr/include/hdf5/serial" \ + LDFLAGS="-L/usr/lib/aarch64-linux-gnu/hdf5/serial" + make all + make check + make install \ No newline at end of file diff --git a/src/deploy/package_list.py b/src/deploy/package_list.py index c06bf52..2adc1dc 100644 --- a/src/deploy/package_list.py +++ b/src/deploy/package_list.py @@ -17,8 +17,8 @@ def __init__( prefix: Path, check_existence: bool = True, ) -> None: - self.prefix: Path = prefix - self.storepath: Path = prefix / ".store" + self.prefix: Path = prefix.resolve() + self.storepath: Path = self.prefix / ".store" self.config: Config = config buildmap = {x.name: x for x in config.packages}