Knowasiak
Demonstrate HN: pyinfra v2

Demonstrate HN: pyinfra v2

That is the suave constituent ever.

pyinfra automates/provisions/manages/deploys infrastructure. It’d also moreover be used for advert-hoc say execution, service deployment, configuration administration and more. Stumble on the readme for more recordsdata.

The main 2.x free Up! Like v0 -> v1 this free Up mainly eliminates legacy APIs and techniques which order warnings in v1. Main adjustments:

Breaking: Python 2.7 (within the cessation!), 3.5 strengthen dropped, Python 3.6 is now the minimum required version.

Breaking: the “deploy listing” idea has been removed – every little thing now executes from the hot working listing which eliminates the ambiguous magic v1 used to purchase a deploy listing. A contemporary --chdir CLI flag has been added to position the working listing ahead of pyinfra executes.

This may maybe perhaps even admire an impact on scripts or CI workflows on the 2d setup, as an illustration:

# Former v1, deploy listing becomes deploys/elasticsearch/
pyinfra deploys/elasticsearch/inventories/production.py deploys/elasticsearch/deploy.py

# New v2, explicit chdir required
pyinfra --chdir deploys/elasticsearch/ inventories/production.py deploy.py

Parallel operation generation & info rewrite – right here’s a immense improvement to how pyinfra generates commands to escape on tune hosts. That is now escape in parallel across all hosts. Facts are now silent by particular person host quite than across all hosts which may maybe perhaps also yield important speedups in obvious situations.

This trade also brings strengthen for the total execution global arguments to info, and vastly simplifies the info implementation. World arguments will now be learn from host recordsdata in barely the identical ability they’re for operations, which turned into once generally a confusing gotcha in v1. This also ability that the arguments can admire varied values for every host and this is able to now not motive disorders.

Other breaking adjustments (warnings proven in v1 for loads of):

  • Non-existent host recordsdata raises an AttributeError when accessed by the usage of host.recordsdata.X
  • Alternate default division argument to None in git.repo operation
  • recent argument removed from mysql.privileges operation
  • Config variables have to now be position on the worldwide config object
  • Former vogue host.fact.fact_name access has been removed
  • The legacy init.* operations had been removed
  • Discontinue lowercasing package names in info & operations
  • Resolve away --info and --operations CLI flags
  • Resolve away --debug-recordsdata CLI flag
  • Resolve away Windows prefix on all Windows info
  • Rename establish argument to route in windows_files.* operations
  • Resolve away strengthen for jinja2 template parsing in string arguments
  • Resolve away historical pyinfra.modules module/import
  • Resolve away config.MIN_PYINFRA_VERSION
  • Resolve away division and create_branch arguments in git.worktree operation
  • Resolve away touch_periodic argument in honest.change operation (never used)
  • pyinfra.api.connectors module moved to pyinfra.connectors

Deprecated (displaying warnings, to be removed in v3):

  • issue and host arguments no longer have to be passed into operation or deploy capabilities
  • postgresql_* arguments renamed to psql_* in postgresql.* operations & info

Read More
Share this on knowasiak.com to narrate to of us on this topicRegister on Knowasiak.com now while you cessation Up now not registered yet.

About the author: Charlie
Fill your life with experiences so you always have a great story to tell

Get involved!

Get Connected!
One of the Biggest Social Platform for Entrepreneurs, College Students and all. Come and join our community. Expand your network and get to know new people!

Discussion(s)

No comments yet
Knowasiak We would like to show you notifications so you don't miss chats & status updates.
Dismiss
Allow Notifications