Skip to content
Discussion options

You must be logged in to vote

I found a solution to this problem, using the client.register_worker_callbacks method (https://distributed.dask.org/en/latest/api.html#distributed.Client.register_worker_callbacks). It sets up the right environment for every dask worker. For example:

import os

import rasterio
from dask_jobqueue import SLURMCluster
from distributed import Client
from osgeo import gdal

cluster = SLURMCluster(...)
client = Client(cluster)
credentials = {...}

def configure_workers_environment():
    gdal.SetConfigOption('AWS_REGION', 'eu-central-1')
    gdal.SetConfigOption('AWS_SECRET_ACCESS_KEY', credentials["AWS_SECRET_ACCESS_KEY"])
    gdal.SetConfigOption('AWS_ACCESS_KEY_ID', credentials["AWS_ACCESS_K…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by EugenePlanteurCS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant