Skip to content

Commit 51c6d8f

Browse files
authored
MRG: Merge pull request #732 from octue/use-new-base-images-in-dockerfiles
Use new docker base images
2 parents 8d1c8bc + ba581c5 commit 51c6d8f

File tree

12 files changed

+91
-25
lines changed

12 files changed

+91
-25
lines changed

.devcontainer/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM windpioneers/gdal-python:familiar-catshark-gdal-2.4.1-python-3.9-dev
1+
FROM windpioneers/gdal-python:rational-swordtail-gdal-3.10.0-python-3.13-dev
22

33
# Tell zsh where you want to store history
44
# We leave you to decide, but if you put this into a folder that's been mapped

.github/workflows/python-ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
if: "!contains(github.event.head_commit.message, 'skipci')"
2424
runs-on: ${{ matrix.os }}
2525
env:
26-
USING_COVERAGE: "3.10"
26+
USING_COVERAGE: "3.12"
2727
strategy:
2828
matrix:
2929
os: [ubuntu-latest, windows-latest, macos-latest]
@@ -36,7 +36,7 @@ jobs:
3636
- name: Setup Python
3737
uses: actions/setup-python@v5
3838
with:
39-
python-version: "3.10"
39+
python-version: "3.12"
4040

4141
- name: Install Poetry
4242
uses: snok/[email protected]

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
if: "${{ github.event_name == 'workflow_dispatch' || github.event.pull_request.merged == true }}"
2626
runs-on: ${{ matrix.os }}
2727
env:
28-
USING_COVERAGE: "3.10"
28+
USING_COVERAGE: "3.12"
2929
strategy:
3030
matrix:
3131
os: [ubuntu-latest, windows-latest, macos-latest]
@@ -40,7 +40,7 @@ jobs:
4040
- name: Setup Python
4141
uses: actions/setup-python@v5
4242
with:
43-
python-version: "3.10"
43+
python-version: "3.12"
4444

4545
- name: Install Poetry
4646
uses: snok/[email protected]

docs/contributing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ We use continuous deployment and semantic versioning for our releases:
3939
```
4040
git clone <your_forked_repo_address> # Fetches the repo to your local machine
4141
cd octue-sdk-python # Move into the repo directory
42-
pyenv virtualenv 3.9 myenv # Makes a virtual environment for you to install the dev tools into. Use any python >= 3.8
42+
pyenv virtualenv 3.10 myenv # Makes a virtual environment for you to install the dev tools into. Use any python >= 3.10
4343
pyenv activate myenv # Activates the virtual environment so you don't affect other installations
4444
pip install poetry # Installs the poetry package manager
4545
poetry install --all-extras # Installs the package editably, including developer dependencies (e.g. testing and code formatting utilities)

docs/source/creating_services.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ Dockerfile (optional)
8080
Twined services run in a Docker container if they are deployed. They can also run this way locally. The SDK
8181
provides a default ``Dockerfile`` for these purposes that will work for most cases:
8282

83-
- For deploying to `Kubernetes <https://github.com/octue/octue-sdk-python/blob/main/octue/cloud/deployment/dockerfiles/Dockerfile-python311>`_
83+
- For deploying to `Kubernetes <https://github.com/octue/octue-sdk-python/blob/main/octue/cloud/deployment/dockerfiles/Dockerfile-python313>`_
8484

8585
However, you may need to write and provide your own ``Dockerfile`` if your app requires:
8686

octue/cloud/deployment/dockerfiles/Dockerfile-python311

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM windpioneers/gdal-python:modest-heron-gdal-2.4.1-python-3.11-slim
1+
FROM windpioneers/gdal-python:rational-swordtail-gdal-3.10.0-python-3.11-slim
22

