Leandro Mana
05/12/2021, 11:33 PMDaskKubernetesEnvironment
was supported and that worked great, now Im using the run_configs
and executors
and Im having the botocore region issue displayed, not sure Im missing any argument for the DaskExecutor
please check the code bellow:
flow.storage = Docker(registry_url=ecr,
python_dependencies=python_dependencies,
files={f'{getcwd()}/src/dask_flow': '/modules/dask_flow'},
env_vars={"PYTHONPATH": "$PYTHONPATH:modules/"},
image_tag='latest')
flow.run_config=KubernetesRun()
flow.executor=DaskExecutor(
cluster_class="dask_cloudprovider.aws.FargateCluster",
cluster_kwargs={'n_workers': 5, 'region_name':aws_region})
Leandro Mana
05/12/2021, 11:35 PMNoRegionError: You must specify a region.
Kevin Kho
Leandro Mana
05/13/2021, 12:52 AMLeandro Mana
05/13/2021, 12:53 AMflow.run_config=KubernetesRun(env={
'AWS_DEFAULT_REGION':aws_region,
'AWS_SECRET_ACCESS_KEY': environ.get('AWS_SECRET_ACCESS_KEY'),
'AWS_ACCESS_KEY_ID': environ.get('AWS_ACCESS_KEY_ID'),
'AWS_SESSION_TOKEN': environ.get('AWS_SESSION_TOKEN')})
flow.executor=DaskExecutor(
cluster_class="dask_cloudprovider.aws.FargateCluster",
cluster_kwargs={'n_workers': 5})
and see that is getting the region and credentials from the KubernetesRun()
Kevin Kho
Leandro Mana
05/13/2021, 12:53 AMLeandro Mana
05/13/2021, 12:53 AMLeandro Mana
05/13/2021, 12:54 AMDaskKubernetesEnvironment
worked perfectlyLeandro Mana
05/13/2021, 12:54 AMrun_config
and executor
I dont find the way... flows are properly registered but when deployed into the EKS fails.Leandro Mana
05/13/2021, 12:57 AMDaskExecutor
to run on EKS.Leandro Mana
05/13/2021, 12:58 AMcluster_class
is using dask_cloudprovider and EKS is not mentioned there https://cloudprovider.dask.org/en/latest/aws.html#fargateKevin Kho
Leandro Mana
05/13/2021, 1:07 AMLeandro Mana
05/13/2021, 1:14 AMcluster_class="dask_cloudprovider.FargateCluster"
but I had to install that module via pip so in my code is cluster_class="dask_cloudprovider.aws.FargateCluster"
so there is a .aws
as without installing via pip it was complaining at health check that there is no dask_cloudprovider
moduleKevin Kho
Leandro Mana
05/13/2021, 1:31 AMLeandro Mana
05/13/2021, 8:15 PMKevin Kho
Leandro Mana
05/13/2021, 8:15 PMKevin Kho
env
variable in the cluster_kwargs
to DaskExecutor
, or you could setup EKS so that AWS IAM roles are automatically forwarded to pods (you need to add a service account to the pod for that to work). Lots of options.
If the only goal is “scale dask out on AWS” though, then using dask-cloudprovider with FargateCluster
would be a simpler story, as kubernetes adds additional complications.Leandro Mana
05/13/2021, 8:23 PMDaskKubernetesEnvironment
Leandro Mana
05/13/2021, 8:23 PMLeandro Mana
05/13/2021, 8:24 PMLeandro Mana
05/13/2021, 8:26 PMDaskExecutor
the error was like no finding prefect
module... which is even weird : ( will confirm on this shortly.Leandro Mana
05/13/2021, 8:34 PMenv
var into the cluster_kwargs
to DaskExecutor
? as that class does not have env
keyword, it needs to be as an string?Kevin Kho
DaskExecutor(cluster_kwargs={enviroment: {AWS_CREDS_AND_REGION}})
Kevin Kho
Kevin Kho
Leandro Mana
05/13/2021, 9:32 PM