This is how we have been doing it.
pool_name = "pool_A"
num_slots = 10
# creating pool
session = airflow.settings.Session()
pool = (
session.query(Pool)
.filter(Pool.pool == pool_name)
.first())
if not pool:
logging.info("Creating pool: {} with slots:
".format(pool_name, str(num_slots)))
session.add(Pool(pool=pool_name, slots=num_slots))
session.commit()
session.close()
On Tue, Sep 6, 2016 at 12:18 PM, Lance Norskog <[email protected]>
wrote:
> In the web UI, Admin->Pools lets you create, edit & view all Pools.
>
> On Sun, Sep 4, 2016 at 9:40 PM, הילה ויזן <[email protected]> wrote:
>
> > Hi,
> > we use a pool of size 1 to restrict parallelism of a task in dag.
> > We created the pool via airflow webserver.
> >
> > Is there any other way to create it via a script? maybe sql query on DB?
> > I didn't find an appropriate CLI command.
> >
> > Thanks,
> > Hila
> >
>
>
>
> --
> Lance Norskog
> [email protected]
> Redwood City, CA
>