33
# Ensure print statements and log messages appear promptly in Cloud Logging.
44
ENV PYTHONUNBUFFERED=True
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
FROM windpioneers/gdal-python:rational-swordtail-gdal-3.10.0-python-3.12-slim
2+
3+
# Ensure print statements and log messages appear promptly in Cloud Logging.
4+
ENV PYTHONUNBUFFERED=True
5+
6+
ENV PROJECT_ROOT=/workspace
7+
WORKDIR $PROJECT_ROOT
8+
9+
RUN apt-get update -y && apt-get install -y --fix-missing build-essential && rm -rf /var/lib/apt/lists/*
10+
11+
# Install poetry.
12+
ENV POETRY_HOME=/root/.poetry
13+
ENV PATH="$POETRY_HOME/bin:$PATH"
14+
RUN curl -sSL https://install.python-poetry.org | python3 - && poetry config virtualenvs.create false;
15+
16+
# Copy in the dependencies file(s) for caching. One or more of `requirements.txt`, `setup.py`, and `pyproject.toml and
17+
# `poetry.lock` must be present.
18+
COPY pyproject.tom[l] poetry.loc[k] setup.p[y] requirements.tx[t] ./
19+
20+
# If `pyproject.toml` is present, install the dependencies only to utilise layer caching for quick rebuilds.
21+
RUN if [ -f "pyproject.toml" ]; then poetry install \
22+
--no-ansi \
23+
--no-interaction \
24+
--no-cache \
25+
--no-root \
26+
--only main; \
27+
fi
28+
29+
# Copy local code to the application root directory.
30+
COPY . .
31+
32+
# Install local packages if using poetry. Otherwise, install everything if using `setup.py` or `requirements.txt`.
33+
RUN if [ -f "pyproject.toml" ]; then poetry install --only main; \
34+
elif [ -f "setup.py" ]; then pip install --upgrade pip && pip install -e .; \
35+
elif [ -f "requirements.txt" ]; then pip install --upgrade pip && pip install -r requirements.txt; fi
36+
37+
ENV USE_OCTUE_LOG_HANDLER=1
38+
ENV COMPUTE_PROVIDER=GOOGLE_KUEUE
39+
CMD ["octue", "question", "ask", "local"]
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
FROM windpioneers/gdal-python:rational-swordtail-gdal-3.10.0-python-3.13-slim
2+
3+
# Ensure print statements and log messages appear promptly in Cloud Logging.
4+
ENV PYTHONUNBUFFERED=True
5+
6+
ENV PROJECT_ROOT=/workspace
7+
WORKDIR $PROJECT_ROOT
8+
9+
RUN apt-get update -y && apt-get install -y --fix-missing build-essential && rm -rf /var/lib/apt/lists/*
10+
11+
# Install poetry.
12+
ENV POETRY_HOME=/root/.poetry
13+
ENV PATH="$POETRY_HOME/bin:$PATH"
14+
RUN curl -sSL https://install.python-poetry.org | python3 - && poetry config virtualenvs.create false;
15+
16+
# Copy in the dependencies file(s) for caching. One or more of `requirements.txt`, `setup.py`, and `pyproject.toml and
17+
# `poetry.lock` must be present.
18+
COPY pyproject.tom[l] poetry.loc[k] setup.p[y] requirements.tx[t] ./
19+
20+
# If `pyproject.toml` is present, install the dependencies only to utilise layer caching for quick rebuilds.
21+
RUN if [ -f "pyproject.toml" ]; then poetry install \
22+
--no-ansi \
23+
--no-interaction \
24+
--no-cache \
25+
--no-root \
26+
--only main; \
27+
fi
28+
29+
# Copy local code to the application root directory.
30+
COPY . .
31+
32+
# Install local packages if using poetry. Otherwise, install everything if using `setup.py` or `requirements.txt`.
33+
RUN if [ -f "pyproject.toml" ]; then poetry install --only main; \
34+
elif [ -f "setup.py" ]; then pip install --upgrade pip && pip install -e .; \
35+
elif [ -f "requirements.txt" ]; then pip install --upgrade pip && pip install -r requirements.txt; fi
36+
37+
ENV USE_OCTUE_LOG_HANDLER=1
38+
ENV COMPUTE_PROVIDER=GOOGLE_KUEUE
39+
CMD ["octue", "question", "ask", "local"]

octue/cloud/storage/client.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,13 @@
1414
from google.cloud.storage import Client
1515
from google.cloud.storage.constants import _DEFAULT_TIMEOUT
1616
from google.cloud.storage.retry import DEFAULT_RETRY
17+
from google_crc32c import Checksum
1718

1819
from octue.cloud import storage
1920
from octue.exceptions import CloudStorageBucketNotFound
2021
from octue.utils.decoders import OctueJSONDecoder
2122
from octue.utils.encoders import OctueJSONEncoder
2223

23-
with warnings.catch_warnings():
24-
warnings.filterwarnings("ignore", category=RuntimeWarning, module="google_crc32c")
25-
from google_crc32c import Checksum
26-
2724
logger = logging.getLogger(__name__)
2825

2926

octue/mixins/hashable.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
import base64
22
import collections.abc
33
import datetime
4-
import warnings
5-
6-
with warnings.catch_warnings():
7-
warnings.filterwarnings("ignore", category=RuntimeWarning, module="google_crc32c")
8-
from google_crc32c import Checksum
94

5+
from google_crc32c import Checksum
106

117
EMPTY_STRING_HASH_VALUE = "AAAAAA=="
128

0 commit comments

Comments
 (0)