You can now create/modify pools via the Airflow CLI. https://github.com/apache/incubator-airflow/pull/1735/commits
-s Resources that are typically modified via the webserver, such as pools, connections, & variables, should eventually be managed via the CLI to allow for better integration with automation used to provision systems or deploy new dags. Variables and pools (and I believe connections) are all done via the CLI. On Tue, Sep 6, 2016 at 12:22 PM, harish singh <[email protected]> wrote: > 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 > > >
