bit of an unusual question... but is there anythin...
# ask-metaflow
c
bit of an unusual question... but is there anything that would go drastically wrong if, flows using the same metadata service, sometimes have different datastores configured?
1
this is the context of wanting to have flows which execute on different regions, but share the same global metadata service
as opposed to entirely independent metaflow infra for each region
d
iirc, it should work with more recent versions of metaflow where the root of the datastore is stored in the metadata.
💯 1
anything reasonably recent shouod be fine.
but I have not tested it recently.
a
@calm-smartphone-49719 with datastore in different regions - one concerns would be the cost of moving data cross-region (depending on where the compute is happening). This may or may not be a concern.
But using different datastores with a globally unique metadata service is a well supported pattern
c
thanks @ancient-application-36103 @dry-beach-38304, appreciate it. Our use case has region specific data due to certain contract requirements and thus requires region-specific compute
a
that should work well. we have several users that utilize the same pattern. If you see any issues, please do let us know - it will be very likely a regression awaiting a bug fix
👍 1
c
one thing i am struggling with is changing
METAFLOW_DATASTORE_SYSROOT_S3
at run-time. Even if I programmatically export
METAFLOW_DATASTORE_SYSROOT_S3=xxx
into the environment as soon as possible after imports, metaflow still seems to be accessing the datastore defined in
.metaflow/config.json
. I have also tried modifying
metaflow.metaflow_config.DATASTORE_SYSROOT_S3
, also without success
it seems i am "too late" at that stage, and some other setup has taken place and "locked in" the datastore-sysroot value
d
your best bet would be to set it as an envvar
or do it prior to importing metaflow
c
sounds about right, thanks @dry-beach-38304. i am trying to make it easier for our users so they can just add
--region
to the command they normally run and all will be rainbows and unicorn, and it mostly works!
d
I would recommend a wrapper script then maybe where you just look for that arg and strip it out and then pass that on to metaflow. Not the prettiest but should do the trick.
c
thanks @dry-beach-38304, that's more or less what we are converging towards
finally got it working, the main thing was to defer metaflow import until our setup code had a chance to run. Managed to avoid having to use a wrapper.
d
awesome!!