Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.8-slim-bookworm
FROM python:3.10-slim-alpine
WORKDIR /
RUN apt-get update
RUN apt-get upgrade -y
Expand Down
13 changes: 11 additions & 2 deletions bin/transform_resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import sys
import click
from pathlib import Path
from multiprocessing import Pool, cpu_count
from multiprocessing import get_context, cpu_count
from tqdm import tqdm

from digital_land import __version__ as dl_version
Expand All @@ -22,6 +22,10 @@
logger = logging.getLogger(__name__)


def _init_worker(log_level):
logging.basicConfig(level=log_level, format='%(asctime)s - %(levelname)s: %(message)s')


def process_single_resource(args):
"""Process a single resource through the digital-land pipeline using Python library directly.

Expand Down Expand Up @@ -218,7 +222,12 @@ def process_resources(
failed = 0
errors = []

with Pool(processes=max_workers) as pool:
log_level = logging.getLogger().getEffectiveLevel()
with get_context("spawn").Pool(
processes=max_workers,
initializer=_init_worker,
initargs=(log_level,),
) as pool:
if use_progress_bar:
# Interactive mode with progress bar
results = list(tqdm(
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-e git+https://github.com/digital-land/pipeline.git@main#egg=digital-land
-e git+https://github.com/digital-land/pipeline.git@fix/remove-dask#egg=digital-land
-e .
tqdm
cloudpathlib[s3]
Loading